protected void btnDel_Click(object sender, System.EventArgs e) { System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>(); if (this.hfldIdsChecked.Value.Contains('[')) { list = JsonHelper.GetListFromJson(this.hfldIdsChecked.Value); } else { list.Add(this.hfldIdsChecked.Value); } try { EquShipTechnicalParasService equShipTechnicalParasService = new EquShipTechnicalParasService(); foreach (string current in list) { equShipTechnicalParasService.DeleteAllEquShipTechInfos(current); EquEquipment byId = this.equipmentSer.GetById(current); this.equipmentSer.Delete(byId); } base.RegisterScript("top.ui.show('删除成功!');"); this.BindGV(); } catch { base.RegisterScript("top.ui.show('删除失败!');"); } }
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(); }
private EquEquipment GetModel(EquEquipment model) { if (model == null) { model = new EquEquipment(); model.Id = this.hdfEquId.Value; } model.EquCode = this.txtEquipmentCode.Text.Trim(); model.EquName = this.txtEquName.Text.Trim(); model.TypeId = this.hfldEquTypeId.Value; model.FactoryNumber = this.txtFactoryNumber.Text.Trim(); model.FactoryDate = this.SetDateTime(this.txtFactoryDate.Text.Trim()); model.PurchaseDate = this.SetDateTime(this.txtPurchaseDate.Text.Trim()); decimal depreciationRate = 0m; if (!string.IsNullOrEmpty(this.txtDepreciationRate.Text.Trim())) { depreciationRate = System.Convert.ToDecimal(this.txtDepreciationRate.Text.Trim().Replace("%", string.Empty)); } model.DepreciationRate = depreciationRate; model.PeriodicVertification = this.txtPeriodicVertification.Text.Trim(); model.DurableYear = this.txtDurableYear.Text.Trim(); decimal purchasePrice = 0m; if (!string.IsNullOrEmpty(this.txtPurchasePrice.Text.Trim())) { purchasePrice = System.Convert.ToDecimal(this.txtPurchasePrice.Text.Trim()); } model.PurchasePrice = purchasePrice; model.SupplierId = this.SetInteger(this.hfldCorpId.Value); model.State = System.Convert.ToInt32(this.ddlState.SelectedValue); model.EquProperty = System.Convert.ToInt32(this.ddlProperty.SelectedValue); model.ReceiptNo = this.txtReceiptNo.Text.Trim(); if (this.typeService.IsShip(this.hfldEquTypeId.Value.Trim())) { model.ShipLength = this.txtShipLength.Text.Trim(); model.ShipWidth = this.txtShipWidth.Text.Trim(); model.ShipCapaticy = this.txtShipCapacity.Text.Trim(); } model.MiddleInspectDate = this.SetDateTime(this.txtMiddleInspectDate.Text.Trim()); model.YearInspectDate = this.SetDateTime(this.txtYearInspectDate.Text.Trim()); model.OtherCredentials = this.txtOtherCredentials.Text.Trim(); model.InputUser = base.UserCode; model.InputDate = System.DateTime.Now; model.Note = this.txtNotes.Text.Trim(); return(model); }
private void BindInfo() { EquEquipment equInfo = this.equipmentSer.GetById(this.equId); this.txtEquName.Text = equInfo.EquName; this.txtEquCode.Text = equInfo.EquCode; BasicCodeList basicCodeList = this.basicCodeSer.GetByType("EquProperty").FirstOrDefault((BasicCodeList pro) => pro.ItemCode == equInfo.EquProperty); if (basicCodeList != null) { this.txtEquProperty.Text = basicCodeList.ItemName; } if (!this.isAdd) { EquShipDayReport byId = this.dayService.GetById(this.dayId); if (byId != null) { PTPrjInfoService pTPrjInfoService = new PTPrjInfoService(); PTPrjInfo byId2 = pTPrjInfoService.GetById(byId.PrjId); if (byId2 != null) { this.txtPrjName.Text = byId2.PrjName; this.hfldPrjId.Value = byId.PrjId; } this.txtReportDate.Text = Common2.GetTime(byId.ReportDate); this.txtConstructionDate.Text = Common2.GetTime(byId.ConstructionDate); this.txtWorkDurationT1.Text = (byId.WorkDurationT1.HasValue ? byId.WorkDurationT1.Value.ToString("0.000") : "0.000"); this.txtDayOilWear.Text = (byId.DayOilWear.HasValue ? byId.DayOilWear.Value.ToString("0.000") : "0.000"); this.txtNotWorkRestDurationT3.Text = (byId.NotWorkRestDurationT3.HasValue ? byId.NotWorkRestDurationT3.Value.ToString("0.000") : "0.000"); this.txtWorkRestDurationT2.Text = (byId.WorkRestDurationT2.HasValue ? byId.WorkRestDurationT2.Value.ToString("0.000") : "0.000"); this.txtNote.Text = byId.Note; this.setOutputValueType(byId); } } else { this.dayId = System.Guid.NewGuid().ToString(); this.txtConstructionDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd"); this.txtReportDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd"); } this.hfldDayId.Value = this.dayId; this.flAnnx.MID = 1901; this.flAnnx.FID = this.hfldDayId.Value; this.flAnnx.Type = 1; }
protected void btnSave_Click(object sender, System.EventArgs e) { try { string equCode = this.txtEquipmentCode.Text.Trim(); System.Collections.Generic.List <EquEquipment> list = ( from es in this.equSer where es.EquCode == equCode select es).ToList <EquEquipment>(); System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); if ("add".Equals(this.action)) { if (list.Count > 0) { base.RegisterScript("top.ui.show('编号已经存在,请重新输入!')"); return; } EquEquipment model = this.GetModel(null); this.equSer.Add(model); this.AddOtherShipsInfo(); stringBuilder.Append("top.ui.show('添加成功');").Append(System.Environment.NewLine); } else { EquEquipment byId = this.equSer.GetById(this.id); if (list.Count > 0 && byId.EquCode != equCode) { base.RegisterScript("top.ui.show('编号已经存在,请重新输入!')"); return; } this.equSer.Update(this.GetModel(byId)); this.AddOtherShipsInfo(); stringBuilder.Append("top.ui.show('编辑成功');").Append(System.Environment.NewLine); } stringBuilder.Append("winclose('EquipmentEdit', 'EquipmentList.aspx', true)"); base.RegisterScript(stringBuilder.ToString()); } 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; }
private void BindEquInfo() { new ResResourceService(); EquEquipmentTypeService equEquipmentTypeService = new EquEquipmentTypeService(); EquEquipment byId = this.equSer.GetById(this.id); this.lblEquCode.Text = byId.EquCode; this.lblEquName.Text = byId.EquName; EquEquipmentType byId2 = equEquipmentTypeService.GetById(byId.TypeId); if (byId2 != null) { this.lblEquTypeName.Text = byId2.Name; } if (byId.SupplierId.HasValue) { XPMBasicContactCorpService xPMBasicContactCorpService = new XPMBasicContactCorpService(); XPMBasicContactCorp byId3 = xPMBasicContactCorpService.GetById(byId.SupplierId.Value); if (byId3 != null) { this.lblCorpName.Text = byId3.CorpName; } } this.lblFactoryNumber.Text = byId.FactoryNumber; this.lblFactoryDate.Text = this.ConvertToString(byId.FactoryDate); this.lblPurchaseDate.Text = this.ConvertToString(byId.PurchaseDate); this.lblDepreciationRate.Text = byId.DepreciationRate.ToString("0.000"); this.lblPeriodicVertification.Text = byId.PeriodicVertification; this.lblDurableYear.Text = byId.DurableYear; this.lblPurchasePrice.Text = byId.PurchasePrice.ToString("0.000"); this.lblState.Text = this.GetStateOrProperty("EquState", byId.State); this.lblEquProperty.Text = this.GetStateOrProperty("EquProperty", byId.EquProperty); this.lblReceiptNo.Text = byId.ReceiptNo; if (equEquipmentTypeService.IsShip(byId.TypeId)) { this.trShip.Style["Display"] = "Block"; this.lblShipLength.Text = byId.ShipLength; this.lblShipWidth.Text = byId.ShipWidth; this.lblShipCapacity.Text = byId.ShipCapaticy; EquShipTechnicalParasService equShipTechnicalParasService = new EquShipTechnicalParasService(); System.Collections.Generic.IList <EquShipTechnicalParas> equShipTechParasByEquId = equShipTechnicalParasService.GetEquShipTechParasByEquId(this.id); if (equShipTechParasByEquId == null || equShipTechParasByEquId.Count <= 0) { goto IL_352; } if (equShipTechParasByEquId.Count == 1) { this.lblOtherShipInfo.Text = equShipTechParasByEquId.First <EquShipTechnicalParas>().OtherShipInfo; } int num = 0; Label label = null; using (System.Collections.Generic.IEnumerator <EquShipTechnicalParas> enumerator = equShipTechParasByEquId.GetEnumerator()) { while (enumerator.MoveNext()) { EquShipTechnicalParas current = enumerator.Current; if (num == 0) { this.lblOtherShipInfo.Text = string.Format("参数{0}: {1}", (num + 1).ToString(), current.OtherShipInfo); label = (this.plOtherShips.FindControl("lblOtherShipInfo") as Label); } else { Literal literal = new Literal(); literal.Text = "<br />"; this.plOtherShips.Controls.Add(literal); Label label2 = new Label(); label2.ID = label.ID + num.ToString(); label2.Text = string.Format("参数{0}: {1}", num + 1, current.OtherShipInfo); this.plOtherShips.Controls.Add(label2); } num++; } goto IL_352; } } this.trShip.Style["Display"] = "None"; IL_352: this.lblMiddleInspectDate.Text = this.ConvertToString(byId.MiddleInspectDate); this.lblYearInspectDate.Text = this.ConvertToString(byId.YearInspectDate); this.lblOtherCredentials.Text = byId.OtherCredentials; this.lblAnnex.Text = FileView.FilesBind(1901, byId.Id); this.lblNotes.Text = byId.Note; }
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; }
private void BindEquInfo() { if (this.action == "edit") { new ResResourceService(); EquEquipment byId = this.equSer.GetById(this.id); this.txtEquipmentCode.Text = byId.EquCode; this.txtEquName.Text = byId.EquName; this.hfldEquTypeId.Value = byId.TypeId; EquEquipmentType byId2 = this.typeService.GetById(byId.TypeId); if (byId2 != null) { this.txtEquTypeName.Value = byId2.Name; } this.ddlProperty.SelectedValue = byId.EquProperty.ToString(); this.txtPurchasePrice.Text = byId.PurchasePrice.ToString("0.000"); this.txtDepreciationRate.Text = string.Format("{0}%", byId.DepreciationRate.ToString("0.000")); this.txtPurchaseDate.Text = (byId.PurchaseDate.HasValue ? byId.PurchaseDate.Value.ToString("yyyy-MM-dd") : string.Empty); this.txtDurableYear.Text = byId.DurableYear; this.txtFactoryNumber.Text = byId.FactoryNumber; this.ddlState.SelectedValue = byId.State.ToString(); if (byId.SupplierId.HasValue) { this.hfldCorpId.Value = byId.SupplierId.Value.ToString(); XPMBasicContactCorpService xPMBasicContactCorpService = new XPMBasicContactCorpService(); XPMBasicContactCorp byId3 = xPMBasicContactCorpService.GetById(byId.SupplierId.Value); if (byId3 != null) { this.txtCorpName.Value = byId3.CorpName; } } this.txtFactoryDate.Text = (byId.FactoryDate.HasValue ? byId.FactoryDate.Value.ToString("yyyy-MM-dd") : string.Empty); this.txtPeriodicVertification.Text = byId.PeriodicVertification; this.txtReceiptNo.Text = byId.ReceiptNo; if (this.typeService.IsShip(byId.TypeId)) { this.txtShipLength.Text = byId.ShipLength; this.txtShipWidth.Text = byId.ShipWidth; this.txtShipCapacity.Text = byId.ShipCapaticy; EquShipTechnicalParasService equShipTechnicalParasService = new EquShipTechnicalParasService(); System.Collections.Generic.IList <EquShipTechnicalParas> equShipTechParasByEquId = equShipTechnicalParasService.GetEquShipTechParasByEquId(this.id); if (equShipTechParasByEquId != null && equShipTechParasByEquId.Count > 0) { foreach (EquShipTechnicalParas current in equShipTechParasByEquId) { if (!string.IsNullOrEmpty(this.hfldOtherShipsInfo.Value.Trim())) { HiddenField expr_2CB = this.hfldOtherShipsInfo; expr_2CB.Value += "|"; } HiddenField expr_2E6 = this.hfldOtherShipsInfo; expr_2E6.Value += current.OtherShipInfo; } } } this.txtMiddleInspectDate.Text = (byId.MiddleInspectDate.HasValue ? byId.MiddleInspectDate.Value.ToString("yyyy-MM-dd") : string.Empty); this.txtYearInspectDate.Text = (byId.YearInspectDate.HasValue ? byId.YearInspectDate.Value.ToString("yyyy-MM-dd") : string.Empty); this.txtOtherCredentials.Text = byId.OtherCredentials; this.txtNotes.Text = byId.Note; this.SetShipInfoVisible(); } else { this.id = System.Guid.NewGuid().ToString(); } this.hdfEquId.Value = this.id; }