Ejemplo n.º 1
0
    private void RestoreCheckInfo(int ID)
    {
        EquipmentCheckInfo equipmentCheckInfo = new EquipmentCheckInfo();

        equipmentCheckInfo    = EquipmentCheckAction.GetSingleEquipmentCheckInfo(ID);
        this.txtCode.Text     = equipmentCheckInfo.CheckBillCode;
        this.txtTime.Text     = equipmentCheckInfo.CheckDate.ToString("yyyy-MM-dd");
        this.txtDept.Text     = equipmentCheckInfo.CheckDept;
        this.txtPerson.Text   = equipmentCheckInfo.CheckPerson;
        this.txtRemark.Text   = equipmentCheckInfo.Remark;
        this.txtDescript.Text = equipmentCheckInfo.ResultDescript;
        if (equipmentCheckInfo.InOrOut == 0)
        {
            this.RbtTypeIn.Checked = true;
        }
        else
        {
            this.RbtTypeOut.Checked = true;
        }
        if (equipmentCheckInfo.Result == 1)
        {
            this.RbtResultOk.Checked = true;
        }
        else
        {
            this.RbtResultNo.Checked = true;
        }
        this.ViewState["EQUIPMENTUNIQUECODE"] = equipmentCheckInfo.EquipmentUniqueCode;
    }
Ejemplo n.º 2
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     if ((int)this.ViewState["CHECKID"] == 0)
     {
         if (EquipmentCheckAction.AddEquipmentCheck(this.GatherEquipmentCheckInfo()) != 1)
         {
             this.js.Text = "alert('增加失败!');";
             return;
         }
         EquipmentCheckInfo equipmentCheckInfo  = this.GatherEquipmentCheckInfo();
         EquipmentInfo      singleEquipmentInfo = EquipmentAction.GetSingleEquipmentInfo(equipmentCheckInfo.EquipmentUniqueCode);
         string             mes = string.Concat(new string[]
         {
             "设备检定通知:编号为",
             singleEquipmentInfo.EquipmentManCode,
             "的",
             singleEquipmentInfo.EquipmentName,
             ",本次检定日期于一个月后到期。"
         });
         DateTime time = equipmentCheckInfo.CheckDate.AddMonths(singleEquipmentInfo.CheckCycle).AddMonths(-1);
         this.getOrganiger(equipmentCheckInfo.EquipmentUniqueCode.ToString(), mes, base.UserCode.ToString(), time);
         this.js.Text = "alert('增加成功!');window.returnValue=true;window.close();";
         return;
     }
     else
     {
         if (EquipmentCheckAction.EditEquipmentCheck(this.GatherEquipmentCheckInfo()) != 1)
         {
             this.js.Text = "alert('更新失败!');";
             return;
         }
         this.js.Text = "alert('更新成功!');window.returnValue=true;window.close();";
         return;
     }
 }
Ejemplo n.º 3
0
        public static int EditEquipmentCheck(EquipmentCheckInfo ec)
        {
            object obj2 = (" BEGIN " + " UPDATE Ent_Ept_Checkinfo ") + " SET CheckDept = '" + ec.CheckDept + "',";
            object obj3 = string.Concat(new object[] { obj2, " InOrOut = '", ec.InOrOut, "',CheckBillCode = '", ec.CheckBillCode, "'," });
            string str2 = string.Concat(new object[] { obj3, " Result = '", ec.Result, "',CheckDate = '", ec.CheckDate, "'," });
            object obj4 = (str2 + " CheckPerson = '" + ec.CheckPerson + "',ResultDescript = '" + ec.ResultDescript + "',") + " Remark = '" + ec.Remark + "' ";

            return(publicDbOpClass.ExecSqlString(((((string.Concat(new object[] { obj4, " WHERE NoteSequenceID = '", ec.NoteSequenceID, "' " }) + " update Ent_Ept_CheckInfo set IsLast = 0 where (EquipmentUniqueCode = '" + ec.EquipmentUniqueCode.ToString() + "') ") + " UPDATE Ent_Ept_Checkinfo set IsLast = 1 ") + " where (NoteSequenceId = (select max(NoteSequenceId) from Ent_Ept_CheckInfo where (EquipmentUniqueCode = '" + ec.EquipmentUniqueCode.ToString() + "')and(CheckDate = ") + " (select max(CheckDate) from Ent_Ept_CheckInfo where EquipmentUniqueCode = '" + ec.EquipmentUniqueCode.ToString() + "'))))  ") + " END"));
        }
Ejemplo n.º 4
0
        public static int AddEquipmentCheck(EquipmentCheckInfo ec)
        {
            string str = "";

            str = " BEGIN ";
            object obj2 = str + " INSERT INTO Ent_Ept_Checkinfo (EquipmentUniqueCode,InOrOut,CheckBillCode,Result,CheckDate, " + " CheckDept,CheckPerson,ResultDescript,Remark,IsLast) ";
            object obj3 = string.Concat(new object[] { obj2, " VALUES ('", ec.EquipmentUniqueCode.ToString(), "','", ec.InOrOut, "','", ec.CheckBillCode, "','", ec.Result, "', " });

            return(publicDbOpClass.ExecSqlString(((((string.Concat(new object[] { obj3, " '", ec.CheckDate, "','", ec.CheckDept, "','", ec.CheckPerson, "','", ec.ResultDescript, "','", ec.Remark, "','", ec.IsLast, "') " }) + " update Ent_Ept_CheckInfo set IsLast = 0 where (EquipmentUniqueCode = '" + ec.EquipmentUniqueCode.ToString() + "') ") + " UPDATE Ent_Ept_Checkinfo set IsLast = 1 ") + " where (NoteSequenceId = (select max(NoteSequenceId) from Ent_Ept_CheckInfo where (EquipmentUniqueCode = '" + ec.EquipmentUniqueCode.ToString() + "')and(CheckDate = ") + " (select max(CheckDate) from Ent_Ept_CheckInfo where EquipmentUniqueCode = '" + ec.EquipmentUniqueCode.ToString() + "'))))  ") + " END "));
        }
Ejemplo n.º 5
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        EquipmentCheckInfo equipmentCheckInfo = new EquipmentCheckInfo();

        equipmentCheckInfo.NoteSequenceID = Convert.ToInt32(this.hdnChickId.Value);
        if (EquipmentCheckAction.DelEqiupmentCheckInfo(Convert.ToInt32(this.hdnChickId.Value)) != 1)
        {
            this.js.Text = "alert('删除数据出错!');";
        }
        this.BindDataGrid();
    }
Ejemplo n.º 6
0
        public static int DelEqiupmentCheckInfo(int noteSequenceID)
        {
            EquipmentCheckInfo singleEquipmentCheckInfo = new EquipmentCheckInfo();

            singleEquipmentCheckInfo = GetSingleEquipmentCheckInfo(noteSequenceID);
            string str = "";

            str = " begin ";
            str = str + " delete from Ent_Ept_Checkinfo where NoteSequenceID = " + noteSequenceID;
            if (singleEquipmentCheckInfo.IsLast == 1)
            {
                str = ((str + " UPDATE Ent_Ept_Checkinfo set IsLast = 1 ") + " where (NoteSequenceId = (select max(NoteSequenceId) from Ent_Ept_CheckInfo where (EquipmentUniqueCode = '" + singleEquipmentCheckInfo.EquipmentUniqueCode.ToString() + "')and(CheckDate = ") + " (select max(CheckDate) from Ent_Ept_CheckInfo where EquipmentUniqueCode = '" + singleEquipmentCheckInfo.EquipmentUniqueCode.ToString() + "'))))  ";
            }
            return(publicDbOpClass.ExecSqlString(str + " end "));
        }