public static void Insert(DBLayer.Sales.Details det) { string sql = "INSERT INTO Sales (ProductId, UserId, [Date], [Time], Quantity, IsDeleted) "; sql += " VALUES (" + det.ProductId.ToString() + ", " + det.UserId.ToString() + ", '" + det.Date.ToString("yyyyMMdd") + "', '" + det.Time + "', " + det.Quantity.ToString() + ", 0)"; ZFort.DB.Execute.ExecuteString_void(sql); }
public static void SetDelete(DBLayer.Sales.Details det) { ZFort.DB.Execute.ExecuteString_void("UPDATE Sales SET IsDeleted = 1 WHERE [Id] = " + det.Id.ToString()); ZFort.DB.Execute.ExecuteString_void("UPDATE Sales SET DeleteDate = '" + det.DeleteDate.ToString("yyyyMMdd") + "' WHERE [Id] = " + det.Id.ToString()); ZFort.DB.Execute.ExecuteString_void("UPDATE Sales SET DeleteReason = '" + det.DeleteReason + "' WHERE [Id] = " + det.Id.ToString()); }
void frm3_SelectDateMsg(object sender, FitnessProject.ServiceForms.FrmCalendar.DateSelectEventArgs args) { DBLayer.Sales.Details det = DBLayer.Sales.GetDetails(this.Id); det.Date = args.SelectedDate; DBLayer.Sales.Update(det); LoadData(); }
public static void Update(DBLayer.Sales.Details det) { ZFort.DB.Execute.ExecuteString_void("UPDATE Sales SET [ProductId] = " + det.ProductId.ToString() + " WHERE [Id] = " + det.Id.ToString()); ZFort.DB.Execute.ExecuteString_void("UPDATE Sales SET [Quantity] = " + det.Quantity.ToString() + " WHERE [Id] = " + det.Id.ToString()); ZFort.DB.Execute.ExecuteString_void("UPDATE Sales SET [UserId] = " + det.UserId.ToString() + " WHERE [Id] = " + det.Id.ToString()); ZFort.DB.Execute.ExecuteString_void("UPDATE Sales SET [Date] = '" + det.Date.ToString("yyyyMMdd") + "' WHERE [Id] = " + det.Id.ToString()); ZFort.DB.Execute.ExecuteString_void("UPDATE Sales SET [Time] = '" + det.Time + "' WHERE [Id] = " + det.Id.ToString()); }
void frm_SelectReasonMsg(object sender, FitnessProject.ServiceForms.ReasonEventArgs args) { DBLayer.Sales.Details det = DBLayer.Sales.GetDetails(this.Id); det.DeleteReason = args.Reason; det.Quantity = 0; det.DeleteDate = DateTime.Now; DBLayer.Sales.SetDelete(det); DBLayer.Sales.Update(det); LoadData(); }