hi there , i have orders list that i need to get only if the days and the open are open by parm are over from the order date
for exsample :
i have 4 customers and every one of the have a diffrent day aleart for open order
cust 1 has 30 days
cust 2 has 45 days
if there is an open orders for cust 1 and 30 days are over from the order date i need to pull it out from the db .....i am c# Sql2000 Db .
this is the code that i write for this opration :
ad = new SqlDataAdapter( "selectHasbonitNum,SapakNu
m,Hasbonit
Date,SahHa
kol,
TaneiTaslom,dbo.Hasboniot.
CustName from dbo.Hasboniot inner join dbo.Customers on SapakNum=CustNum " +
" where dbo.Hasboniot.OutOrIn=1 and dbo.Hasboniot.SholamYoN=0 and dbo.Hasboniot.HasType=0",C
on);
ad.Fill(ds);
foreach(DataRow row in ds.Tables[0].Rows)
{
act=false;
temp1 = row[0].ToString();
dt = DateTime.Parse(row[2].ToSt
ring());
try
{
days = Int32.Parse(row[4].ToStrin
g()); // this is the days parm for every cust
int num = dt.DayOfYear;
int num1 = DateTime.Now.DayOfYear;
sum=Decimal.Parse(row[3].T
oString())
;
name = row[5].ToString();
Snum = Int32.Parse(row[1].ToStrin
g());
temp = num1-num;
}
catch
{
act=true;
}
if((temp > days) && (act==false))
{
DataRow newrow = dsc.Tables[0].NewRow();
newrow[0]=temp1;
newrow[1]=dt.ToShortDateSt
ring();
newrow[2]=sum;
newrow[3]=name;
newrow[4]=Snum;
newrow[5]=days;
int tot = temp-days;
newrow[6]=tot;
dsc.Tables[0].Rows.Add(new
row);
}
ths is working good the problem is when there is 1 year diffrent from the order date to the days parm value
what do i need to do ?
thanks ....
Start Free Trial