public System.Data.DataSet GetList(MDL.T_Units obj) { String stmtId = "T_Units.GetList"; System.Data.DataSet result = DAL.MyBatis.QueryForDataSet(stmtId, obj); return(result); }
private void Init() { ERM.BLL.T_Dict_BLL dicData = new ERM.BLL.T_Dict_BLL(); IList <MDL.T_Dict> ds = dicData.FindByKeyWord("unittype"); List <MDL.T_Dict> dictList = new List <MDL.T_Dict>(); string[] unitList = new string[] { "unit1", "unit6", "unit4", "unit3", "unit2", "unit15" }; for (int i = 0; i < ds.Count; i++) { for (int j = 0; j < unitList.Length; j++) { if (ds[i].ValueName == unitList[j]) { dictList.Add(ds[i]); } } } cboUnittype.DisplayMember = "displayname"; cboUnittype.ValueMember = "valuename"; cboUnittype.DataSource = dictList; if (this.unitType != null) { cboUnittype.SelectedValue = unitType; } if (unitID != "") { BLL.T_Units_BLL unitBLL = new ERM.BLL.T_Units_BLL(); MDL.T_Units unitMDL = unitBLL.Find(unitID); txtUnitid.Text = unitMDL.UnitID; if (string.Compare(cboUnittype.SelectedValue.ToString(), "unit12", true) == 0 || string.Compare(cboUnittype.SelectedValue.ToString(), "unit13", true) == 0) { txtOther.Text = unitMDL.fzr; } else { txtDwmc.Text = unitMDL.dwmc; txtFzr.Text = unitMDL.fzr; txtFzrzs.Text = unitMDL.fzrzs; txtXmjl.Text = unitMDL.xmjl; txtZzdj.Text = unitMDL.zzdj; txtZzzh.Text = unitMDL.zzzh; txtAddr.Text = unitMDL.addr; txtTel.Text = unitMDL.tel; txtFax.Text = unitMDL.fax; txtRemark.Text = unitMDL.remark; txtXmzyzljcy.Text = unitMDL.xmzyzljcy; txtZlfzr.Text = unitMDL.zlfzr; txtJccsfzr.Text = unitMDL.jccsfzr; txtSyxfzr.Text = unitMDL.syxfzr; txtTsfzr.Text = unitMDL.tsfzr; txtOther.Text = unitMDL.xcjl; } } }
private void btnEdit_Click(object sender, EventArgs e) { if (Dgv1.Rows.Count == 0) { TXMessageBoxExtensions.Info("没有可编辑的数据!"); return; } if (Dgv1.CurrentRow.Index < 0) { TXMessageBoxExtensions.Info("请选择一行数据进行编辑!"); return; } string unitid = Dgv1.Rows[Dgv1.CurrentRow.Index].Cells[0].Value.ToString(); //当前unitid string unitType = Dgv1.Rows[Dgv1.CurrentRow.Index].Cells[1].Value.ToString(); //当前单位类型 //BUG修复20170420,如果不选择左侧的单位类型会导致编辑传过去的单位类型为空,改为如果为空则传当前选中行的单位类型 frmUnit frm = new frmUnit(txtUnittype.Text == "" ? unitType : txtUnittype.Text, txtProjectNo.Text, unitid); DialogResult ret = frm.ShowDialog(); //open if (ret == DialogResult.OK) { MDL.T_Units unitMDL = (new ERM.BLL.T_Units_BLL()).Find(unitid); string unittype = frm.cboUnittype.SelectedValue.ToString(); unitMDL.unittype = unittype; if (string.Compare(unittype, "unit12", true) == 0 || string.Compare(unittype, "unit13", true) == 0) { unitMDL.dwmc = frm.label5.Text; unitMDL.fzr = MyCommon.ToSqlString(frm.txtOther.Text.Trim()); unitMDL.fzrzs = string.Empty; unitMDL.xmjl = string.Empty; unitMDL.zzdj = string.Empty; unitMDL.zzzh = string.Empty; unitMDL.addr = string.Empty; unitMDL.tel = string.Empty; unitMDL.fax = string.Empty; unitMDL.remark = string.Empty; } else { unitMDL.dwmc = MyCommon.ToSqlString(frm.txtDwmc.Text.Trim()); unitMDL.fzr = MyCommon.ToSqlString(frm.txtFzr.Text.Trim()); unitMDL.fzrzs = MyCommon.ToSqlString(frm.txtFzrzs.Text.Trim()); unitMDL.xmjl = MyCommon.ToSqlString(frm.txtXmjl.Text.Trim()); unitMDL.zzdj = MyCommon.ToSqlString(frm.txtZzdj.Text.Trim()); unitMDL.zzzh = MyCommon.ToSqlString(frm.txtZzzh.Text.Trim()); unitMDL.addr = MyCommon.ToSqlString(frm.txtAddr.Text.Trim()); unitMDL.tel = MyCommon.ToSqlString(frm.txtTel.Text.Trim()); unitMDL.fax = MyCommon.ToSqlString(frm.txtFax.Text.Trim()); unitMDL.remark = MyCommon.ToSqlString(frm.txtRemark.Text.Trim()); } (new ERM.BLL.T_Units_BLL()).Update(unitMDL); this.LoadDataFromView(txtUnittype.Text); } }
private void loadItemInfo() { if (string.IsNullOrEmpty(itemMDL.ConStructionProjectName)) { itemMDL.ConStructionProjectName = txtProjectName.Text; } if (string.IsNullOrEmpty(itemMDL.ConstructionProjectAdd)) { itemMDL.ConstructionProjectAdd = txtAddress.Text; } if (string.IsNullOrEmpty(itemMDL.Respective)) { itemMDL.Respective = cboDistrict.Text; } if (txtConStructionProjectName.Text.Trim() == "") { txtConStructionProjectName.Text = itemMDL.ConStructionProjectName; } if (txtRespective.Text.Trim() == "") { txtRespective.Text = itemMDL.Respective; } if (txtConstructionProjectAdd.Text.Trim() == "") { txtConstructionProjectAdd.Text = itemMDL.ConstructionProjectAdd; } if (txtProjectType.Text.Trim() == "") { txtProjectType.Text = itemMDL.ProjectType; } if (txtUseSoiAreaSum.Text.Trim() == "") { txtUseSoiAreaSum.Text = itemMDL.UseSoiAreaSum; } if (txtConstructionAreaSum.Text.Trim() == "") { txtConstructionAreaSum.Text = itemMDL.ConstructionAreaSum; } if (txtProjectCost.Text.Trim() == "") { txtProjectCost.Text = itemMDL.ProjectCost; } if (txtProjectSettlement.Text.Trim() == "") { txtProjectSettlement.Text = itemMDL.ProjectSettlement; } if (txtCreateUnit.Text.Trim() == "") { if (string.IsNullOrWhiteSpace(itemMDL.CreateUnit)) { MDL.T_Units units_mdl = GetJSDW(); if (!string.IsNullOrWhiteSpace(units_mdl.dwmc)) { txtCreateUnit.Text = units_mdl.dwmc; } } else { txtCreateUnit.Text = itemMDL.CreateUnit; } } if (txtItemFzr.Text.Trim() == "") { if (string.IsNullOrWhiteSpace(itemMDL.ItemFzr)) { MDL.T_Units units_mdl = GetJSDW(); if (!string.IsNullOrWhiteSpace(units_mdl.fzr)) { txtItemFzr.Text = units_mdl.fzr; } } else { txtItemFzr.Text = itemMDL.ItemFzr; } } if (txtAllCost.Text.Trim() == "") { txtAllCost.Text = itemMDL.AllCost; } if (txtVolumeFar.Text.Trim() == "") { txtVolumeFar.Text = itemMDL.VolumeFar; } if (txtVolumeFar.Text == "0") { txtVolumeFar.Text = ""; } if (txtGreenFar.Text.Trim() == "") { txtGreenFar.Text = itemMDL.GreenFar; } if (txtGreenFar.Text == "0") { txtGreenFar.Text = ""; } if (txtBuildingDensity.Text.Trim() == "") { txtBuildingDensity.Text = itemMDL.BuildingDensity; } if (txtBuildingDensity.Text == "0") { txtBuildingDensity.Text = ""; } if (txtds.Text == "") { txtds.Text = itemMDL.ds; } if (this.txtzcd.Text == "") { txtzcd.Text = itemMDL.zcd; } if (this.txtTlsyCode.Text == "") { txtTlsyCode.Text = itemMDL.TlsyCode; } if (this.txtXmCode.Text == "") { txtXmCode.Text = itemMDL.XmCode; } if (this.txtYdghxkCode.Text == "") { txtYdghxkCode.Text = itemMDL.YdghxkCode; } if (this.txtTlcrnx.Text == "") { txtTlcrnx.Text = itemMDL.Tlcrnx; } if (this.txtPZDW.Text.Trim() == "") { if (string.IsNullOrWhiteSpace(itemMDL.pzdw)) { MDL.T_Units units_mdl = GetJSDW(); if (!string.IsNullOrWhiteSpace(units_mdl.dwmc)) { txtPZDW.Text = units_mdl.dwmc; } } else { txtPZDW.Text = itemMDL.pzdw; } } if (this.txtpzh.Text == "") { txtpzh.Text = itemMDL.pzh; } }