Пример #1
0
 /// <summary>
 /// 根据主键删除机具设备
 /// </summary>
 /// <param name="specialEquipmentId"></param>
 public static void DeleteSpecialEquipmentById(string specialEquipmentId)
 {
     Model.SUBHSSEDB             db = Funs.DB;
     Model.Base_SpecialEquipment specialEquipment = db.Base_SpecialEquipment.FirstOrDefault(e => e.SpecialEquipmentId == specialEquipmentId);
     if (specialEquipment != null)
     {
         db.Base_SpecialEquipment.DeleteOnSubmit(specialEquipment);
         db.SubmitChanges();
     }
 }
Пример #2
0
 /// <summary>
 /// 修改机具设备
 /// </summary>
 /// <param name="specialEquipment"></param>
 public static void UpdateSpecialEquipment(Model.Base_SpecialEquipment specialEquipment)
 {
     Model.SUBHSSEDB             db = Funs.DB;
     Model.Base_SpecialEquipment newSpecialEquipment = db.Base_SpecialEquipment.FirstOrDefault(e => e.SpecialEquipmentId == specialEquipment.SpecialEquipmentId);
     if (newSpecialEquipment != null)
     {
         newSpecialEquipment.SpecialEquipmentCode = specialEquipment.SpecialEquipmentCode;
         newSpecialEquipment.SpecialEquipmentName = specialEquipment.SpecialEquipmentName;
         newSpecialEquipment.Remark               = specialEquipment.Remark;
         newSpecialEquipment.IsSpecial            = specialEquipment.IsSpecial;
         newSpecialEquipment.SpecialEquipmentType = specialEquipment.SpecialEquipmentType;
         db.SubmitChanges();
     }
 }
Пример #3
0
 /// <summary>
 /// 添加机具设备
 /// </summary>
 /// <param name="specialEquipment"></param>
 public static void AddSpecialEquipment(Model.Base_SpecialEquipment specialEquipment)
 {
     Model.SUBHSSEDB             db = Funs.DB;
     Model.Base_SpecialEquipment newSpecialEquipment = new Model.Base_SpecialEquipment
     {
         SpecialEquipmentId   = specialEquipment.SpecialEquipmentId,
         SpecialEquipmentCode = specialEquipment.SpecialEquipmentCode,
         SpecialEquipmentName = specialEquipment.SpecialEquipmentName,
         Remark               = specialEquipment.Remark,
         IsSpecial            = specialEquipment.IsSpecial,
         SpecialEquipmentType = specialEquipment.SpecialEquipmentType,
     };
     db.Base_SpecialEquipment.InsertOnSubmit(newSpecialEquipment);
     db.SubmitChanges();
 }
Пример #4
0
        /// <summary>
        /// 保存按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strRowID = hfFormID.Text;

            Model.Base_SpecialEquipment specialEquipment = new Model.Base_SpecialEquipment
            {
                SpecialEquipmentCode = this.txtSpecialEquipmentCode.Text.Trim(),
                SpecialEquipmentName = this.txtSpecialEquipmentName.Text.Trim()
            };
            if (this.ckbIsSpecial.Checked == true)
            {
                specialEquipment.IsSpecial = true;
            }
            else
            {
                specialEquipment.IsSpecial = false;
            }
            if (this.drpType.SelectedValue != Const._Null)
            {
                specialEquipment.SpecialEquipmentType = this.drpType.SelectedValue;
            }
            else
            {
                specialEquipment.SpecialEquipmentType = null;
            }
            specialEquipment.Remark = txtRemark.Text.Trim();
            if (string.IsNullOrEmpty(strRowID))
            {
                specialEquipment.SpecialEquipmentId = SQLHelper.GetNewID(typeof(Model.Base_SpecialEquipment));
                BLL.SpecialEquipmentService.AddSpecialEquipment(specialEquipment);
                BLL.LogService.AddSys_Log(this.CurrUser, specialEquipment.SpecialEquipmentCode, specialEquipment.SpecialEquipmentId, BLL.Const.SpecialEquipmentMenuId, BLL.Const.BtnAdd);
            }
            else
            {
                specialEquipment.SpecialEquipmentId = strRowID;
                BLL.SpecialEquipmentService.UpdateSpecialEquipment(specialEquipment);
                BLL.LogService.AddSys_Log(this.CurrUser, specialEquipment.SpecialEquipmentCode, specialEquipment.SpecialEquipmentId, BLL.Const.SpecialEquipmentMenuId, BLL.Const.BtnModify);
            }
            this.SimpleForm1.Reset();
            // 重新绑定表格,并点击当前编辑或者新增的行
            BindGrid();
            PageContext.RegisterStartupScript(String.Format("F('{0}').selectRow('{1}');", Grid1.ClientID, specialEquipment.SpecialEquipmentId));
        }
Пример #5
0
 private void getQRUrl()
 {
     if (!string.IsNullOrEmpty(Request.Params["PersonId"]))
     {
         ////人员
         var person = BLL.PersonService.GetPersonById(Request.Params["PersonId"]);
         if (person != null && !string.IsNullOrEmpty(person.QRCodeAttachUrl))
         {
             this.imgPhoto.Src   = "../" + person.QRCodeAttachUrl;
             this.lbWedCode.Text = "人员卡号:" + person.CardNo;
             this.lbWedName.Text = "人员姓名:" + person.PersonName;
             Model.Base_Unit unit     = BLL.UnitService.GetUnitByUnitId(person.UnitId);
             string          unitName = string.Empty;
             if (unit != null)
             {
                 unitName = unit.UnitName;
             }
             this.lbUnitName.Text = "人员单位:" + unitName;
         }
     }
     else if (!string.IsNullOrEmpty(Request.Params["EquipmentQualityId"]))
     {
         ////设备
         var equipmentQuality = BLL.EquipmentQualityService.GetEquipmentQualityById(Request.Params["EquipmentQualityId"]);
         if (equipmentQuality != null && !string.IsNullOrEmpty(equipmentQuality.QRCodeAttachUrl))
         {
             this.imgPhoto.Src   = "../" + equipmentQuality.QRCodeAttachUrl;
             this.lbWedCode.Text = "出厂编号:" + equipmentQuality.FactoryCode;
             this.lbWedName.Text = "设备名称:" + equipmentQuality.EquipmentQualityName;
             Model.Base_Unit unit     = BLL.UnitService.GetUnitByUnitId(equipmentQuality.UnitId);
             string          unitName = string.Empty;
             if (unit != null)
             {
                 unitName = unit.UnitName;
             }
             this.lbUnitName.Text = "所属单位:" + unitName;
         }
     }
     else if (!string.IsNullOrEmpty(Request.Params["GeneralEquipmentQualityId"]))
     {
         ///一般设备
         var generalEquipmentQuality = BLL.GeneralEquipmentQualityService.GetGeneralEquipmentQualityById(Request.Params["GeneralEquipmentQualityId"]);
         if (generalEquipmentQuality != null && !string.IsNullOrEmpty(generalEquipmentQuality.QRCodeAttachUrl))
         {
             this.imgPhoto.Src   = "../" + generalEquipmentQuality.QRCodeAttachUrl;
             this.lbWedCode.Text = "编号:" + BLL.CodeRecordsService.ReturnCodeByDataId(generalEquipmentQuality.GeneralEquipmentQualityId);
             string equipmentTypeName = string.Empty;
             Model.Base_SpecialEquipment equipmentType = BLL.SpecialEquipmentService.GetSpecialEquipmentById(generalEquipmentQuality.SpecialEquipmentId);
             if (equipmentType != null)
             {
                 equipmentTypeName = equipmentType.SpecialEquipmentName;
             }
             this.lbWedName.Text = "设备名称:" + equipmentTypeName;
             Model.Base_Unit unit     = BLL.UnitService.GetUnitByUnitId(generalEquipmentQuality.UnitId);
             string          unitName = string.Empty;
             if (unit != null)
             {
                 unitName = unit.UnitName;
             }
             this.lbUnitName.Text = "所属单位:" + unitName;
         }
     }
     else if (!string.IsNullOrEmpty(Request.Params["ConstructSolutionId"]))
     {
         ///施工方案
         var constructSolution = BLL.ConstructSolutionService.GetConstructSolutionById(Request.Params["ConstructSolutionId"]);
         if (constructSolution != null && !string.IsNullOrEmpty(constructSolution.QRCodeAttachUrl))
         {
             this.imgPhoto.Src = "../" + constructSolution.QRCodeAttachUrl;
             string code = string.Empty;
             if (!string.IsNullOrEmpty(constructSolution.ConstructSolutionCode))
             {
                 code = constructSolution.ConstructSolutionCode;
             }
             else
             {
                 code = BLL.CodeRecordsService.ReturnCodeByDataId(constructSolution.ConstructSolutionId);
             }
             this.lbWedCode.Text = "编号:" + code;
             this.lbWedName.Text = "方案名称:" + constructSolution.ConstructSolutionName;
             Model.Base_Unit unit     = BLL.UnitService.GetUnitByUnitId(constructSolution.UnitId);
             string          unitName = string.Empty;
             if (unit != null)
             {
                 unitName = unit.UnitName;
             }
             this.lbUnitName.Text = "所属单位:" + unitName;
         }
     }
     else if (!string.IsNullOrEmpty(Request.Params["TrainingPlanId"]))
     {
         ///培训计划
         var trainingPlan = BLL.TrainingPlanService.GetPlanById(Request.Params["TrainingPlanId"]);
         if (trainingPlan != null && !string.IsNullOrEmpty(trainingPlan.QRCodeUrl))
         {
             this.imgPhoto.Src = "../" + trainingPlan.QRCodeUrl;
             string code = string.Empty;
             if (!string.IsNullOrEmpty(trainingPlan.PlanCode))
             {
                 code = trainingPlan.PlanCode;
             }
             else
             {
                 code = BLL.CodeRecordsService.ReturnCodeByDataId(trainingPlan.PlanId);
             }
             this.lbWedCode.Text  = "编号:" + code;
             this.lbWedName.Text  = "名称:" + trainingPlan.PlanName;
             this.lbUnitName.Text = "培训时间:" + string.Format("{0:yyyy-MM-dd}", trainingPlan.TrainStartDate) + ";培训地点:" + trainingPlan.TeachAddress;
         }
     }
     else if (!string.IsNullOrEmpty(Request.Params["TestPlanId"]))
     {
         ///培训计划
         var testPlan = BLL.TestPlanService.GetTestPlanById(Request.Params["TestPlanId"]);
         if (testPlan != null && !string.IsNullOrEmpty(testPlan.QRCodeUrl))
         {
             this.imgPhoto.Src = "../" + testPlan.QRCodeUrl;
             string code = string.Empty;
             if (!string.IsNullOrEmpty(testPlan.PlanCode))
             {
                 code = testPlan.PlanCode;
             }
             else
             {
                 code = BLL.CodeRecordsService.ReturnCodeByDataId(testPlan.PlanId);
             }
             this.lbWedCode.Text  = "编号:" + code;
             this.lbWedName.Text  = "名称:" + testPlan.PlanName;
             this.lbUnitName.Text = "考试扫码时间:" + string.Format("{0:yyyy-MM-dd}", testPlan.TestStartTime) + ";考试地点:" + testPlan.TestPalce;
         }
     }
     else if (!string.IsNullOrEmpty(Request.Params["ServerTestPlanId"]))
     {
         ///知识竞赛
         var testPlan = BLL.ServerTestPlanService.GetTestPlanById(Request.Params["ServerTestPlanId"]);
         if (testPlan != null && !string.IsNullOrEmpty(testPlan.QRCodeUrl))
         {
             this.imgPhoto.Src    = "../" + testPlan.QRCodeUrl;
             this.lbWedCode.Text  = "编号:" + testPlan.PlanCode;
             this.lbWedName.Text  = "名称:" + testPlan.PlanName;
             this.lbUnitName.Text = "扫码考试时间:" + string.Format("{0:yyyy-MM-dd HH:mm:ss}", testPlan.TestStartTime) + ";至:" + string.Format("{0:yyyy-MM-dd HH:mm:ss}", testPlan.TestEndTime);
         }
     }
 }