///<summary></summary> public static void Update(ScreenGroup Cur){ if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),Cur); return; } Crud.ScreenGroupCrud.Update(Cur); }
///<summary></summary> public static long Insert(ScreenGroup Cur) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Cur.ScreenGroupNum=Meth.GetLong(MethodBase.GetCurrentMethod(),Cur); return Cur.ScreenGroupNum; } return Crud.ScreenGroupCrud.Insert(Cur); }
///<summary></summary> public static void Update(ScreenGroup Cur) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), Cur); return; } Crud.ScreenGroupCrud.Update(Cur); }
///<summary></summary> public static long Insert(ScreenGroup Cur) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Cur.ScreenGroupNum = Meth.GetLong(MethodBase.GetCurrentMethod(), Cur); return(Cur.ScreenGroupNum); } return(Crud.ScreenGroupCrud.Insert(Cur)); }
///<summary>This will also delete all screen items, so may need to ask user first.</summary> public static void Delete(ScreenGroup Cur){ if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),Cur); return; } string command="DELETE from screen WHERE ScreenGroupNum ='"+POut.Long(Cur.ScreenGroupNum)+"'"; Db.NonQ(command); command="DELETE from screengroup WHERE ScreenGroupNum ='"+POut.Long(Cur.ScreenGroupNum)+"'"; Db.NonQ(command); }
///<summary>This will also delete all screen items, so may need to ask user first.</summary> public static void Delete(ScreenGroup Cur) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), Cur); return; } string command = "DELETE from screen WHERE ScreenGroupNum ='" + POut.Long(Cur.ScreenGroupNum) + "'"; Db.NonQ(command); command = "DELETE from screengroup WHERE ScreenGroupNum ='" + POut.Long(Cur.ScreenGroupNum) + "'"; Db.NonQ(command); }
///<summary>Updates all screens for a group with the date,prov, and location info of the current group.</summary> public static void UpdateForGroup(ScreenGroup ScreenGroupCur){ if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),ScreenGroupCur); return; } string command = "UPDATE screen SET " +"ScreenDate =" +POut.Date (ScreenGroupCur.SGDate) +",GradeSchool ='" +POut.String(ScreenGroupCur.GradeSchool)+"'" +",County ='" +POut.String(ScreenGroupCur.County)+"'" +",PlaceService ='" +POut.Long ((int)ScreenGroupCur.PlaceService)+"'" +",ProvNum ='" +POut.Long (ScreenGroupCur.ProvNum)+"'" +",ProvName ='" +POut.String(ScreenGroupCur.ProvName)+"'" +" WHERE ScreenGroupNum = '" +ScreenGroupCur.ScreenGroupNum.ToString()+"'"; Db.NonQ(command); }
///<summary>Updates all screens for a group with the date,prov, and location info of the current group.</summary> public static void UpdateForGroup(ScreenGroup ScreenGroupCur) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), ScreenGroupCur); return; } string command = "UPDATE screen SET " + "ScreenDate =" + POut.Date(ScreenGroupCur.SGDate) + ",GradeSchool ='" + POut.String(ScreenGroupCur.GradeSchool) + "'" + ",County ='" + POut.String(ScreenGroupCur.County) + "'" + ",PlaceService ='" + POut.Long((int)ScreenGroupCur.PlaceService) + "'" + ",ProvNum ='" + POut.Long(ScreenGroupCur.ProvNum) + "'" + ",ProvName ='" + POut.String(ScreenGroupCur.ProvName) + "'" + " WHERE ScreenGroupNum = '" + ScreenGroupCur.ScreenGroupNum.ToString() + "'"; Db.NonQ(command); }
///<summary>This will also delete all screen items, so may need to ask user first.</summary> public static void Delete(ScreenGroup Cur) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), Cur); return; } string command = "SELECT SheetNum FROM screen WHERE ScreenGroupNum=" + POut.Long(Cur.ScreenGroupNum) + " AND SheetNum!=0"; DataTable table = Db.GetTable(command); foreach (DataRow row in table.Rows) //Delete any attached sheets if the screen gets deleted. { Sheets.Delete(PIn.Long(row["SheetNum"].ToString())); } command = "DELETE FROM screen WHERE ScreenGroupNum ='" + POut.Long(Cur.ScreenGroupNum) + "'"; Db.NonQ(command); command = "DELETE FROM screengroup WHERE ScreenGroupNum ='" + POut.Long(Cur.ScreenGroupNum) + "'"; Db.NonQ(command); }