Ejemplo n.º 1
0
 /// <summary>
 /// 根据主键删除现场车辆管理
 /// </summary>
 /// <param name="carManagerId"></param>
 public static void DeleteCarManagerById(string carManagerId)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Administrative_CarManager carManager = db.Administrative_CarManager.FirstOrDefault(e => e.CarManagerId == carManagerId);
     if (carManager != null)
     {
         BLL.CodeRecordsService.DeleteCodeRecordsByDataId(carManagerId);
         ////删除审核流程表
         BLL.CommonService.DeleteFlowOperateByID(carManager.CarManagerId);
         db.Administrative_CarManager.DeleteOnSubmit(carManager);
         db.SubmitChanges();
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 修改现场车辆管理
 /// </summary>
 /// <param name="carManager"></param>
 public static void UpdateCarManager(Model.Administrative_CarManager carManager)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Administrative_CarManager newCarManager = db.Administrative_CarManager.FirstOrDefault(e => e.CarManagerId == carManager.CarManagerId);
     if (newCarManager != null)
     {
         //newCarManager.ProjectId = carManager.ProjectId;
         newCarManager.CarManagerCode    = carManager.CarManagerCode;
         newCarManager.CarName           = carManager.CarName;
         newCarManager.CarModel          = carManager.CarModel;
         newCarManager.BuyDate           = carManager.BuyDate;
         newCarManager.LastYearCheckDate = carManager.LastYearCheckDate;
         newCarManager.InsuranceDate     = carManager.InsuranceDate;
         newCarManager.Remark            = carManager.Remark;
         newCarManager.CompileMan        = carManager.CompileMan;
         newCarManager.CompileDate       = carManager.CompileDate;
         newCarManager.States            = carManager.States;
         db.SubmitChanges();
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 添加现场车辆管理
 /// </summary>
 /// <param name="carManager"></param>
 public static void AddCarManager(Model.Administrative_CarManager carManager)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Administrative_CarManager newCarManager = new Model.Administrative_CarManager
     {
         CarManagerId      = carManager.CarManagerId,
         ProjectId         = carManager.ProjectId,
         CarManagerCode    = carManager.CarManagerCode,
         CarName           = carManager.CarName,
         CarModel          = carManager.CarModel,
         BuyDate           = carManager.BuyDate,
         LastYearCheckDate = carManager.LastYearCheckDate,
         InsuranceDate     = carManager.InsuranceDate,
         Remark            = carManager.Remark,
         CompileMan        = carManager.CompileMan,
         CompileDate       = carManager.CompileDate,
         States            = carManager.States
     };
     db.Administrative_CarManager.InsertOnSubmit(newCarManager);
     db.SubmitChanges();
     BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.CarManagerMenuId, carManager.ProjectId, null, carManager.CarManagerId, carManager.CompileDate);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 加载页面
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
         this.ProjectId    = this.CurrUser.LoginProjectId;
         this.CarManagerId = Request.Params["CarManagerId"];
         if (!string.IsNullOrEmpty(this.CarManagerId))
         {
             Model.Administrative_CarManager carManager = BLL.CarManagerService.GetCarManagerById(this.CarManagerId);
             if (carManager != null)
             {
                 this.ProjectId = carManager.ProjectId;
                 this.txtCarManagerCode.Text    = BLL.CodeRecordsService.ReturnCodeByDataId(this.CarManagerId);
                 this.txtCarName.Text           = carManager.CarName;
                 this.txtCarModel.Text          = carManager.CarModel;
                 this.txtBuyDate.Text           = string.Format("{0:yyyy-MM-dd}", carManager.BuyDate);
                 this.txtLastYearCheckDate.Text = string.Format("{0:yyyy-MM-dd}", carManager.LastYearCheckDate);
                 this.txtInsuranceDate.Text     = string.Format("{0:yyyy-MM-dd}", carManager.InsuranceDate);
                 this.txtRemark.Text            = carManager.Remark;
             }
         }
         else
         {
             ////自动生成编码
             this.txtCarManagerCode.Text    = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.CarManagerMenuId, this.ProjectId, this.CurrUser.UnitId);
             this.txtBuyDate.Text           = string.Format("{0:yyyy-MM-dd}", System.DateTime.Now);
             this.txtLastYearCheckDate.Text = string.Format("{0:yyyy-MM-dd}", System.DateTime.Now.AddYears(1));
             this.txtInsuranceDate.Text     = string.Format("{0:yyyy-MM-dd}", System.DateTime.Now.AddYears(1));
         }
         ///初始化审核菜单
         this.ctlAuditFlow.MenuId    = BLL.Const.CarManagerMenuId;
         this.ctlAuditFlow.DataId    = this.CarManagerId;
         this.ctlAuditFlow.ProjectId = this.ProjectId;
         this.ctlAuditFlow.UnitId    = this.CurrUser.UnitId;
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 保存数据
 /// </summary>
 /// <param name="type"></param>
 private void SaveData(string type)
 {
     Model.Administrative_CarManager carManager = new Model.Administrative_CarManager
     {
         ProjectId         = this.ProjectId,
         CarManagerCode    = this.txtCarManagerCode.Text.Trim(),
         CarName           = this.txtCarName.Text.Trim(),
         CarModel          = this.txtCarModel.Text.Trim(),
         BuyDate           = Funs.GetNewDateTime(this.txtBuyDate.Text.Trim()),
         LastYearCheckDate = Funs.GetNewDateTime(this.txtLastYearCheckDate.Text.Trim()),
         InsuranceDate     = Funs.GetNewDateTime(this.txtInsuranceDate.Text.Trim()),
         Remark            = this.txtRemark.Text.Trim(),
         CompileMan        = this.CurrUser.UserId,
         CompileDate       = DateTime.Now,
         States            = BLL.Const.State_0
     };
     if (type == BLL.Const.BtnSubmit)
     {
         carManager.States = this.ctlAuditFlow.NextStep;
     }
     if (!string.IsNullOrEmpty(this.CarManagerId))
     {
         carManager.CarManagerId = this.CarManagerId;
         BLL.CarManagerService.UpdateCarManager(carManager);
         BLL.LogService.AddSys_Log(this.CurrUser, carManager.CarManagerCode, carManager.CarManagerId, BLL.Const.CarManagerMenuId, BLL.Const.BtnModify);
     }
     else
     {
         this.CarManagerId       = SQLHelper.GetNewID(typeof(Model.Administrative_CarManager));
         carManager.CarManagerId = this.CarManagerId;
         BLL.CarManagerService.AddCarManager(carManager);
         BLL.LogService.AddSys_Log(this.CurrUser, carManager.CarManagerCode, carManager.CarManagerId, BLL.Const.CarManagerMenuId, BLL.Const.BtnAdd);
     }
     ////保存流程审核数据
     this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.CarManagerMenuId, this.CarManagerId, (type == BLL.Const.BtnSubmit ? true : false), carManager.CarName, "../Administrative/CarManagerView.aspx?CarManagerId={0}");
 }