Link to home
Start Free TrialLog in
Avatar of Tech_Men
Tech_MenFlag for Israel

asked on

scheduled deal

hi there ,

i my program i have a scheduled deals for exsample :

i have a payper deal the customer want to publish an adds in my payper
the adds need to be published every 7 days from the start day
and every 7 days i need to decrease the performance shows from the deal

if custoer a have 24 Shows and every 7 days there is a show in the payper i need to update the Performance show to 22
if 14 days are over from the deal strat day .


how can i do it ?

thanks ....
ASKER CERTIFIED SOLUTION
Avatar of whatsit2002
whatsit2002
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tech_Men

ASKER

this is what i am trying to do  :

SqlConnection MyCon = new SqlConnection();
MyCon.ConnectionString = BL.Conn.ConnString();
MyCon.Close();
MyCon.Open();

                IDbCommand cmd = MyCon.CreateCommand();
                cmd.CommandText = "SELECT * FROM SpyDeal";
      IDataReader reader8 = cmd.ExecuteReader();

      while (reader8.Read())
      {
                      int Every = Int32.Parse(reader8["MofaEvery"].ToString()); // this is the num of days
            DateTime dt = (DateTime)(reader8["LastDateShow"]); // from this date i need to count forward
            DateTime dt2 = dt.AddDays(Every); // if the dt2 is == to the Every i need to do something
                        
            TimeSpan Diff = dt2 - dt;
            
            // i need to chek if the dt are >= dt2  how can i do it ?


      {
                        
}
      reader8.Close();
      MyCon.Close();
            
}