/// <summary> /// 构造 /// </summary> public frmAidEditItem_OutPatientDefault(ref clsParmItem_VO vo, DataTable dt) { InitializeComponent(); Item_VO = vo; dtDuty = dt; }
/// <summary> /// 编辑 /// </summary> /// <param name="row"></param> public void m_mthModify(int row) { clsParmItem_VO Item_VO = new clsParmItem_VO(); Item_VO.ItemName = this.m_objViewer.dtgItem.Rows[row].Cells["xmmc"].Value.ToString(); Item_VO.ItemAmout = clsPublic.ConvertObjToDecimal(this.m_objViewer.dtgItem.Rows[row].Cells["sl"].Value); Item_VO.RegFlag = this.m_objViewer.dtgItem.Rows[row].Cells["ghzt"].Value.ToString(); Item_VO.RecFlag = this.m_objViewer.dtgItem.Rows[row].Cells["cflx"].Value.ToString(); Item_VO.DutyName = this.m_objViewer.dtgItem.Rows[row].Cells["yszc"].Value.ToString(); string TimeScope = this.m_objViewer.dtgItem.Rows[row].Cells["sjfw"].Value.ToString(); Item_VO.BeginTime = TimeScope.Substring(0, 5); Item_VO.EndTime = TimeScope.Substring(6, 5); Item_VO.DeptID = this.m_objViewer.dtgItem.Rows[row].Cells["ksid"].Value.ToString(); Item_VO.DeptName = this.m_objViewer.dtgItem.Rows[row].Cells["ks"].Value.ToString(); frmAidEditItem_OutPatientDefault fEdit = new frmAidEditItem_OutPatientDefault(ref Item_VO, dtDuty); fEdit.dtbDeptsSource = dtbDepts; if (fEdit.ShowDialog() == DialogResult.OK) { decimal d = Item_VO.ItemAmout; this.m_objViewer.dtgItem.Rows[row].Cells["sl"].Value = d.ToString(); d = d * clsPublic.ConvertObjToDecimal(this.m_objViewer.dtgItem.Rows[row].Cells["dj"].Value); this.m_objViewer.dtgItem.Rows[row].Cells["hj"].Value = d.ToString("0.00"); this.m_objViewer.dtgItem.Rows[row].Cells["ghzt"].Value = Item_VO.RegFlag; this.m_objViewer.dtgItem.Rows[row].Cells["cflx"].Value = Item_VO.RecFlag; this.m_objViewer.dtgItem.Rows[row].Cells["yszc"].Value = Item_VO.DutyName; this.m_objViewer.dtgItem.Rows[row].Cells["sjfw"].Value = Item_VO.BeginTime + "~" + Item_VO.EndTime; this.m_objViewer.dtgItem.Rows[row].Cells["ks"].Value = Item_VO.DeptName; this.m_objViewer.dtgItem.Rows[row].Cells["ksid"].Value = Item_VO.DeptID; } }
private void dtgItem_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int row = e.RowIndex; if (row >= 0 && this.btnSave.Enabled) { clsParmItem_VO Item_VO = new clsParmItem_VO(); Item_VO.ItemCode = this.dtgItem.Rows[row].Cells["itemcode"].Value.ToString(); Item_VO.ItemName = this.dtgItem.Rows[row].Cells["itemname"].Value.ToString(); Item_VO.ItemAmout = clsPublic.ConvertObjToDecimal(this.dtgItem.Rows[row].Cells["amount"].Value); Item_VO.DeptID = this.dtgItem.Rows[row].Cells["execareaid"].Value.ToString(); Item_VO.DeptName = this.dtgItem.Rows[row].Cells["execarea"].Value.ToString(); Item_VO.AllowNegative = true; frmAidEditItem fEdit = new frmAidEditItem(ref Item_VO); if (fEdit.ShowDialog() == DialogResult.OK) { this.dtgItem.Rows[row].Cells["amount"].Value = Item_VO.ItemAmout; this.dtgItem.Rows[row].Cells["execareaid"].Value = Item_VO.DeptID; this.dtgItem.Rows[row].Cells["execarea"].Value = Item_VO.DeptName; decimal d = clsPublic.ConvertObjToDecimal(this.dtgItem.Rows[row].Cells["price"].Value) * clsPublic.ConvertObjToDecimal(this.dtgItem.Rows[row].Cells["amount"].Value); this.dtgItem.Rows[row].Cells["total"].Value = d.ToString("0.00"); this.dtgItem.Rows[row].Cells["sbtotal"].Value = Convert.ToDecimal(d * clsPublic.ConvertObjToDecimal(this.dtgItem.Rows[row].Cells["scale"].Value) / 100).ToString("0.00"); decimal total = 0; for (int i = 0; i < this.dtgItem.Rows.Count; i++) { total += clsPublic.ConvertObjToDecimal(this.dtgItem.Rows[i].Cells["total"].Value); } this.lblAllTotal.Text = total.ToString("0.00"); } } }
/// <summary> /// 构造 /// </summary> public frmAidEditItem(ref clsParmItem_VO vo) { InitializeComponent(); Item_VO = vo; }