protected void setControlsValue() { MaterialWantPlanModel model = this.materialWant.GetModel(this.wantplanCode); this.hfldWantPlanGuid.Value = model.swid; this.txtCode.Text = model.swcode; this.hdnProjectCode.Value = model.procode; this.txtPerson.Text = model.person; this.txtInputDate.Text = model.intime.Replace("0:00:00", "").Trim(); this.txtRemark.Text = model.explain; this.chkContainPending.Checked = model.ContainPending; string equipmentId = model.EquipmentId; if (!string.IsNullOrEmpty(equipmentId)) { this.hfldEquId.Value = equipmentId; EquEquipmentService equEquipmentService = new EquEquipmentService(); EquEquipment byId = equEquipmentService.GetById(equipmentId); if (byId != null) { this.txtEquCode.Value = byId.EquCode; } } DataTable dataTable = this.materialStock.showMaterialListForUpdate(this.wantplanCode); //this.ViewState["ResourcesTable"] = dataTable; DataTable dtCopy = dataTable.Copy(); try { DataColumn dataColumn1 = new DataColumn(); dataColumn1.ColumnName = "ResourceQuantity"; dataColumn1.DataType = System.Type.GetType("System.String"); dtCopy.Columns.Add(dataColumn1); DataColumn dataColumn2 = new DataColumn(); dataColumn2.ColumnName = "numberIng"; dataColumn2.DataType = System.Type.GetType("System.String"); dtCopy.Columns.Add(dataColumn2); } catch { } //DataTable dt = dtNum(); foreach (DataRow drc in dtCopy.Rows) { foreach (DataRow dr in dtNum().Rows) { if (drc["ResourceCode"].ToString().Trim() == dr["scode"].ToString().Trim()) { drc["ResourceQuantity"] = dr["ResourceQuantity"]; drc["numberIng"] = dr["numberIng"]; } } } this.ViewState["ResourcesTable"] = dtCopy; this.gvSmWantPlanStock.DataSource = dtCopy; //this.gvSmWantPlanStock.DataSource = dataTable; this.gvSmWantPlanStock.DataBind(); }
protected void setControlsValue() { MaterialWantPlanModel model = this.materialWant.GetModel(this.wantplanCode); this.hfldWantPlanGuid.Value = model.swid; this.lblCode.Text = model.swcode; if (!string.IsNullOrEmpty(model.procode)) { this.prjId = model.procode; PrjInfoModel modelByPrjGuid = this.ptPrjInfo.GetModelByPrjGuid(model.procode); if (modelByPrjGuid != null) { this.lblPrjName.Text = modelByPrjGuid.PrjName; } else { DataTable tableByPrjGuid = this.ptPrjInfo.GetTableByPrjGuid(model.procode); if (tableByPrjGuid.Rows.Count > 0) { this.lblPrjName.Text = tableByPrjGuid.Rows[0]["prjName"].ToString().Trim(); } } } this.lblPerson.Text = model.person; this.lblBllProducer.Text = model.person; this.lblPrintDate.Text = System.DateTime.Now.ToShortDateString(); this.dtxtApplyDate.Text = model.intime.Replace("0:00:00", "").Trim(); this.txtRemark.Value = model.explain; this.lblRemark.Text = model.explain; string equipmentId = model.EquipmentId; if (!string.IsNullOrEmpty(equipmentId)) { EquEquipmentService equEquipmentService = new EquEquipmentService(); EquEquipment byId = equEquipmentService.GetById(equipmentId); if (byId != null) { this.lblEquCode.Text = byId.EquCode; } } DataTable dataTable = this.materialStock.showMaterialListForUpdate(this.wantplanCode); if (dataTable != null && dataTable.Rows.Count > 0) { this.gvSmWantPlanStock.DataSource = dataTable; this.gvSmWantPlanStock.DataBind(); } this.DataBindDiff(); this.DataBindTaskDiff(); }
protected void btnDel_Click(object sender, System.EventArgs e) { System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>(); EquEquipmentService source = new EquEquipmentService(); foreach (GridViewRow gridViewRow in this.gvwEquipmentType.Rows) { CheckBox checkBox = gridViewRow.FindControl("chkBox") as CheckBox; if (checkBox.Checked) { list.Add(checkBox.ToolTip); } } try { foreach (string equTypeId in list) { System.Collections.Generic.List <EquEquipmentType> list2 = ( from t in this.equTypeSer where t.ParentId == equTypeId select t).ToList <EquEquipmentType>(); if (list2.Count > 0) { base.RegisterScript("top.ui.show('请先删除子项!')"); return; } System.Collections.Generic.List <EquEquipment> list3 = ( from es in source where es.TypeId == equTypeId select es).ToList <EquEquipment>(); if (list3.Count > 0) { base.RegisterScript("top.ui.show('请先删除对应的设备!')"); return; } EquEquipmentType byId = this.equTypeSer.GetById(equTypeId); this.equTypeSer.Delete(byId); } base.RegisterScript("window.location.href='../../Equ/Type/EquipmentTypeList.aspx?id=" + this.trvwEquipmentType.SelectedValue + "'"); } catch { base.RegisterScript("top.ui.show('删除失败!')"); } }
public void InitPage() { if (base.Request.QueryString["t"] != null) { this.btnDel.Enabled = false; this.btnSave.Enabled = false; this.btnSelectByd.Disabled = true; } if (base.Request.QueryString["id"] != null) { this.lblTitle.Text = "编辑出库单"; OutReserveModel model = this.outReserveBll.GetModel(base.Request.QueryString["id"]); this.hdTsid.Value = "1"; this.txtExplain.Text = model.explain; this.txtInTime.Text = model.intime.ToString(); this.txtPeople.Value = model.person; this.txtPPCode.Text = model.orcode; this.txtPickingPeople.Text = model.PickingPeople; this.txtPickingSector.Text = model.PickingSector; this.txtProjectName.Value = this.pTPrjInfoBll.GetModelByPrjGuid(model.procode).PrjName; this.hdGuid.Value = model.orid; this.hdflowstate.Value = model.flowstate.ToString(); this.hfldTrea.Value = model.tcode; this.txtTrea.Text = this.treasury.GetModel(model.tcode).tname; string equipmentId = model.EquipmentId; if (!string.IsNullOrEmpty(equipmentId)) { this.hfldEquId.Value = equipmentId; EquEquipmentService equEquipmentService = new EquEquipmentService(); EquEquipment byId = equEquipmentService.GetById(equipmentId); if (byId != null) { this.txtEquCode.Text = byId.EquCode; } } List <OutStockModel> listArray = this.outStockBll.GetListArray(" where orcode='" + model.orcode + "'"); string text = ""; foreach (OutStockModel current in listArray) { text = text + "'" + current.scode + "',"; } if (text != "") { text = text.Substring(0, text.Length - 1); } this.ViewState["DataTable"] = this.outStockBll.GetTableByOrcode(model.orcode, model.tcode); this.BindGv(); } else { this.lblTitle.Text = "新增出库单"; this.txtProjectName.Value = this.pTPrjInfoBll.GetModelByPrjGuid(this.prjId).PrjName; this.txtPPCode.Text = DateTime.Now.ToString("yyyyMMddHHmmss"); this.txtInTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); this.hdGuid.Value = Guid.NewGuid().ToString(); this.txtPeople.Value = PageHelper.QueryUser(this, base.UserCode); this.ViewState["DataTable"] = this.outStockBll.GetTableByOrcode("''", ""); this.BindGv(); } this.FileLink1.MID = 1804; this.FileLink1.FID = this.hdGuid.Value; this.FileLink1.Type = 1; }
public void InitPage() { OutReserveModel model = null; if (base.Request.QueryString["id"] != null && base.Request.QueryString["ic"] == null) { model = this.outReserveBll.GetModel(base.Request.QueryString["id"]); } else { if (base.Request.QueryString["ic"] != null) { model = this.outReserveBll.GetModelByIc(base.Request.QueryString["ic"]); } } this.lblExplain.Text = model.explain; this.lblInTime.Text = Common2.GetTime(model.intime.ToString()); this.lblPeople.Text = model.person; this.lblPPCode.Text = model.orcode; this.lblPickingPeople.Text = model.PickingPeople; PTdbmService source = new PTdbmService(); PTdbm pTdbm = ( from dbm in source where dbm.V_bmbm == model.PickingSector && dbm.C_sfyx == "y" select dbm).FirstOrDefault <PTdbm>(); if (pTdbm != null) { this.lblPickingSector.Text = pTdbm.V_BMMC; } else { this.lblPickingSector.Text = model.PickingSector; } PrjInfoModel modelByPrjGuid = this.pTPrjInfoBll.GetModelByPrjGuid(model.procode); if (modelByPrjGuid != null) { this.lblProjectName.Text = modelByPrjGuid.PrjName; } else { DataTable tableByPrjGuid = this.pTPrjInfoBll.GetTableByPrjGuid(model.procode); if (tableByPrjGuid.Rows.Count > 0) { this.lblProjectName.Text = tableByPrjGuid.Rows[0]["prjName"].ToString().Trim(); } } this.lblBllProducer.Text = model.person; this.lblPrintDate.Text = DateTime.Now.ToShortDateString(); this.hdnProjectCode.Value = model.procode; this.hdGuid.Value = model.orid; this.hdImg.Value = model.writeName; this.hdflowstate.Value = model.flowstate.ToString(); this.lblTerasuryName.Text = this.treasury.GetModel(model.tcode).tname; string equipmentId = model.EquipmentId; if (!string.IsNullOrEmpty(equipmentId)) { EquEquipmentService equEquipmentService = new EquEquipmentService(); EquEquipment byId = equEquipmentService.GetById(equipmentId); if (byId != null) { this.lblEquCode.Text = byId.EquCode; } } List <OutStockModel> listArray = this.outStockBll.GetListArray(" where orcode='" + model.orcode + "'"); string text = ""; foreach (OutStockModel current in listArray) { text = text + "'" + current.scode + "',"; } if (text != "") { text = text.Substring(0, text.Length - 1); } this.ViewState["DataTable"] = this.outStockBll.GetTableByOrcode(model.orcode, model.tcode); this.BindGv(); this.FileLink1.MID = 1804; this.FileLink1.FID = this.hdGuid.Value; this.FileLink1.Type = 1; }