public static void Insert(DBLayer.Visits.Visits_Details det) { string sql = "INSERT INTO Visits (ClientId, [Date], [Time], [Type], BoxId, WithoutKey, TimeOff, CoachId, IsSubstitution) "; sql += " VALUES (" + det.ClientId.ToString() + ", '" + det.Date.Date.ToString("yyyyMMdd") + "', '" + det.Time + "', " + det.Type.ToString() + ", " + det.BoxId.ToString() + ", " + Convert.ToInt32(det.WithoutKey).ToString() + ", '', " + det.CoachId.ToString() + ", " + Convert.ToInt32(det.IsSubstitution) + ")"; ZFort.DB.Execute.ExecuteString_void(sql); }
public static void Update(DBLayer.Visits.Visits_Details det) { ZFort.DB.Execute.ExecuteString_void("UPDATE Visits SET [ClientId] = " + det.ClientId.ToString() + " WHERE [Id] = " + det.Id.ToString()); ZFort.DB.Execute.ExecuteString_void("UPDATE Visits SET [Date] = '" + det.Date.Date.ToString("yyyyMMdd") + "' WHERE [Id] = " + det.Id.ToString()); ZFort.DB.Execute.ExecuteString_void("UPDATE Visits SET [Time] = '" + det.Time + "' WHERE [Id] = " + det.Id.ToString()); ZFort.DB.Execute.ExecuteString_void("UPDATE Visits SET [Type] = " + det.Type.ToString() + " WHERE [Id] = " + det.Id.ToString()); ZFort.DB.Execute.ExecuteString_void("UPDATE Visits SET [BoxId] = " + det.BoxId.ToString() + " WHERE [Id] = " + det.Id.ToString()); ZFort.DB.Execute.ExecuteString_void("UPDATE Visits SET [CoachId] = " + det.CoachId.ToString() + " WHERE [Id] = " + det.Id.ToString()); }
public CtrlExitInfo(DBLayer.Clients.Details det) { InitializeComponent(); this.Details = det; lblClient.Text = det.FIO; int id = DBLayer.Visits.GetLastVisit(det.Id); DBLayer.Visits.Visits_Details vDet = DBLayer.Visits.GetDetails(id); lblBox.Text = DBLayer.Boxes.GetNumber(vDet.BoxId).ToString(); this.VisitId = id; if (id != 0) { DBLayer.Visits.Visits_Details detV = DBLayer.Visits.GetDetails(id); lblDate.Text = detV.Time; } }