private void dgvproject_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { frmWorkHours frmHours = new frmWorkHours(); DialogResult result = frmHours.ShowDialog(); if (result == DialogResult.OK) { dgvproject.Rows[e.RowIndex].Cells["project_num"].Value = frmHours.strProjectNum; dgvproject.Rows[e.RowIndex].Cells["repair_type"].Value = GetDicName(frmHours.strRepairType); dgvproject.Rows[e.RowIndex].Cells["project_name"].Value = frmHours.strProjectName; dgvproject.Rows[e.RowIndex].Cells["whours_price"].Value = frmHours.strQuotaPrice; dgvproject.Rows[e.RowIndex].Cells["remark"].Value = frmHours.strRemark; dgvproject.Rows[e.RowIndex].Cells["whours_type"].Value = frmHours.strWhoursType == "1" ? "工时" : "定额"; dgvproject.Rows.Add(1); } }
private void addProject_Click(object sender, EventArgs e) { frmWorkHours frmHours = new frmWorkHours(); DialogResult result = frmHours.ShowDialog(); if (result == DialogResult.OK) { dgvproject.CurrentRow.Cells["project_num"].Value = frmHours.strProjectNum; dgvproject.CurrentRow.Cells["repair_type"].Value = GetDicName(frmHours.strRepairType); dgvproject.CurrentRow.Cells["project_name"].Value = frmHours.strProjectName; dgvproject.CurrentRow.Cells["whours_price"].Value = frmHours.strQuotaPrice; dgvproject.CurrentRow.Cells["remark"].Value = frmHours.strRemark; dgvproject.CurrentRow.Cells["whours_type"].Value = frmHours.strWhoursType == "1" ? "工时" : "定额"; dgvproject.Rows.Add(1); listProject.Add(frmHours.strProjectNum); } }
private void tsmadd_Click(object sender, EventArgs e) { if (tabControlEx1.SelectedIndex == 0) { //特殊维修项目 frmWorkHours fm = new frmWorkHours(); if (fm.ShowDialog() == DialogResult.OK) { int rowindex = dgvprojrct.Rows.Add(); DataGridViewRow gvr = dgvprojrct.Rows[rowindex]; gvr.Cells["project_num"].Value = fm.strProjectNum; gvr.Cells["project_name"].Value = fm.strProjectName; gvr.Cells["quota_price"].Value = fm.strQuotaPrice; gvr.Cells["service_project_id"].Value = fm.strWhours_id; gvr.Cells["project_service_project_discount"].Value = ""; gvr.Cells["project_discount_price"].Value = ""; gvr.Cells["project_remark"].Value = ""; gvr.Cells["setInfo_projrct_id"].Value = ""; //CommonUtility.SetDgvEditCellBgColor(dgvprojrct.Rows[rowindex], new string[] { "project_service_project_discount", "project_remark" }, true); } } else { //特殊配件 frmParts fm = new frmParts(); if (fm.ShowDialog() == DialogResult.OK) { DataGridViewRow gvr = dgvparts.Rows[dgvparts.Rows.Add()]; gvr.Cells["ser_parts_code"].Value = fm.PartsCode; gvr.Cells["parts_name"].Value = fm.PartsName; gvr.Cells["ref_out_price"].Value = fm.ref_out_price; gvr.Cells["parts_id"].Value = fm.PartsID; gvr.Cells["parts_discount"].Value = ""; gvr.Cells["discount_price"].Value = ""; gvr.Cells["remark"].Value = ""; gvr.Cells["setInfo_parts_id"].Value = ""; } } }