public bool Update(ParkLpPlan model) { using (DbOperator dbOperator = ConnectionManager.CreateConnection()) { model.DataStatus = DataStatus.Normal; model.LastUpdateTime = DateTime.Now; model.HaveUpdate = SystemDefaultConfig.DataUpdateFlag; StringBuilder strSql = new StringBuilder(); strSql.Append("update ParkLpPlan set PKID=@PKID,PlateNumber=@PlateNumber,PlanOutTime=@PlanOutTime,PlanRtnTime=@PlanRtnTime,EmpName=@EmpName,Reason=@Reason,Remark=@Remark,ZB_User=@ZB_User,"); strSql.Append(" ZB_Time=@ZB_Time,SH_User=@SH_User,SH_Time=@SH_Time,SH_State=@SH_State,LastUpdateTime=@LastUpdateTime,HaveUpdate=@HaveUpdate,DataStatus=@DataStatus where PlanID=@PlanID"); dbOperator.ClearParameters(); dbOperator.AddParameter("PlanID", model.PlanID); dbOperator.AddParameter("PlateNumber", model.PlateNumber); dbOperator.AddParameter("PlanOutTime", model.PlanOutTime); dbOperator.AddParameter("PKID", model.PKID); dbOperator.AddParameter("PlanRtnTime", model.PlanRtnTime); dbOperator.AddParameter("EmpName", model.EmpName); dbOperator.AddParameter("Reason", model.Reason); dbOperator.AddParameter("Remark", model.Remark); dbOperator.AddParameter("ZB_User", model.ZB_User); dbOperator.AddParameter("ZB_Time", model.ZB_Time); dbOperator.AddParameter("SH_User", model.SH_User); dbOperator.AddParameter("SH_Time", model.SH_Time); dbOperator.AddParameter("SH_State", model.SH_State); dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime); dbOperator.AddParameter("HaveUpdate", model.HaveUpdate); dbOperator.AddParameter("DataStatus", (int)model.DataStatus); return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0); } }
/// <summary> /// 根据派车单ID获取派遣单 /// </summary> /// <param name="PlanID"></param> /// <returns></returns> public static ParkLpPlan Search_ParkLpPlanByID(string PlanID) { if (string.IsNullOrWhiteSpace(PlanID)) { throw new ArgumentNullException("PlanID"); } IParkLpPlan factory = ParkLpPlanFactory.GetFactory(); ParkLpPlan model = factory.Search_ParkLpPlanByID(PlanID); return(model); }
public static bool Update(ParkLpPlan model) { if (model == null) { throw new ArgumentNullException("model"); } IParkLpPlan factory = ParkLpPlanFactory.GetFactory(); bool result = factory.Update(model); if (result) { OperateLogServices.AddOperateLog <ParkLpPlan>(model, OperateType.Update); } return(result); }
public static bool Add(ParkLpPlan model) { if (model == null) { throw new ArgumentNullException("model"); } model.PlanID = GuidGenerator.GetGuid().ToString(); IParkLpPlan factory = ParkLpPlanFactory.GetFactory(); bool result = factory.Add(model); if (result) { OperateLogServices.AddOperateLog <ParkLpPlan>(model, OperateType.Add); } return(result); }
/// <summary> /// 根据派车单ID获取派遣单 /// </summary> /// <param name="PlanID"></param> /// <returns></returns> public ParkLpPlan Search_ParkLpPlanByID(string PlanID) { ParkLpPlan model = new ParkLpPlan(); StringBuilder strSql = new StringBuilder(); strSql.Append("select * from ParkLpPlan where PlanID=@PlanID and DataStatus!=@DataStatus"); using (DbOperator dbOperator = ConnectionManager.CreateReadConnection()) { dbOperator.ClearParameters(); dbOperator.AddParameter("PlanID", PlanID); dbOperator.AddParameter("DataStatus", (int)DataStatus.Delete); using (DbDataReader reader = dbOperator.ExecuteReader(strSql.ToString())) { if (reader.Read()) { model = DataReaderToModel <ParkLpPlan> .ToModel(reader); } } } return(model); }