Esempio n. 1
0
 protected void btnDelete_ServerClick(object sender, EventArgs e)
 {
     string type = this.cmbRepairInfoType.InnerDropDownList.SelectedValue.Trim();
     string code = this.DelCode.Value.Trim();
     try
     {
         RepairInfoMaintainDef def = new RepairInfoMaintainDef();
         def.type = type;
         def.code = code;
         irpairInfo.RemoveRepairInfoMaintainItem(def);
     }
     catch (FisException fex)
     {
         showErrorMessage(fex.mErrmsg);
         return;
     }
     catch (Exception ex)
     {
         showErrorMessage(ex.Message);
         return;
     }
     showList();
     this.updatePanel2.Update();
     ScriptManager.RegisterStartupScript(this.updatePanel2, typeof(System.Object), "delete", "DeleteComplete();HideWait();", true);
 }
Esempio n. 2
0
 protected void btnSave_ServerClick(object sender, EventArgs e)
 {
     int itemId = 0;
     try
     {
         string type = this.cmbRepairInfoType.InnerDropDownList.SelectedValue.Trim();
         string code = this.ttCode.Text.Trim();
         string desc = this.ttDescription.Text.Trim();
         string engDes = this.ttEngDesc.Text.Trim();
         RepairInfoMaintainDef def = new RepairInfoMaintainDef();
         def.type = type;
         def.code = code;
         def.customerID = CUSTOMERID;
         def.description = desc;
         def.engDescr = engDes;
         def.editor = this.HiddenUserName.Value;
         def.cdt = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
         def.udt = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
         string id = this.OldID.Value;
         if(!String.IsNullOrEmpty(id))
         {
             def.id = Convert.ToInt32(id);
         }
         itemId=irpairInfo.AddOrUpdateRepairInfoMaintain(def);
         //itemId = def.id.ToString();
     }
     catch (FisException fe)
     {
         showErrorMessage(fe.mErrmsg);
         return;
     }
     catch (Exception ee)
     {
         showErrorMessage(ee.Message);
         return;
     }
     showList();
     this.updatePanel2.Update();
     ScriptManager.RegisterStartupScript(this.updatePanel2, typeof(System.Object), "Update", "AddUpdateComplete('" + itemId + "');HideWait();", true);
 }
 public IList<IMES.DataModel.RepairInfoMaintainDef> GetRepairInfoByCondition(string type)
 {
     IList<IMES.DataModel.DefectInfoDef> dataList = new List<IMES.DataModel.DefectInfoDef>();
     IList<IMES.DataModel.RepairInfoMaintainDef> poList = new List<IMES.DataModel.RepairInfoMaintainDef>();
     try 
     {
         if(!String.IsNullOrEmpty(type))
         {
             dataList = itemRepository.GetRepairInfoByCondition(type);
             foreach (DefectInfoDef def in dataList)
             {
                 RepairInfoMaintainDef mdef = new RepairInfoMaintainDef();
                 mdef.id = def.id;
                 mdef.type = def.type;
                 mdef.customerID = def.customerID;
                 mdef.description = def.description;
                 mdef.engDescr = def.EngDescr;
                 mdef.code = def.code;
                 mdef.editor = def.Editor;
                 mdef.cdt = def.cdt.ToString("yyyy-MM-dd hh:mm:ss");
                 mdef.udt = def.udt.ToString("yyyy-MM-dd hh:mm:ss");
                 poList.Add(mdef);
             }
         }
         
     }
     catch(Exception)
     {
         throw;
     }
     return poList;
 }