private void InitNode() { TreeNode node = PublicFeeModel.LoadModeTree(level, deptid, employeeid); tvtype.Nodes.Add(node); tvtype.SelectedNode = node; node.Expand(); tvlevel.ExpandAll(); }
private void InitNode() { tvtype.Nodes.Clear(); dgvFeeModel.DataSource = null; TreeNode node = PublicFeeModel.LoadModeTree(level, Convert.ToInt32(_currentDept.DeptID), Convert.ToInt32(_currentUser.EmployeeID)); tvtype.Nodes.Add(node); tvtype.SelectedNode = node; node.Expand(); tvlevel.ExpandAll(); }
private void BindFeeModel() { if (_currentModel.MODEL_TYPE == 1) { dgvFeeModel.DataSource = null; dgvFeeModel.AutoGenerateColumns = false; DataTable dt = PublicFeeModel.GetFeeModelList(_currentModel.MODEL_ID); dgvFeeModel.DataSource = dt; for (int i = 0; i < dt.Rows.Count; i++) { for (int j = 0; j < dgvFeeModel.Columns.Count; j++) { dgvFeeModel.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.RoyalBlue; } } } }
private void btnModelApply_Click(object sender, EventArgs e) { FrmModelApply modelapply = new FrmModelApply(Convert.ToInt32(_currentDept.DeptID), Convert.ToInt32(_currentUser.EmployeeID)); modelapply.ShowDialog(); List <int> applyModels = modelapply.checkedmodels; string notValidItmes = ""; for (int i = 0; i < applyModels.Count; i++) { DataTable dt = PublicFeeModel.GetFeeModelList(applyModels[i]); for (int j = 0; j < dt.Rows.Count; j++) { DataRow [] rows = itemdt.Select(" item_id=" + Convert.ToInt32(dt.Rows[j]["item_id"]) + " and item_type=" + Convert.ToInt32(dt.Rows[j]["item_type"]) + ""); if (rows == null || rows.Length == 0) { notValidItmes = notValidItmes + "," + dt.Rows[j]["item_name"].ToString(); continue; } if (tabPageControl1.SelectedIndex == 0) { int rowIndexLong = dataGridViewEx2.Rows.Count; if (rowIndexLong == 0 || dataGridViewEx2[Column5.Name, rowIndexLong - 1].Value != null) { dataGridViewEx2.Rows.Add(); dataGridViewEx2.CurrentCell = dataGridViewEx2[2, rowIndexLong]; dataGridViewEx2.Focus(); } else { dataGridViewEx2.CurrentCell = dataGridViewEx2[2, rowIndexLong - 1]; dataGridViewEx2.Focus(); rowIndexLong -= 1; } dataGridViewEx2["column3", rowIndexLong].Value = dt.Rows[j]["item_id"]; // dataGridViewEx2["column4", rowIndexLong].Value = dt.Rows[j]["item_type"]; dataGridViewEx2["column6", rowIndexLong].Value = dt.Rows[j]["amount"]; if (dt.Rows[j]["item_type"].ToString().Trim() == "8") { dataGridViewEx2["column4", rowIndexLong].Value = "护理"; } else if (dt.Rows[j]["item_type"].ToString().Trim() == "9") { dataGridViewEx2["column4", rowIndexLong].Value = "其它"; } else if (dt.Rows[j]["item_type"].ToString().Trim() == "0") { dataGridViewEx2["column4", rowIndexLong].Value = "物资"; } dataGridViewEx2["column5", rowIndexLong].Value = rows[0]["order_name"].ToString().Trim(); dataGridViewEx2["column7", rowIndexLong].Value = rows[0]["price"]; dataGridViewEx2["column8", rowIndexLong].Value = rows[0]["order_unit"]; dataGridViewEx2["column9", rowIndexLong].Value = rows[0]["DEFAULT_USAGE"]; dataGridViewEx2["column20", rowIndexLong].Value = rows[0]["TC_FLAG"]; dataGridViewEx2["execdept_code", rowIndexLong].Value = Convert.ToInt32(XcConvert.IsNull(rows[0]["execdept_code"], _currentDept.DeptID.ToString())); } else if (tabPageControl1.SelectedIndex == 1) { int rowIndexTemp = dataGridViewEx3.Rows.Count; if (rowIndexTemp == 0 || dataGridViewEx3[Column15.Name, rowIndexTemp - 1].Value != null) { dataGridViewEx3.Rows.Add(); dataGridViewEx3.CurrentCell = dataGridViewEx3[2, rowIndexTemp]; dataGridViewEx3.Focus(); } else { dataGridViewEx3.CurrentCell = dataGridViewEx3[2, rowIndexTemp - 1]; dataGridViewEx3.Focus(); rowIndexTemp -= 1; } dataGridViewEx3["column13", rowIndexTemp].Value = dt.Rows[j]["item_id"]; // dataGridViewEx3["column14", rowIndexTemp].Value = dt.Rows[j]["item_type"]; dataGridViewEx3["column16", rowIndexTemp].Value = dt.Rows[j]["amount"]; if (dt.Rows[j]["item_type"].ToString().Trim() == "8") { dataGridViewEx3["column14", rowIndexTemp].Value = "护理"; } else if (dt.Rows[j]["item_type"].ToString().Trim() == "9") { dataGridViewEx3["column14", rowIndexTemp].Value = "其它"; } else if (dt.Rows[j]["item_type"].ToString().Trim() == "0") { dataGridViewEx3["column14", rowIndexTemp].Value = "物资"; } dataGridViewEx3["column15", rowIndexTemp].Value = rows[0]["order_name"].ToString().Trim(); dataGridViewEx3["column17", rowIndexTemp].Value = rows[0]["price"]; dataGridViewEx3["column18", rowIndexTemp].Value = rows[0]["order_unit"]; dataGridViewEx3["column19", rowIndexTemp].Value = rows[0]["DEFAULT_USAGE"]; dataGridViewEx3["execdept_code1", rowIndexTemp].Value = Convert.ToInt32(XcConvert.IsNull(rows[0]["execdept_code"], _currentDept.DeptID.ToString())); } } } if (notValidItmes.Trim() != "") { MessageBox.Show("" + notValidItmes + "现已不存在,应用时已过滤 ,请及时更新模板!"); } }