Пример #1
0
    private void btnDel_Click(object sender, EventArgs e)
    {
        EquipmentMaintainFittingCollection equipmentMaintainFittingCollection = this.dgdFittingsDetail_GetData();

        equipmentMaintainFittingCollection.RemoveAt(int.Parse(this.hdnSelectedIndex.Value));
        this.dgdFittingsDetail_Bind(equipmentMaintainFittingCollection);
    }
Пример #2
0
 private void dgdFittingsDetail_Bind(EquipmentMaintainFittingCollection al)
 {
     this.dgdFittings.DataSource = al;
     this.dgdFittings.DataBind();
     this.Session["RepairRecordList"] = al;
     this.lblState.Text = "共" + al.Count.ToString() + "条记录!";
 }
Пример #3
0
    protected void BtnRepairEdit_Click(object sender, EventArgs e)
    {
        EquipmentMaintainFittingCollection templist = this.dgdFittingsDetail_GetData();
        string a;

        if ((a = this.ViewState["OPTYPE"].ToString()) != null)
        {
            if (!(a == "0"))
            {
                if (!(a == "1"))
                {
                    return;
                }
                if (EquipmentMaintainAction.UpdMaintainInfo(this.GetEquipmentMaintainInfo(), templist, (Guid)this.ViewState["MAINTAINUNIQUECODE"]) == 1)
                {
                    this.js.Text = "alert('数据修改成功');window.returnValue=true;window.close();";
                    return;
                }
                this.js.Text = "alert('数据修改失败');";
            }
            else
            {
                if (EquipmentMaintainAction.AddMaintainInfo(this.GetEquipmentMaintainInfo(), templist) == 1)
                {
                    this.js.Text = "alert('数据增加成功');window.returnValue = true;window.close();";
                    return;
                }
                this.js.Text = "alert('数据添加失败');";
                return;
            }
        }
    }
Пример #4
0
        public static int AddMaintainInfo(EquipmentMaintainInfo eptinfo, EquipmentMaintainFittingCollection templist)
        {
            string str  = "";
            string str2 = str + " begin " + " insert into Ent_Ept_Maintain";
            string str3 = str2 + " values('" + eptinfo.MaintainUniqueCode.ToString() + "','" + eptinfo.EquipmentUniqueCode.ToString() + "',";
            string str4 = str3 + "'" + eptinfo.MaintainType + "'," + eptinfo.MaintainCost.ToString() + ",'" + eptinfo.Fault + "',";
            string str5 = str4 + "'" + eptinfo.MaintainContent + "','" + eptinfo.MaintainceMan + "','" + eptinfo.MaintainDate.ToShortDateString() + "',";

            return(publicDbOpClass.ExecSqlString(((str5 + "'" + eptinfo.RecordDate.ToShortDateString() + "','" + eptinfo.Appraisal + "','" + eptinfo.Appraiser + "',") + "'" + eptinfo.AppraisalDate.ToShortDateString() + "') ") + AddAndDeleteRecordList(templist, eptinfo.MaintainUniqueCode) + " end "));
        }
Пример #5
0
    private void btnAdd_Click(object sender, EventArgs e)
    {
        EquipmentMaintainFittingCollection equipmentMaintainFittingCollection = this.dgdFittingsDetail_GetData();

        equipmentMaintainFittingCollection.Add(new EquipmentMaintainFittingInfo
        {
            MaintainUniqueCode = (Guid)this.ViewState["MAINTAINUNIQUECODE"]
        });
        this.dgdFittingsDetail_Bind(equipmentMaintainFittingCollection);
    }
Пример #6
0
        public static EquipmentMaintainFittingCollection GetMaintainFittingsList(Guid maintainUniqueCode)
        {
            EquipmentMaintainFittingCollection fittings = new EquipmentMaintainFittingCollection();

            using (DataTable table = publicDbOpClass.DataTableQuary("select * from Ent_Ept_MaintainFittings where MaintainUniqueCode = '" + maintainUniqueCode.ToString() + "'"))
            {
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    fittings.Add(GetFittingInfoFrowDataRow(table.Rows[i]));
                }
            }
            return(fittings);
        }
Пример #7
0
    private EquipmentMaintainFittingCollection dgdFittingsDetail_GetData()
    {
        EquipmentMaintainFittingCollection equipmentMaintainFittingCollection = (EquipmentMaintainFittingCollection)this.Session["RepairRecordList"];

        for (int i = this.dgdFittings.Items.Count - 1; i >= 0; i--)
        {
            DataGridItem dataGridItem = this.dgdFittings.Items[i];
            equipmentMaintainFittingCollection[i].FittingsName = ((TextBox)dataGridItem.Cells[0].Controls[1]).Text;
            equipmentMaintainFittingCollection[i].Spec         = ((TextBox)dataGridItem.Cells[1].Controls[1]).Text;
            equipmentMaintainFittingCollection[i].Quality      = Convert.ToInt32(((TextBox)dataGridItem.Cells[2].Controls[1]).Text);
            equipmentMaintainFittingCollection[i].Operation    = ((TextBox)dataGridItem.Cells[3].Controls[1]).Text;
            equipmentMaintainFittingCollection[i].Remark       = ((TextBox)dataGridItem.Cells[4].Controls[1]).Text;
        }
        return(equipmentMaintainFittingCollection);
    }
Пример #8
0
        public static string AddAndDeleteRecordList(EquipmentMaintainFittingCollection templist, Guid maintainUniqueCode)
        {
            string str  = "";
            object obj2 = str;

            str = string.Concat(new object[] { obj2, " delete from Ent_Ept_MaintainFittings where MaintainUniqueCode='", maintainUniqueCode, "' " });
            EquipmentMaintainFittingInfo info = new EquipmentMaintainFittingInfo();

            for (int i = 0; i < templist.Count; i++)
            {
                info = templist[i];
                if (info.FittingsName.Trim() != "")
                {
                    object obj3 = str + " insert into Ent_Ept_MaintainFittings(MaintainUniqueCode,FittingsName,Spec,Quality,Operation,Remark) ";
                    str = string.Concat(new object[] { obj3, "values('", maintainUniqueCode, "','", info.FittingsName, "','", info.Spec, "',", info.Quality.ToString(), ",'", info.Operation, "','", info.Remark, "') " });
                }
            }
            return(str);
        }
Пример #9
0
        public static int UpdMaintainInfo(EquipmentMaintainInfo eptinfo, EquipmentMaintainFittingCollection templist, Guid maintainUniqueCode)
        {
            object obj2 = ((((((((((" begin " + " update Ent_Ept_Maintain ") + " set MaintainType = '" + eptinfo.MaintainType.ToString() + "',") + " MaintainCost = " + eptinfo.MaintainCost.ToString() + ",") + " Fault = '" + eptinfo.Fault.ToString() + "',") + " MaintainContent = '" + eptinfo.MaintainContent + "',") + " MaintainceMan = '" + eptinfo.MaintainceMan + "',") + " MaintainDate = '" + eptinfo.MaintainDate.ToShortDateString() + "',") + " RecordDate = '" + eptinfo.RecordDate.ToShortDateString() + "',") + " Appraisal = '" + eptinfo.Appraisal.ToString() + "',") + " Appraiser = '" + eptinfo.Appraiser.ToString() + "',") + " AppraisalDate = '" + eptinfo.AppraisalDate.ToShortDateString() + "' ";

            return(publicDbOpClass.ExecSqlString(string.Concat(new object[] { obj2, " where MaintainUniqueCode = '", maintainUniqueCode, "'" }) + AddAndDeleteRecordList(templist, maintainUniqueCode) + " end "));
        }