protected override void InsertingItem(SysparameterInfo info, ParkDataContext parking) { string cmd = @"delete Sysparameter where Parameter=@p0 " + "insert into SysParameter (Parameter,ParameterValue,Description) values (@p1,@p2,@p3)"; parking.ExecuteCommand(cmd, info.Parameter, info.Parameter, info.ParameterValue, info.Description); }
public CommandResult InsertWithPrimaryKey(CardPaymentInfo info) { CommandResult result = null; try { ParkDataContext parking = ParkDataContextFactory.CreateParking(base.ConnectStr); if (parking != null) { string cmdtext = string.Empty; cmdtext += string.Format("SET IDENTITY_INSERT CardPaymentRecord ON;"); cmdtext += info.SQLInsertWithPrimaryCmd; cmdtext += string.Format("SET IDENTITY_INSERT CardPaymentRecord OFF;"); parking.ExecuteCommand(cmdtext); result = new CommandResult(ResultCode.Successful, string.Empty); } else { result = new CommandResult(ResultCode.Fail, string.Empty); } } catch (Exception ex) { Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); result = new CommandResult(ResultCode.Fail, string.Empty); } return(result); }
protected override void InsertingItem(SysparameterInfo info, ParkDataContext parking) { string cmd = string.Format(@"delete Sysparameter where Parameter='{0}' " + "insert into SysParameter (Parameter,ParameterValue,Description) " + "values ('{1}','{2}','{3}')", info.Parameter, info.Parameter, info.ParameterValue, info.Description); parking.ExecuteCommand(cmd); }
public void DeleteAllSnapShotBefore(DateTime shotDatetime) { ParkDataContext parking = ParkDataContextFactory.CreateParking(base.ConnectStr); string cmd = "delete SnapShot where ShotAt < '" + shotDatetime.ToString("yyyy-MM-dd") + "'"; parking.CommandTimeout = 5 * 60 * 60 * 1000; parking.ExecuteCommand(cmd); }
public void DeleteAllSnapShotBefore(DateTime shotDatetime) { try { ParkDataContext parking = ParkDataContextFactory.CreateParking(base.ConnectStr); string cmd = "delete SnapShot where ShotAt < '" + shotDatetime.ToString("yyyy-MM-dd") + "'"; parking.CommandTimeout = 5 * 60 * 60 * 1000; parking.ExecuteCommand(cmd); } catch (Exception ex) { Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); } }
public void DeleteAllCardEventBefore(DateTime eventDatetime) { try { ParkDataContext parking = ParkDataContextFactory.CreateParking(base.ConnectStr); if (parking != null) { string cmd = "delete CardEvent where EventDateTime < '" + eventDatetime.ToString("yyyy-MM-dd") + "'"; parking.CommandTimeout = 5 * 60 * 60 * 1000; parking.ExecuteCommand(cmd); } } catch (Exception ex) { Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); } }
protected override void DeletingItem(WaitingCommandInfo info, ParkDataContext parking) { string cmd = @"delete WaitingCommand where EntranceID=@p0 and Command=@p1 and CardID=@p2"; parking.ExecuteCommand(cmd, info.EntranceID, info.Command, info.CardID); }