public UCModifyPriceAddOrEdit(WindowStatus state, string ModPricId, UCModifyPriceManager UCModManager) { InitializeComponent(); DTPickorder_date.Value = DateTime.Now.ToShortDateString();//获取当前系统时间 this.UCModifyPriceBM = UCModManager;//获取其它收货单管理类 this.status = state;//获取操作状态 this.ModifyPriceId = ModPricId;//其它收货单ID ControlsConfig.TextToDecimal(txtmodifyprice_ratio); ModyPricRate.ValueType=typeof(decimal); base.SaveEvent += new ClickHandler(UCModifyPriceAddOrEdit_SaveEvent);//保存 base.SubmitEvent += new ClickHandler(UCModifyPriceAddOrEdit_SubmitEvent);//提交 base.ImportEvent += new ClickHandler(UCModifyPriceAddOrEdit_ImportEvent);//导入 base.DeleteEvent += new ClickHandler(UCModifyPriceAddOrEdit_DeleteEvent); //设置列表的可编辑状态 gvPartsMsgList.ReadOnly = false; foreach (DataGridViewColumn dgCol in gvPartsMsgList.Columns) { if (dgCol.Name != colCheck.Name && dgCol.Name != ModyPricRate.Name &&dgCol.Name != ModyAfterPric.Name && dgCol.Name!=remarks.Name) dgCol.ReadOnly = true; } base.btnExport.Visible = false; base.btnConfirm.Visible = false; base.btnEdit.Visible = false; base.btnBalance.Visible = false; base.btnPrint.Visible = false; base.btnExport.Visible = false; }
void dgvMaterials_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["parts_code"].Value))) { dgvMaterials.Rows[e.RowIndex].Cells["retreat_num"].Value = ControlsConfig.SetNewValue(dgvMaterials.Rows[e.RowIndex].Cells["retreat_num"].Value, 1); } }
public PlayerController( PlayerModel player, GameConfig gameConfig, UserInterface userInterface) { _player = player; _playerConfig = gameConfig.PlayerConfig; _userInterface = userInterface; _controlsConfig = gameConfig.ControlsConfig; }
private void openRow(EmpresaVo empresa, bool readOnly) { int idx = dgvDados.SelectedRows[0].Index; DataRowView row = (dgvDados.DataSource as DataTable).DefaultView[idx]; int id = (int)row["id"]; empresa.CODIGO = (string)row["EMPRESA"]; empresa.CODIGO_FILIAL = (string)row["FILIAl"]; new EmpresaDao().Load(empresa, null); ControlsConfig.formShow(new CadContasAPagar(empresa, id, readOnly), this.Form, ControlsConfig.showType.Dialog); }
/// <summary> /// 设定某些输入框仅能数据数字和小数点 /// </summary> private void SetTexDecimal() { ControlsConfig.TextToDecimal(txtv_long); ControlsConfig.TextToDecimal(txtv_wide); ControlsConfig.TextToDecimal(txtv_high); ControlsConfig.TextToDecimal(txtaxle_count); ControlsConfig.TextToDecimal(txtaxle_distance); ControlsConfig.TextToDecimal(txtwheel_distance); ControlsConfig.TextToDecimal(txttotal_quality); ControlsConfig.TextToDecimal(txtapproved_quality); ControlsConfig.TextToDecimal(txtdischarge); ControlsConfig.TextToDecimal(txtwheel_count); }
private void UCFetchMaterialAddOrEdit_Load(object sender, EventArgs e) { dtpMakeOrderTime.Value = DateTime.Now; ControlsConfig.TextToDecimal(txtContactPhone); // base.SetBtnStatus(wStatus); if (wStatus == WindowStatus.Edit || wStatus == WindowStatus.Copy) { BindData(); } else if (wStatus == WindowStatus.Add) { labReserveNoS.Visible = false; } }
BusinessPrint businessPrint; //业务打印功能 #endregion public UCReceivableManage(DataSources.EnumOrderType orderType) { InitializeComponent(); //工具栏事件 this.AddEvent += new ClickHandler(UCReceivableManage_AddEvent); this.EditEvent += new ClickHandler(UCReceivableManage_EditEvent); this.CopyEvent += new ClickHandler(UCReceivableManage_CopyEvent); this.DeleteEvent += new ClickHandler(UCReceivableManage_DeleteEvent); this.ViewEvent += new ClickHandler(UCReceivableManage_ViewEvent); this.VerifyEvent += new ClickHandler(UCReceivableManage_VerifyEvent); this.SubmitEvent += new ClickHandler(UCReceivableManage_SubmitEvent); this.PrintEvent += new ClickHandler(UCReceivableManage_PrintEvent); this.ExportEvent += new ClickHandler(UCReceivableManage_ExportEvent); base.SetEvent += new ClickHandler(UCReceivableManage_SetEvent); this.orderType = orderType;//单据类型 DataGridViewEx.SetDataGridViewStyle(dgvBillReceivable, colOrderStatus); dgvBillReceivable.ReadOnly = false; dgvBillReceivable.HeadCheckChanged += new DataGridViewEx.DelegateOnClick(dgvBillReceivable_HeadCheckChanged); foreach (DataGridViewColumn dgvc in dgvBillReceivable.Columns) { if (dgvc.Name == colCheck.Name) { continue; } dgvc.ReadOnly = true; } SetLable(); #region 打印预览 string printObject = "tb_receivable"; string printTitle = "财务收款单"; if (orderType == DataSources.EnumOrderType.PAYMENT) { printObject = "tb_payment"; printTitle = "财务付款单"; } List <string> listNotPrint = new List <string>(); listNotPrint.Add(colOrgId.Name); listNotPrint.Add(colHandle.Name); PaperSize paperSize = new PaperSize(); paperSize.Width = 297; paperSize.Height = 210; businessPrint = new BusinessPrint(dgvBillReceivable, printObject, printTitle, paperSize, listNotPrint); #endregion //速查 SetQuick(); colDealingsBalance.ValueType = typeof(decimal); //负数格式化红色 ControlsConfig.NegativeFormatting(dgvBillReceivable); }
/// <summary> /// 设置底部DataGridView的Anchor属性 /// </summary> private void SetDgvAnchor() { #region 其他收费项目 dgvOther.Dock = DockStyle.Fill; dgvOther.ReadOnly = false; dgvOther.Rows.Add(3); dgvOther.AllowUserToAddRows = true; ControlsConfig.NumberLimitdgv(dgvproject, new List <string>() { "other_expense_amount" }); DataTable dot = CommonCtrl.GetDictByCode("sys_other_expense_type", true); other_expense_type.DataSource = dot; other_expense_type.ValueMember = "dic_id"; other_expense_type.DisplayMember = "dic_name"; #endregion #region 维修项目信息设置 dgvproject.Dock = DockStyle.Fill; dgvproject.ReadOnly = false; dgvproject.Rows.Add(3); dgvproject.AllowUserToAddRows = true; dgvproject.Columns["project_num"].ReadOnly = true; dgvproject.Columns["project_name"].ReadOnly = true; dgvproject.Columns["repair_type"].ReadOnly = true; dgvproject.Columns["whours_type"].ReadOnly = true; dgvproject.Columns["tax_amount"].ReadOnly = true; ControlsConfig.NumberLimitdgv(dgvproject, new List <string>() { "whours_counts", "whours_price", }); #endregion #region 维修用料设置 dgvMaterials.Dock = DockStyle.Fill; dgvMaterials.ReadOnly = false; dgvMaterials.Rows.Add(3); dgvMaterials.AllowUserToAddRows = true; dgvMaterials.Columns["parts_code"].ReadOnly = true; dgvMaterials.Columns["parts_name"].ReadOnly = true; dgvMaterials.Columns["unit"].ReadOnly = true; dgvMaterials.Columns["original_price"].ReadOnly = true; ControlsConfig.NumberLimitdgv(dgvMaterials, new List <string>() { "number", "preferential_price" }); #endregion }
private void ReserveOrderAddOrEdit_Load(object sender, EventArgs e) { string[] strPArrary = { "man_hour_quantity", "sum_money" }; ControlsConfig.DatagGridViewTotalConfig(dgvproject, strPArrary); string[] strMArrary = { "quantity", "Msum_money" }; ControlsConfig.DatagGridViewTotalConfig(dgvMaterials, strMArrary); //base.SetBtnStatus(wStatus); if (wStatus == WindowStatus.Edit || wStatus == WindowStatus.Copy) { BindData(); } else if (wStatus == WindowStatus.Add) { labReserveNoS.Visible = false; } }
/// <summary> /// 工时数量发生改变时金额也发生改变 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvproject_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } //是否三包值 string strIsThree = CommonCtrl.IsNullToString(dgvproject.Rows[e.RowIndex].Cells["three_warranty"].Value); if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvproject.Rows[e.RowIndex].Cells["item_name"].Value))) { if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvproject.Rows[e.RowIndex].Cells["man_hour_type"].Value)))//工时 { if (e.ColumnIndex == 5 || e.ColumnIndex == 6) { ControlsConfig.SetCellsValue(dgvproject, e.RowIndex, "man_hour_quantity,man_hour_norm_unitprice"); string strNum = dgvproject.Rows[e.RowIndex].Cells["man_hour_quantity"].Value != null ? dgvproject.Rows[e.RowIndex].Cells["man_hour_quantity"].Value.ToString() : "0"; string strMoney = dgvproject.Rows[e.RowIndex].Cells["man_hour_norm_unitprice"].Value != null ? dgvproject.Rows[e.RowIndex].Cells["man_hour_norm_unitprice"].Value.ToString() : "0"; dgvproject.Rows[e.RowIndex].Cells["sum_money"].Value = Convert.ToString(Convert.ToDecimal(strNum = strNum == "" ? "0" : strNum) * Convert.ToDecimal(strMoney = strMoney == "" ? "0" : strMoney)); } } } if (e.ColumnIndex == 8) { if (CommonCtrl.IsNullToString(dgvproject.Rows[e.RowIndex].Cells["man_hour_type"].Value) == "工时") { //工时时设置数量和金额均可修改 dgvproject.Rows[e.RowIndex].Cells["man_hour_norm_unitprice"].ReadOnly = strIsThree == "否" ? false : true; } dgvproject.Rows[e.RowIndex].Cells["man_hour_quantity"].ReadOnly = strIsThree == "否" ? false : true; if (strIsThree == "是") { string strOId = CommonCtrl.IsNullToString(dgvproject.Rows[e.RowIndex].Cells["OldItem_id"].Value); if (!string.IsNullOrEmpty(strOId)) { DataTable dot = DBHelper.GetTable("", "v_workhours_users", "*", "whours_id='" + strOId + "'", "", ""); if (dot.Rows.Count > 0) { DataRow dpr = dot.Rows[0]; dgvproject.Rows[e.RowIndex].Cells["man_hour_quantity"].Value = CommonCtrl.IsNullToString(dpr["whours_num_a"]); dgvproject.Rows[e.RowIndex].Cells["man_hour_norm_unitprice"].Value = CommonCtrl.IsNullToString(dpr["quota_price"]); dgvproject.Rows[e.RowIndex].Cells["sum_money"].Value = Convert.ToString(Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dpr["whours_num_a"])) ? CommonCtrl.IsNullToString(dpr["whours_num_a"]) : "0") * Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dpr["quota_price"])) ? CommonCtrl.IsNullToString(dpr["quota_price"]) : "0")); } } } } }
private void dgvMaterials_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["parts_code"].Value)) && !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["parts_name"].Value))) { if (e.ColumnIndex == 8 || e.ColumnIndex == 7) { ControlsConfig.SetCellsValue(dgvMaterials, e.RowIndex, "quantity,unit_price"); string strNum = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value)) ? dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value.ToString() : "0"; string strUnitPrice = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value)) ? dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value.ToString() : "0"; dgvMaterials.Rows[e.RowIndex].Cells["sum_money"].Value = Convert.ToString(Convert.ToDecimal(strNum = strNum == "" ? "0" : strNum) * Convert.ToDecimal(Convert.ToDecimal(strUnitPrice = strUnitPrice == "" ? "0" : strUnitPrice))); } } }
public void Initialize() { _mainCameraRigEntity = _contexts.game.CreateEntity(); _mainCameraRigEntity.AddView(Camera.main.transform.parent.gameObject); _mainCameraRigEntity.AddPosition(Camera.main.transform.parent.position); _mainCameraRigEntity.AddRotation(Camera.main.transform.parent.rotation); _mainCameraRigEntity.isMainCameraRig = true; _mainCameraEntity = _contexts.game.CreateEntity(); _mainCameraEntity.AddView(Camera.main.transform.gameObject); _mainCameraEntity.AddPosition(Camera.main.transform.position); _mainCameraEntity.AddRotation(Camera.main.transform.rotation); _mainCameraEntity.isMainCamera = true; _controls = _contexts.meta.gameConfig.value.controls; _hotkeys = _contexts.meta.gameConfig.value.hotkeys; }
/// <summary> /// 数量、原始单价发生改变时金额也跟着改变 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvMaterials_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } string strIsThree = CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["Mthree_warranty"].Value); if (dgvMaterials.Rows[e.RowIndex].Cells["parts_name"].Value != null) { if (e.ColumnIndex == 6 || e.ColumnIndex == 7) { //if (strIsThree == "否") //{ ControlsConfig.SetCellsValue(dgvMaterials, e.RowIndex, "quantity,unit_price"); string strNum = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value)) ? CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value) : "0"; string strUMoney = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value)) ? CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value) : "0"; dgvMaterials.Rows[e.RowIndex].Cells["Msum_money"].Value = Convert.ToString(Convert.ToDecimal(strNum = strNum == "" ? "0" : strNum) * Convert.ToDecimal(strUMoney = strUMoney == "" ? "0" : strUMoney)); //} } } if (e.ColumnIndex == 11) { if (strIsThree == "否") { dgvMaterials.Rows[e.RowIndex].Cells["quantity"].ReadOnly = false; dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].ReadOnly = false; } else if (strIsThree == "是") { dgvMaterials.Columns["quantity"].ReadOnly = false; dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].ReadOnly = true; string strMId = CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["M_Id"].Value); DataTable dpt = DBHelper.GetTable("", "v_parts", "*", " parts_id='" + strMId + "'", "", ""); if (dpt.Rows.Count > 0) { DataRow dpr = dpt.Rows[0]; dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value = CommonCtrl.IsNullToString(dpr["highest_out_price"]); string strUMoney = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value)) ? CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["unit_price"].Value) : "0"; string strNum = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value)) ? CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value) : "0"; dgvMaterials.Rows[e.RowIndex].Cells["Msum_money"].Value = Convert.ToString(Convert.ToDecimal(strNum = strNum == "" ? "0" : strNum) * Convert.ToDecimal(strUMoney = strUMoney == "" ? "0" : strUMoney)); } } } }
private void dgvMaterials_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["parts_code"].Value))) { if (e.ColumnIndex == 4) { ControlsConfig.SetCellsValue(dgvMaterials, e.RowIndex, "quantity"); string strNum = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value)) ? dgvMaterials.Rows[e.RowIndex].Cells["quantity"].Value.ToString() : "0"; string strWNum = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["inventory_num"].Value)) ? dgvMaterials.Rows[e.RowIndex].Cells["inventory_num"].Value.ToString() : "0"; if (Convert.ToDecimal(strNum) > Convert.ToDecimal(strWNum)) { MessageBoxEx.Show("领取数量不能大于库存数量!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); return; } if (!string.IsNullOrEmpty(strBefore_orderId))//导入的数据计算 { string strShouldNum = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvMaterials.Rows[e.RowIndex].Cells["picking_num"].Value)) ? dgvMaterials.Rows[e.RowIndex].Cells["picking_num"].Value.ToString() : "0"; if (Convert.ToDecimal(strShouldNum) > 0) { if (Convert.ToDecimal(strNum) > Convert.ToDecimal(strShouldNum)) { MessageBoxEx.Show("领取数量不能大于应领数量!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); return; } dgvMaterials.Rows[e.RowIndex].Cells["received_num"].Value = strNum; dgvMaterials.Rows[e.RowIndex].Cells["notFetchNum"].Value = (Convert.ToDecimal(strShouldNum) - Convert.ToDecimal(strNum)).ToString(); } } else { //普通的数据计算 dgvMaterials.Rows[e.RowIndex].Cells["picking_num"].Value = strNum; dgvMaterials.Rows[e.RowIndex].Cells["received_num"].Value = strNum; dgvMaterials.Rows[e.RowIndex].Cells["notFetchNum"].Value = "0"; } } } }
/// <summary> /// 设置底部DataGridView的Anchor属性 /// </summary> private void SetDgvAnchor() { #region 维修项目信息设置 dgvproject.Dock = DockStyle.Fill; //dgvproject.Columns["colCheck"].HeaderText = "选择"; dgvproject.ReadOnly = false; dgvproject.Rows.Add(3); dgvproject.AllowUserToAddRows = true; dgvproject.Columns["item_no"].ReadOnly = true; dgvproject.Columns["item_type"].ReadOnly = true; dgvproject.Columns["item_name"].ReadOnly = true; dgvproject.Columns["man_hour_norm_unitprice"].ReadOnly = true; dgvproject.Columns["sum_money"].ReadOnly = true; dgvproject.Columns["man_hour_type"].ReadOnly = true; ControlsConfig.NumberLimitdgv(dgvproject, new List <string>() { "man_hour_quantity" }); #endregion #region 维修用料设置 dgvMaterials.Dock = DockStyle.Fill; //dgvMaterials.Columns["MCheck"].HeaderText = "选择"; dgvMaterials.ReadOnly = false; dgvMaterials.Rows.Add(3); dgvMaterials.AllowUserToAddRows = true; dgvMaterials.Columns["parts_code"].ReadOnly = true; dgvMaterials.Columns["parts_name"].ReadOnly = true; dgvMaterials.Columns["norms"].ReadOnly = true; dgvMaterials.Columns["unit"].ReadOnly = true; dgvMaterials.Columns["whether_imported"].ReadOnly = true; dgvMaterials.Columns["Msum_money"].ReadOnly = true; dgvMaterials.Columns["drawn_no"].ReadOnly = true; dgvMaterials.Columns["vehicle_model"].ReadOnly = true; ControlsConfig.NumberLimitdgv(dgvMaterials, new List <string>() { "quantity", "unit_price" }); #endregion }
private void btnOk_Click(object sender, EventArgs e) { if (cbFILIAL.SelectedIndex < 0) { MessageBox.Show("Selecione uma Empresa/Filial."); } else { DataRowView row = cbFILIAL.SelectedItem as DataRowView; empresa.CODIGO = (string)row["M0_CODIGO"]; empresa.NOME = (string)row["M0_NOME"]; empresa.CODIGO_FILIAL = (string)row["M0_CODFIL"]; empresa.FILIAL = (string)row["M0_FILIAL"]; //Form frm = new Form(); //frm.Controls.Add(toControl); //frm.WindowState=FormWindowState.Maximized; //frm.ShowDialog(this.Form); ControlsConfig.formShow(toControl, this.Form, ControlsConfig.showType.Dialog); } }
BusinessPrint businessPrint; //业务打印功能 #endregion public UCAccountVerificationManage() { InitializeComponent(); //工具栏事件 this.AddEvent += new ClickHandler(UCAccountVerificationManage_AddEvent); this.EditEvent += new ClickHandler(UCAccountVerificationManage_EditEvent); this.CopyEvent += new ClickHandler(UCAccountVerificationManage_CopyEvent); this.ViewEvent += new ClickHandler(UCAccountVerificationManage_ViewEvent); this.DeleteEvent += new ClickHandler(UCAccountVerificationManage_DeleteEvent); this.VerifyEvent += new ClickHandler(UCAccountVerificationManage_VerifyEvent); this.SubmitEvent += new ClickHandler(UCAccountVerificationManage_SubmitEvent); this.PrintEvent += new ClickHandler(UCAccountVerificationManage_PrintEvent); this.ExportEvent += new ClickHandler(UCAccountVerificationManage_ExportEvent); base.SetEvent += new ClickHandler(UCAccountVerificationManage_SetEvent); dgvVerification.ReadOnly = false; dgvVerification.HeadCheckChanged += new DataGridViewEx.DelegateOnClick(dgvVerification_HeadCheckChanged); foreach (DataGridViewColumn dgvc in dgvVerification.Columns) { if (dgvc.Name == colChk.Name) { continue; } dgvc.ReadOnly = true; } #region 打印预览 List <string> listNotPrint = new List <string>(); listNotPrint.Add(colOrgId.Name); listNotPrint.Add(colHandle.Name); PaperSize paperSize = new PaperSize(); paperSize.Width = 297; paperSize.Height = 210; businessPrint = new BusinessPrint(dgvVerification, "tb_account_verification", "往来核销", paperSize, listNotPrint); #endregion colAdvanceBalance.ValueType = typeof(decimal); //负数格式化红色 ControlsConfig.NegativeFormatting(dgvVerification); }
/// <summary> /// 设置底部DataGridView的Anchor属性 /// </summary> private void SetDgvAnchor() { #region 维修用料设置 dgvMaterials.Dock = DockStyle.Fill; //dgvMaterials.Columns["MCheck"].HeaderText = "选择"; dgvMaterials.ReadOnly = false; dgvMaterials.Rows.Add(3); dgvMaterials.AllowUserToAddRows = true; dgvMaterials.Columns["parts_code"].ReadOnly = true; dgvMaterials.Columns["parts_name"].ReadOnly = true; dgvMaterials.Columns["unit"].ReadOnly = true; dgvMaterials.Columns["whether_imported"].ReadOnly = true; dgvMaterials.Columns["drawn_no"].ReadOnly = true; dgvMaterials.Columns["vehicle_brand"].ReadOnly = true; dgvMaterials.Columns["inventory_num"].ReadOnly = true; dgvMaterials.Columns["picking_num"].ReadOnly = true; dgvMaterials.Columns["received_num"].ReadOnly = true; dgvMaterials.Columns["notFetchNum"].ReadOnly = true; ControlsConfig.NumberLimitdgv(dgvMaterials, new List <string>() { "quantity" }); #endregion }
/// <summary> /// 根据领料单Id获取相应的详细信息 /// </summary> /// <param name="strRId">领料单Id值</param> /// <param name="strRId">领料单详情Id值</param> private void GetRescueData(string strRId, string strDRId) { #region 基本信息 //SetBtnStatus(WindowStatus.View); DataTable dt = DBHelper.GetTable("领料退货单预览", "tb_maintain_refund_material", "*", string.Format(" refund_id='{0}'", strRId), "", ""); if (dt.Rows.Count > 0) { #region 维修表信息 DataRow dr = dt.Rows[0]; if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dr["refund_no"]))) { labMaterialNoS.Text = CommonCtrl.IsNullToString(dr["refund_no"]);//退料单号 } else { labMaterialNoS.Text = string.Empty; } strFetchTime = CommonCtrl.IsNullToString(dr["refund_time"]); //退料时间 if (!string.IsNullOrEmpty(strFetchTime)) { labFetchTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strFetchTime)).ToString("yyyy-MM-dd HH:mm"); } else { labFetchTimeS.Text = string.Empty; } labCustomNOS.Text = CommonCtrl.IsNullToString(dr["customer_code"]); //客户编码 labCustomNameS.Text = CommonCtrl.IsNullToString(dr["customer_name"]); //客户名称 labContactS.Text = CommonCtrl.IsNullToString(dr["linkman"]); //联系人 labContactPhoneS.Text = CommonCtrl.IsNullToString(dr["link_man_mobile"]); //联系人电话 labCarNOS.Text = CommonCtrl.IsNullToString(dr["vehicle_no"]); //车牌号 labCarTypeS.Text = GetDicName(CommonCtrl.IsNullToString(dr["vehicle_model"])); //车型 labStatusS.Text = DataSources.GetDescription(typeof(DataSources.EnumAuditStatus), int.Parse(CommonCtrl.IsNullToString(dr["info_status"]))); //单据状态 labDepartS.Text = GetDepartmentName(CommonCtrl.IsNullToString(dr["org_name"])); //部门 labAttnS.Text = GetSetJBName(CommonCtrl.IsNullToString(dr["responsible_name"])); //经办人 labCreatePersonS.Text = CommonCtrl.IsNullToString(dr["create_name"]); //创建人 labFetchOpidS.Text = GetSetName(CommonCtrl.IsNullToString(dr["fetch_opid"])); //退料人 labRemarkS.Text = CommonCtrl.IsNullToString(dr["remarks"]); //备注 string strCreateTime = CommonCtrl.IsNullToString(dr["create_time"]); //创建时间 if (!string.IsNullOrEmpty(strCreateTime)) { labCreateTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strCreateTime)).ToString("yyyy-MM-dd HH:mm"); } else { labCreateTimeS.Text = string.Empty; } labFinallyPerS.Text = CommonCtrl.IsNullToString(dr["update_name"]); //最后编辑人 string strFinallyTime = CommonCtrl.IsNullToString(dr["update_time"]); //最后编辑时间 if (!string.IsNullOrEmpty(strFinallyTime)) { labFinallyTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strFinallyTime)).ToString("yyyy-MM-dd HH:mm"); } else { labFinallyTimeS.Text = string.Empty; } strStatus = CommonCtrl.IsNullToString(dr["info_status"]);//单据状态 if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.SUBMIT).ToString()) { //已提交状态屏蔽提交、编辑、删除按钮 base.btnSubmit.Enabled = false; base.btnEdit.Enabled = false; base.btnDelete.Enabled = false; base.btnActivation.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString()) { //已审核时屏蔽提交、审核、编辑、删除按钮 base.btnSubmit.Enabled = false; base.btnVerify.Enabled = false; base.btnEdit.Enabled = false; base.btnDelete.Enabled = false; base.btnActivation.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString() || strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.DRAFT).ToString()) { //审核没通过时屏蔽审核按钮 base.btnVerify.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.Invalid).ToString()) { base.btnActivation.Caption = "激活"; base.btnSubmit.Enabled = false; base.btnVerify.Enabled = false; base.btnEdit.Enabled = false; } #endregion #endregion #region 领料信息 DataTable dlt = DBHelper.GetTable("领料数据", "tb_maintain_refund_material_detai", "*", string.Format(" refund_id='{0}'", strRId), "", ""); if (dlt.Rows.Count > 0) { if (dlt.Rows.Count > dgvMaterials.Rows.Count) { dgvMaterials.Rows.Add(dlt.Rows.Count - dgvMaterials.Rows.Count + 1); } for (int i = 0; i < dlt.Rows.Count; i++) { DataRow dor = dlt.Rows[i]; dgvMaterials.Rows[i].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dor["parts_code"]); dgvMaterials.Rows[i].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dor["parts_name"]); dgvMaterials.Rows[i].Cells["unit"].Value = CommonCtrl.IsNullToString(dor["unit"]); dgvMaterials.Rows[i].Cells["quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dor["retreat_num"]), 1); dgvMaterials.Rows[i].Cells["warehouse"].Value = GetWarehouseName(CommonCtrl.IsNullToString(dor["warehouse"])); dgvMaterials.Rows[i].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dor["whether_imported"]) == "1" ? "是" : "否"; dgvMaterials.Rows[i].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dor["drawn_no"]); dgvMaterials.Rows[i].Cells["vehicle_brand"].Value = CommonCtrl.IsNullToString(dor["vehicle_brand"]); dgvMaterials.Rows[i].Cells["Mremarks"].Value = CommonCtrl.IsNullToString(dor["remarks"]); dgvMaterials.Rows[i].Cells["material_id"].Value = CommonCtrl.IsNullToString(dor["material_id"]); } } #endregion } else { #region 没有数据时全部显示为空 labAttnS.Text = string.Empty; labCarNOS.Text = string.Empty; labCarTypeS.Text = string.Empty; labContactPhoneS.Text = string.Empty; labContactS.Text = string.Empty; labCreatePersonS.Text = string.Empty; labCreateTimeS.Text = string.Empty; labCustomNameS.Text = string.Empty; labCustomNOS.Text = string.Empty; labDepartS.Text = string.Empty; labFinallyPerS.Text = string.Empty; labFinallyTimeS.Text = string.Empty; labStatusS.Text = string.Empty; labRemarkS.Text = string.Empty; #endregion } }
/// <summary> /// 根据预约单Id获取相应的详细信息 /// </summary> /// <param name="strRId">预约单reserv_id值</param> private void GetReservData(string strRId) { #region 基本信息 //SetBtnStatus(WindowStatus.View); DataTable dt = DBHelper.GetTable("维修接待单预览", "tb_maintain_info", "*", string.Format(" maintain_id='{0}'", strRId), "", ""); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dr["maintain_no"]))) { labMaintain_noS.Text = CommonCtrl.IsNullToString(dr["maintain_no"]);//维修单号 } else { labMaintain_noS.Text = string.Empty; } string strReTime = CommonCtrl.IsNullToString(dr["reception_time"]);//接待时间 if (!string.IsNullOrEmpty(strReTime)) { labRTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strReTime)).ToString("yyyy-MM-dd HH:mm"); } else { labRTimeS.Text = string.Empty; } labCustomNOS.Text = CommonCtrl.IsNullToString(dr["customer_code"]); //客户编码 labCustomNameS.Text = CommonCtrl.IsNullToString(dr["customer_name"]); //客户名称 labContactS.Text = CommonCtrl.IsNullToString(dr["linkman"]); //联系人 labContactPhoneS.Text = CommonCtrl.IsNullToString(dr["link_man_mobile"]); //联系人电话 labCarNOS.Text = CommonCtrl.IsNullToString(dr["vehicle_no"]); //车牌号 labCarTypeS.Text = GetVmodel(CommonCtrl.IsNullToString(dr["vehicle_model"])); //车型 labCarBrandS.Text = GetDicName(CommonCtrl.IsNullToString(dr["vehicle_brand"])); //车辆品牌 labVINS.Text = CommonCtrl.IsNullToString(dr["vehicle_vin"]); //VIN labEngineNoS.Text = CommonCtrl.IsNullToString(dr["engine_no"]); //发动机号 labturnerS.Text = CommonCtrl.IsNullToString(dr["turner"]); //车厂编码 labDriverS.Text = CommonCtrl.IsNullToString(dr["driver_name"]); //司机 labDriverPhoneS.Text = CommonCtrl.IsNullToString(dr["driver_mobile"]); //司机手机 labRepTypeS.Text = GetDicName(CommonCtrl.IsNullToString(dr["maintain_type"])); //维修类别 labPayTypeS.Text = GetDicName(CommonCtrl.IsNullToString(dr["maintain_payment"])); //维修付费方式 string strInTime = CommonCtrl.IsNullToString(dr["completion_time"]); //预计完工时间 if (!string.IsNullOrEmpty(strInTime)) { labSuTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strInTime)).ToString("yyyy-MM-dd HH:mm"); } else { labSuTimeS.Text = string.Empty; } labMlS.Text = !String.IsNullOrEmpty(CommonCtrl.IsNullToString(dr["oil_into_factory"]))?CommonCtrl.IsNullToString(dr["oil_into_factory"]) + "%":""; //进场油量 labMilS.Text = !String.IsNullOrEmpty(CommonCtrl.IsNullToString(dr["travel_mileage"]))?CommonCtrl.IsNullToString(dr["travel_mileage"]) + "Km":""; //行驶里程 labDescS.Text = CommonCtrl.IsNullToString(dr["fault_describe"]); //故障描述 #region 会员信息 string strMemnerID = CommonCtrl.IsNullToString(dr["customer_id"]);//会员信息Id GetMemberInfo(strMemnerID); #endregion labRemarkS.Text = CommonCtrl.IsNullToString(dr["remark"]); //备注 labStatusS.Text = DataSources.GetDescription(typeof(DataSources.EnumAuditStatus), int.Parse(CommonCtrl.IsNullToString(dr["info_status"]))); //单据状态 //labMoney.Text = CommonCtrl.IsNullToString(dr["maintain_payment"]);//欠款余额 labDepartS.Text = GetDepartmentName(CommonCtrl.IsNullToString(dr["org_id"])); //部门 labAttnS.Text = GetSetName(CommonCtrl.IsNullToString(dr["responsible_opid"])); //经办人 labCreatePersonS.Text = CommonCtrl.IsNullToString(dr["create_name"]); //创建人 string strCreateTime = CommonCtrl.IsNullToString(dr["create_time"]); //创建时间 if (!string.IsNullOrEmpty(strCreateTime)) { labCreateTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strCreateTime)).ToString("yyyy-MM-dd HH:mm"); } else { labCreateTimeS.Text = string.Empty; } labFinallyPerS.Text = CommonCtrl.IsNullToString(dr["update_name"]); //最后编辑人 string strFinallyTime = CommonCtrl.IsNullToString(dr["update_time"]); //最后编辑时间 if (!string.IsNullOrEmpty(strFinallyTime)) { labFinallyTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strFinallyTime)).ToString("yyyy-MM-dd HH:mm"); } else { labFinallyTimeS.Text = string.Empty; } strStatus = CommonCtrl.IsNullToString(dr["info_status"]); //单据状态 if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.SUBMIT).ToString()) { //已提交状态屏蔽提交、编辑、删除按钮 base.btnSubmit.Enabled = false; base.btnEdit.Enabled = false; base.btnDelete.Enabled = false; base.btnActivation.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString()) { //已审核时屏蔽提交、审核、编辑、删除按钮 base.btnSubmit.Enabled = false; base.btnVerify.Enabled = false; base.btnEdit.Enabled = false; base.btnDelete.Enabled = false; base.btnActivation.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString() || strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.DRAFT).ToString()) { //审核没通过时屏蔽审核按钮 base.btnVerify.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.Invalid).ToString()) { base.btnActivation.Caption = "激活"; base.btnSubmit.Enabled = false; base.btnVerify.Enabled = false; base.btnEdit.Enabled = false; } strBeforOrderId = CommonCtrl.IsNullToString(dr["before_orderId"]); strBeforSource = CommonCtrl.IsNullToString(dr["orders_source"]); #endregion #region 底部datagridview数据 #region 维修项目数据 //维修项目数据 decimal dcPmoney = 0; DataTable dpt = DBHelper.GetTable("维修项目数据", "tb_maintain_item", "*", string.Format(" maintain_id='{0}' and enable_flag='" + Convert.ToInt32(DataSources.EnumEnableFlag.USING).ToString() + "'", strRId), "", "");; if (dpt.Rows.Count > 0) { if (dpt.Rows.Count > dgvproject.Rows.Count) { dgvproject.Rows.Add(dpt.Rows.Count - dgvproject.Rows.Count + 1); } for (int i = 0; i < dpt.Rows.Count; i++) { DataRow dpr = dpt.Rows[i]; dgvproject.Rows[i].Cells["item_id"].Value = CommonCtrl.IsNullToString(dpr["item_id"]); dgvproject.Rows[i].Cells["three_warranty"].Value = CommonCtrl.IsNullToString(dpr["three_warranty"]) == "1" ? "是" : "否"; dgvproject.Rows[i].Cells["man_hour_type"].Value = CommonCtrl.IsNullToString(dpr["man_hour_type"]); dgvproject.Rows[i].Cells["item_no"].Value = CommonCtrl.IsNullToString(dpr["item_no"]); dgvproject.Rows[i].Cells["item_name"].Value = CommonCtrl.IsNullToString(dpr["item_name"]); dgvproject.Rows[i].Cells["item_type"].Value = CommonCtrl.IsNullToString(dpr["item_type"]); dgvproject.Rows[i].Cells["man_hour_quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["man_hour_quantity"]), 1); dgvproject.Rows[i].Cells["man_hour_norm_unitprice"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["man_hour_norm_unitprice"]), 2); dgvproject.Rows[i].Cells["remarks"].Value = CommonCtrl.IsNullToString(dpr["remarks"]); dgvproject.Rows[i].Cells["sum_money_goods"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["sum_money_goods"]), 2); dgvproject.Rows[i].Cells["member_discount"].Value = CommonCtrl.IsNullToString(dpr["member_discount"]); dgvproject.Rows[i].Cells["member_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["member_price"]), 2); dgvproject.Rows[i].Cells["member_sum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["member_sum_money"]), 2); } foreach (DataGridViewRow dgvr in dgvproject.Rows) { dcPmoney += Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvr.Cells["sum_money_goods"].Value)) ? dgvr.Cells["sum_money_goods"].Value : 0); } labAssessS.Text = dcPmoney.ToString(); } #endregion #region 维修用料数据 //维修用料数据 decimal dcMmoney = 0; DataTable dmt = DBHelper.GetTable("维修用料数据", "tb_maintain_material_detail", "*", string.Format(" maintain_id='{0}' and enable_flag='" + Convert.ToInt32(DataSources.EnumEnableFlag.USING).ToString() + "'", strRId), "", ""); if (dmt.Rows.Count > 0) { if (dmt.Rows.Count > dgvMaterials.Rows.Count) { dgvMaterials.Rows.Add(dmt.Rows.Count - dgvMaterials.Rows.Count + 1); } for (int i = 0; i < dmt.Rows.Count; i++) { DataRow dmr = dmt.Rows[i]; dgvMaterials.Rows[i].Cells["material_id"].Value = CommonCtrl.IsNullToString(dmr["material_id"]); dgvMaterials.Rows[i].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dmr["parts_code"]); dgvMaterials.Rows[i].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dmr["parts_name"]); dgvMaterials.Rows[i].Cells["norms"].Value = CommonCtrl.IsNullToString(dmr["norms"]); dgvMaterials.Rows[i].Cells["unit"].Value = CommonCtrl.IsNullToString(dmr["unit"]); dgvMaterials.Rows[i].Cells["quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["quantity"]), 1); dgvMaterials.Rows[i].Cells["unit_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["unit_price"]), 2); dgvMaterials.Rows[i].Cells["Mmember_discount"].Value = CommonCtrl.IsNullToString(dmr["member_discount"]); dgvMaterials.Rows[i].Cells["Mmember_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["member_price"]), 2); dgvMaterials.Rows[i].Cells["sum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["sum_money"]), 2); dgvMaterials.Rows[i].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dmr["drawn_no"]); dgvMaterials.Rows[i].Cells["vehicle_brand"].Value = CommonCtrl.IsNullToString(dmr["vehicle_brand"]); dgvMaterials.Rows[i].Cells["Mthree_warranty"].Value = CommonCtrl.IsNullToString(dmr["three_warranty"]) == "1" ? "是" : "否"; dgvMaterials.Rows[i].Cells["Mremarks"].Value = CommonCtrl.IsNullToString(dmr["remarks"]); dgvMaterials.Rows[i].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dmr["whether_imported"]) == "1" ? "是" : "否"; } foreach (DataGridViewRow dgvr in dgvMaterials.Rows) { dcMmoney += Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvr.Cells["sum_money"].Value)) ? dgvr.Cells["sum_money"].Value : 0); } labLAssessS.Text = dcMmoney.ToString(); } #endregion #region 其他项目收费数据 //其他项目收费数据 decimal doMmoney = 0; DataTable dot = DBHelper.GetTable("其他项目收费数据", "tb_maintain_other_toll", "*", string.Format(" maintain_id='{0}'", strRId), "", ""); if (dot.Rows.Count > 0) { if (dot.Rows.Count > dgvOther.Rows.Count) { dgvOther.Rows.Add(dot.Rows.Count - dgvOther.Rows.Count + 1); } for (int i = 0; i < dot.Rows.Count; i++) { DataRow dor = dot.Rows[i]; dgvOther.Rows[i].Cells["toll_id"].Value = CommonCtrl.IsNullToString(dor["toll_id"]); dgvOther.Rows[i].Cells["Osum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dor["sum_money"]), 2); dgvOther.Rows[i].Cells["Oremarks"].Value = CommonCtrl.IsNullToString(dor["remarks"]); dgvOther.Rows[i].Cells["cost_types"].Value = GetDicName(CommonCtrl.IsNullToString(dor["cost_types"])); } foreach (DataGridViewRow dgvr in dgvOther.Rows) { doMmoney += Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvr.Cells["Osum_money"].Value)) ? dgvr.Cells["Osum_money"].Value : 0); } labOAssessS.Text = doMmoney.ToString(); } labTotalS.Text = (dcPmoney + dcMmoney + doMmoney).ToString(); #endregion #region 附件信息数据 //附件信息数据 ucAttr.TableName = "tb_maintain_info"; ucAttr.TableNameKeyValue = strRId; ucAttr.BindAttachment(); #endregion #endregion } else { #region 没有数据时全部显示为空 labMaintain_noS.Text = string.Empty; labRTimeS.Text = string.Empty; labAttnS.Text = string.Empty; labCarBrandS.Text = string.Empty; labCarNOS.Text = string.Empty; labCarTypeS.Text = string.Empty; labturnerS.Text = string.Empty; labContactPhoneS.Text = string.Empty; labContactS.Text = string.Empty; labCreatePersonS.Text = string.Empty; labCreateTimeS.Text = string.Empty; labCustomNameS.Text = string.Empty; labCustomNOS.Text = string.Empty; labDepartS.Text = string.Empty; labDescS.Text = string.Empty; labDriverPhoneS.Text = string.Empty; labDriverS.Text = string.Empty; labEngineNoS.Text = string.Empty; labFinallyPerS.Text = string.Empty; labFinallyTimeS.Text = string.Empty; labPayTypeS.Text = string.Empty; labRemarkS.Text = string.Empty; labRepTypeS.Text = string.Empty; labStatusS.Text = string.Empty; labVINS.Text = string.Empty; labMlS.Text = string.Empty; labMilS.Text = string.Empty; labMemberNoS.Text = string.Empty; labMemberGradeS.Text = string.Empty; labMemberPZkS.Text = string.Empty; labMemberLZkS.Text = string.Empty; #endregion } }
public UCTrialSettlement() { InitializeComponent(); ControlsConfig.TextToDecimal(txtPreMoney); }
private void menu_Click(object objSource, ToolBarItemEventArgs objArgs) { Control inControl = this.Parent; SxMakeRelatory rel; REPORT.ReportVo report; string relname = ""; switch (objArgs.ToolBarButton.Name.ToLower()) { case "tbbadd": #region ADD this.Parent.Controls.Clear(); rel = new SxMakeRelatory(); rel.Dock = DockStyle.Fill; FormatScreen.AddControl(inControl, rel, true, 1, true, false); rel.btnAddNew_Click(null, null); #endregion break; case "tbbver": #region VER if (dgvReports.SelectedRows.Count > 0) { DataRow row = (DataRow)(dgvReports.DataSource as DataView).Table.Rows[dgvReports.SelectedRows[0].Index]; /* * Report cReport = new Report(); * cReport.LOAD((string)row["nome"], false); * * gridWindow grid = new gridWindow(cReport.TABLE.QUERY.ToString(), null); * grid.SetGridHeader(cReport.TABLE.FIELDS.TOGRID); * grid.showWindow(); * //*/ ControlsConfig.formShow(new ViewReport(int.Parse(row["id"].ToString())), this.Form, ControlsConfig.showType.Dialog, null, true); } #endregion break; case "tbbedit": #region EDIT if (dgvReports.SelectedRows.Count > 0) { this.Parent.Controls.Clear(); DataRow row = (DataRow)(dgvReports.DataSource as DataView).Table.Rows[dgvReports.SelectedRows[0].Index]; rel = new SxMakeRelatory(); rel.Dock = DockStyle.Fill; FormatScreen.AddControl(inControl, rel, true, 1, true, false); relname = (string)row["nome"]; rel.btnAbrir_Click(new Label(relname), null); } #endregion break; case "tbbdel": #region DEL if (dgvReports.SelectedRows.Count > 0) { DataRow row = (DataRow)(dgvReports.DataSource as DataView).Table.Rows[dgvReports.SelectedRows[0].Index]; report = new REPORT.ReportVo(); report.ID = int.Parse(row["id"].ToString()); report.IDREPORTGROUP = int.Parse(row["idreportgroup"].ToString()); SigaObjects.Reports.Table.TableVo maintable = new SigaObjects.Reports.Table.TableVo(); new SigaObjects.Reports.Table.TableDao().load(maintable, report.ID, 0); new SigaObjects.Reports.Report.ReportDao().DeleteRecursiveTables(maintable.ID); new SigaObjects.Reports.Report.ReportDao().delete(report); } #endregion break; case "tbbexcel": #region EXCEL FormatScreen.showNotImplemented(); #endregion break; case "tbbpdf": #region PDF FormatScreen.showNotImplemented(); #endregion break; default: break; } }
public void ShowWindow(Form form) { ControlsConfig.formShow(this, form, ControlsConfig.showType.Dialog); }
/// <summary> /// 根据救援单Id获取相应的详细信息 /// </summary> /// <param name="strRId">救援单Id值</param> private void GetRescueData(string strRId) { #region 基本信息 //SetBtnStatus(WindowStatus.View); DataTable dt = DBHelper.GetTable("救援单预览", "tb_maintain_rescue_info", "*", string.Format(" rescue_id='{0}'", strRId), "", ""); if (dt.Rows.Count > 0) { #region 维修表信息 DataRow dr = dt.Rows[0]; if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dr["rescue_no"]))) { labMaintain_noS.Text = CommonCtrl.IsNullToString(dr["rescue_no"]);//救援单号 } else { labMaintain_noS.Text = string.Empty; } string strMakeTime = CommonCtrl.IsNullToString(dr["make_time"]); //制单时间 if (!string.IsNullOrEmpty(strMakeTime)) { labMakeOrderTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strMakeTime)).ToString("yyyy-MM-dd HH:mm"); } else { labMakeOrderTimeS.Text = string.Empty; } labCustomNOS.Text = CommonCtrl.IsNullToString(dr["customer_code"]); //客户编码 labCustomNameS.Text = CommonCtrl.IsNullToString(dr["customer_name"]); //客户名称 labContactS.Text = CommonCtrl.IsNullToString(dr["linkman"]); //联系人 labContactPhoneS.Text = CommonCtrl.IsNullToString(dr["linkman_mobile"]); //联系人电话 labCarNOS.Text = CommonCtrl.IsNullToString(dr["vehicle_no"]); //车牌号 labCarTypeS.Text = GetVmodel(CommonCtrl.IsNullToString(dr["vehicle_model"])); //车型 labCarBrandS.Text = GetDicName(CommonCtrl.IsNullToString(dr["vehicle_brand"])); //车辆品牌 labVINS.Text = CommonCtrl.IsNullToString(dr["vehicle_vin"]); //VIN labturnerS.Text = CommonCtrl.IsNullToString(dr["turner"]); //车厂编码 labEngineNoS.Text = CommonCtrl.IsNullToString(dr["engine_type"]); //发动机号 labDriverS.Text = CommonCtrl.IsNullToString(dr["driver_name"]); //司机 labDriverPhoneS.Text = CommonCtrl.IsNullToString(dr["driver_mobile"]); //司机手机 labMilsS.Text = CommonCtrl.IsNullToString(dr["rescue_mileage"]); //救援里程 labStatusS.Text = DataSources.GetDescription(typeof(DataSources.EnumAuditStatus), int.Parse(CommonCtrl.IsNullToString(dr["document_status"]))); //单据状态 labDepartS.Text = GetDepartmentName(CommonCtrl.IsNullToString(dr["org_name"])); //部门 labAttnS.Text = GetUserSetName(CommonCtrl.IsNullToString(dr["responsible_opid"])); //经办人 labCreatePersonS.Text = CommonCtrl.IsNullToString(dr["create_name"]); //创建人 string strCreateTime = CommonCtrl.IsNullToString(dr["create_time"]); //创建时间 if (!string.IsNullOrEmpty(strCreateTime)) { labCreateTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strCreateTime)).ToString("yyyy-MM-dd HH:mm"); } else { labCreateTimeS.Text = string.Empty; } labFinallyPerS.Text = CommonCtrl.IsNullToString(dr["update_name"]); //最后编辑人 string strFinallyTime = CommonCtrl.IsNullToString(dr["update_time"]); //最后编辑时间 if (!string.IsNullOrEmpty(strFinallyTime)) { labFinallyTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strFinallyTime)).ToString("yyyy-MM-dd HH:mm"); } else { labFinallyTimeS.Text = string.Empty; } strStatus = CommonCtrl.IsNullToString(dr["document_status"]);//单据状态 if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.Balance).ToString()) { //已结算状态屏蔽结算、编辑、删除按钮 base.btnBalance.Enabled = false; base.btnEdit.Enabled = false; base.btnDelete.Enabled = false; base.btnActivation.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString()) { //已审核时屏蔽结算、审核、编辑、删除按钮 base.btnBalance.Enabled = false; base.btnVerify.Enabled = false; base.btnEdit.Enabled = false; base.btnDelete.Enabled = false; base.btnActivation.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString() || strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.DRAFT).ToString()) { //审核没通过时屏蔽审核按钮 base.btnVerify.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.Invalid).ToString()) { base.btnActivation.Caption = "激活"; base.btnBalance.Enabled = false; base.btnVerify.Enabled = false; base.btnEdit.Enabled = false; } #endregion #region 救援信息 labGshkS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["man_hour_sum_money"]), 2); //工时货款 labGsslS.Text = CommonCtrl.IsNullToString(dr["man_hour_tax_rate"]); //工时税率 labGsseS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["man_hour_tax_cost"]), 2); //工时税额 labGssjhjS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["man_hour_sum"]), 2); //工时价税合计 labPjhkS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["fitting_sum_money"]), 2); //配件货款 labPjslS.Text = CommonCtrl.IsNullToString(dr["fitting_tax_rate"]); //配件税率 labPjseS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["fitting_tax_cost"]), 2); //配件税额 labPjsjhjS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["fitting_sum"]), 2); //配件价税合计 labQtflS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["other_item_sum_money"]), 2); //其他项目费用 labQtslS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["other_item_tax_rate"]), 2); //其他项目税率 labQtseS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["other_item_tax_cost"]), 2); //其他项目税额 labQthjS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["other_item_sum"]), 2); //其他项目价税合计 labYH.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["privilege_cost"]), 2); //优惠费用 labShould.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["should_sum"]), 2); //应收总额 labReceive.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["received_sum"]), 2); //实收总额 labDebt.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["debt_cost"]), 2); //欠款金额 labInvoiceType.Text = GetDicName(CommonCtrl.IsNullToString(dr["make_invoice_type"])); //开票类型 labPayment.Text = GetPaymentName(CommonCtrl.IsNullToString(dr["payment_terms"])); //结算方式 labSetAccount.Text = GetSetName(CommonCtrl.IsNullToString(dr["settlement_account"])); //结算账户 labSetCompany.Text = GetComName(CommonCtrl.IsNullToString(dr["settle_company"])); //结算单位 string strStartTime = CommonCtrl.IsNullToString(dr["depart_time"]); //出发时间 if (!string.IsNullOrEmpty(strStartTime)) { labStartTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strStartTime)).ToString("yyyy-MM-dd HH:mm"); } else { labStartTimeS.Text = string.Empty; } string strEndTime = CommonCtrl.IsNullToString(dr["arrive_time"]);//到达时间 if (!string.IsNullOrEmpty(strEndTime)) { labEndTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strEndTime)).ToString("yyyy-MM-dd HH:mm"); } else { labEndTimeS.Text = string.Empty; } string strReturnTime = CommonCtrl.IsNullToString(dr["back_time"]);//返回时间 if (!string.IsNullOrEmpty(strReturnTime)) { labReturnTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strReturnTime)).ToString("yyyy-MM-dd HH:mm"); } else { labReturnTimeS.Text = string.Empty; } labDefaultDescS.Text = CommonCtrl.IsNullToString(dr["fault_describe"]); //故障描述 labRemarkS.Text = CommonCtrl.IsNullToString(dr["remarks"]); //备注 #endregion #endregion #region 底部datagridview数据 #region 维修项目数据 //维修项目数据 decimal dcPmoney = 0; DataTable dpt = DBHelper.GetTable("维修项目数据", "tb_maintain_item", "*", string.Format(" maintain_id='{0}' and enable_flag='" + Convert.ToInt32(DataSources.EnumEnableFlag.USING).ToString() + "'", strRId), "", "");; if (dpt.Rows.Count > 0) { if (dpt.Rows.Count > dgvproject.Rows.Count) { dgvproject.Rows.Add(dpt.Rows.Count - dgvproject.Rows.Count + 1); } for (int i = 0; i < dpt.Rows.Count; i++) { DataRow dpr = dpt.Rows[i]; dgvproject.Rows[i].Cells["item_id"].Value = CommonCtrl.IsNullToString(dpr["item_id"]); dgvproject.Rows[i].Cells["three_warranty"].Value = CommonCtrl.IsNullToString(dpr["three_warranty"]) == "1" ? "是" : "否"; dgvproject.Rows[i].Cells["man_hour_type"].Value = CommonCtrl.IsNullToString(dpr["man_hour_type"]); dgvproject.Rows[i].Cells["item_no"].Value = CommonCtrl.IsNullToString(dpr["item_no"]); dgvproject.Rows[i].Cells["item_name"].Value = CommonCtrl.IsNullToString(dpr["item_name"]); dgvproject.Rows[i].Cells["item_type"].Value = CommonCtrl.IsNullToString(dpr["item_type"]); dgvproject.Rows[i].Cells["man_hour_quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["man_hour_quantity"]), 1); dgvproject.Rows[i].Cells["man_hour_norm_unitprice"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["man_hour_norm_unitprice"]), 2); dgvproject.Rows[i].Cells["remarks"].Value = CommonCtrl.IsNullToString(dpr["remarks"]); dgvproject.Rows[i].Cells["sum_money_goods"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["sum_money_goods"]), 2); dgvproject.Rows[i].Cells["member_discount"].Value = CommonCtrl.IsNullToString(dpr["member_discount"]); dgvproject.Rows[i].Cells["member_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["member_price"]), 2); dgvproject.Rows[i].Cells["member_sum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["member_sum_money"]), 2); } foreach (DataGridViewRow dgvr in dgvproject.Rows) { dcPmoney += Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvr.Cells["sum_money_goods"].Value)) ? dgvr.Cells["sum_money_goods"].Value : 0); } } #endregion #region 维修用料数据 //维修用料数据 decimal dcMmoney = 0; DataTable dmt = DBHelper.GetTable("维修用料数据", "tb_maintain_material_detail", "*", string.Format(" maintain_id='{0}' and enable_flag='" + Convert.ToInt32(DataSources.EnumEnableFlag.USING).ToString() + "'", strRId), "", ""); if (dmt.Rows.Count > 0) { if (dmt.Rows.Count > dgvMaterials.Rows.Count) { dgvMaterials.Rows.Add(dmt.Rows.Count - dgvMaterials.Rows.Count + 1); } for (int i = 0; i < dmt.Rows.Count; i++) { DataRow dmr = dmt.Rows[i]; dgvMaterials.Rows[i].Cells["material_id"].Value = CommonCtrl.IsNullToString(dmr["material_id"]); dgvMaterials.Rows[i].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dmr["parts_code"]); dgvMaterials.Rows[i].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dmr["parts_name"]); dgvMaterials.Rows[i].Cells["norms"].Value = CommonCtrl.IsNullToString(dmr["norms"]); dgvMaterials.Rows[i].Cells["unit"].Value = CommonCtrl.IsNullToString(dmr["unit"]); dgvMaterials.Rows[i].Cells["quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["quantity"]), 1); dgvMaterials.Rows[i].Cells["unit_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["unit_price"]), 2); dgvMaterials.Rows[i].Cells["Mmember_discount"].Value = CommonCtrl.IsNullToString(dmr["member_discount"]); dgvMaterials.Rows[i].Cells["Mmember_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["member_price"]), 2); dgvMaterials.Rows[i].Cells["sum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["sum_money"]), 2); dgvMaterials.Rows[i].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dmr["drawn_no"]); dgvMaterials.Rows[i].Cells["vehicle_brand"].Value = CommonCtrl.IsNullToString(dmr["vehicle_brand"]); dgvMaterials.Rows[i].Cells["Mthree_warranty"].Value = CommonCtrl.IsNullToString(dmr["three_warranty"]) == "1" ? "是" : "否"; dgvMaterials.Rows[i].Cells["Mremarks"].Value = CommonCtrl.IsNullToString(dmr["remarks"]); dgvMaterials.Rows[i].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dmr["whether_imported"]) == "1" ? "是" : "否"; } foreach (DataGridViewRow dgvr in dgvMaterials.Rows) { dcMmoney += Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvr.Cells["sum_money"].Value)) ? dgvr.Cells["sum_money"].Value : 0); } } #endregion #region 其他项目收费数据 //其他项目收费数据 DataTable dot = DBHelper.GetTable("其他项目收费数据", "tb_maintain_other_toll", "*", string.Format(" maintain_id='{0}'", strRId), "", ""); if (dot.Rows.Count > 0) { if (dot.Rows.Count > dgvOther.Rows.Count) { dgvOther.Rows.Add(dot.Rows.Count - dgvOther.Rows.Count + 1); } for (int i = 0; i < dot.Rows.Count; i++) { DataRow dor = dot.Rows[i]; dgvOther.Rows[i].Cells["toll_id"].Value = CommonCtrl.IsNullToString(dor["toll_id"]); dgvOther.Rows[i].Cells["Osum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dor["sum_money"]), 2); dgvOther.Rows[i].Cells["Oremarks"].Value = CommonCtrl.IsNullToString(dor["remarks"]); dgvOther.Rows[i].Cells["cost_types"].Value = GetDicName(CommonCtrl.IsNullToString(dor["cost_types"])); } } #endregion #region 救援人员信息 DataTable drpt = DBHelper.GetTable("救援人员数据", "tb_maintain_rescue_worker", "*", string.Format(" maintain_id='{0}'", strRId), "", ""); if (drpt.Rows.Count > 0) { dgvRescuePerson.DataSource = drpt; } #endregion #region 附件信息数据 //附件信息数据 ucAttr.TableName = "tb_maintain_rescue_info"; ucAttr.TableNameKeyValue = strRId; ucAttr.BindAttachment(); #endregion #endregion } else { #region 没有数据时全部显示为空 labMaintain_noS.Text = string.Empty; labAttnS.Text = string.Empty; labCarBrandS.Text = string.Empty; labCarNOS.Text = string.Empty; labCarTypeS.Text = string.Empty; labContactPhoneS.Text = string.Empty; labContactS.Text = string.Empty; labCreatePersonS.Text = string.Empty; labCreateTimeS.Text = string.Empty; labCustomNameS.Text = string.Empty; labCustomNOS.Text = string.Empty; labDepartS.Text = string.Empty; labDriverPhoneS.Text = string.Empty; labDriverS.Text = string.Empty; labEngineNoS.Text = string.Empty; labFinallyPerS.Text = string.Empty; labFinallyTimeS.Text = string.Empty; labStatusS.Text = string.Empty; labVINS.Text = string.Empty; labRescueTypeS.Text = string.Empty; labServerCarNoS.Text = string.Empty; labStartTimeS.Text = string.Empty; labEndTimeS.Text = string.Empty; labReturnTimeS.Text = string.Empty; labMilsS.Text = string.Empty; labRescuPlaceS.Text = string.Empty; labInvoiceType.Text = string.Empty; labSetAccount.Text = string.Empty; labSetCompany.Text = string.Empty; labDefaultDescS.Text = string.Empty; labRemarkS.Text = string.Empty; #endregion } }
/// <summary> /// 根据预约单Id获取相应的详细信息 /// </summary> /// <param name="strRId">预约单reserv_id值</param> private void GetReservData(string strRId) { #region 基本信息 //SetBtnStatus(WindowStatus.View); DataTable dt = DBHelper.GetTable("维修结算单预览", "tb_maintain_settlement_info a left join tb_maintain_info b on a.maintain_id=b.maintain_id ", "*", string.Format(" a.maintain_id='{0}'", strRId), "", ""); if (dt.Rows.Count > 0) { #region 维修表信息 DataRow dr = dt.Rows[0]; if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dr["maintain_no"]))) { labMaintain_noS.Text = CommonCtrl.IsNullToString(dr["maintain_no"]);//维修单号 } else { labMaintain_noS.Text = string.Empty; } labCustomNOS.Text = CommonCtrl.IsNullToString(dr["customer_code"]); //客户编码 labCustomNameS.Text = CommonCtrl.IsNullToString(dr["customer_name"]); //客户名称 labContactS.Text = CommonCtrl.IsNullToString(dr["linkman"]); //联系人 labContactPhoneS.Text = CommonCtrl.IsNullToString(dr["link_man_mobile"]); //联系人电话 labCarNOS.Text = CommonCtrl.IsNullToString(dr["vehicle_no"]); //车牌号 labCarTypeS.Text = GetVmodel(CommonCtrl.IsNullToString(dr["vehicle_model"])); //车型 labCarBrandS.Text = GetDicName(CommonCtrl.IsNullToString(dr["vehicle_brand"])); //车辆品牌 labVINS.Text = CommonCtrl.IsNullToString(dr["vehicle_vin"]); //VIN labEngineNoS.Text = CommonCtrl.IsNullToString(dr["engine_no"]); //发动机号 labDriverS.Text = CommonCtrl.IsNullToString(dr["driver_name"]); //司机 labDriverPhoneS.Text = CommonCtrl.IsNullToString(dr["driver_mobile"]); //司机手机 labRepTypeS.Text = GetDicName(CommonCtrl.IsNullToString(dr["maintain_type"])); //维修类别 labPayTypeS.Text = GetDicName(CommonCtrl.IsNullToString(dr["maintain_payment"])); //维修付费方式 labMlS.Text = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dr["oil_into_factory"]))?CommonCtrl.IsNullToString(dr["oil_into_factory"]) + "%":""; //进场油量 labMilS.Text = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dr["travel_mileage"]))?CommonCtrl.IsNullToString(dr["travel_mileage"]) + "Km":""; //行驶里程 labYHyyS.Text = CommonCtrl.IsNullToString(dr["favorable_reason"]); //优惠原因 #region 会员信息 string strMemnerID = CommonCtrl.IsNullToString(dr["member_id"]); //会员信息Id if (!string.IsNullOrEmpty(strMemnerID)) { DataTable dct = DBHelper.GetTable("获取会员信息", "tb_customer", "member_number,member_class,accessories_discount,workhours_discount", " is_member='1' and cust_id='" + strMemnerID + "'", "", ""); labMemberNoS.Text = CommonCtrl.IsNullToString(dr["member_number"]); //会员卡号 labMemberGradeS.Text = CommonCtrl.IsNullToString(dr["member_class"]); //会员等级 labMemberPZkS.Text = CommonCtrl.IsNullToString(dr["workhours_discount"]); //会员项目折扣 labMemberLZkS.Text = CommonCtrl.IsNullToString(dr["accessories_discount"]); //会员用料折扣 } else { labMemberNoS.Text = string.Empty; //会员卡号 labMemberGradeS.Text = string.Empty; //会员等级 labMemberPZkS.Text = string.Empty; //会员项目折扣 labMemberLZkS.Text = string.Empty; } #endregion labRemarkS.Text = CommonCtrl.IsNullToString(dr["remark"]); //备注 labStatusS.Text = DataSources.GetDescription(typeof(DataSources.EnumAuditStatus), int.Parse(CommonCtrl.IsNullToString(dr["info_status"]))); //单据状态 //labMoney.Text = CommonCtrl.IsNullToString(dr["maintain_payment"]);//欠款余额 labDepartS.Text = GetDepartmentName(CommonCtrl.IsNullToString(dr["org_name"])); //部门 labAttnS.Text = GetUserSetName(CommonCtrl.IsNullToString(dr["responsible_name"])); //经办人 labCreatePersonS.Text = CommonCtrl.IsNullToString(dr["create_name"]); //创建人 string strCreateTime = CommonCtrl.IsNullToString(dr["create_time"]); //创建时间 if (!string.IsNullOrEmpty(strCreateTime)) { labCreateTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strCreateTime)).ToString("yyyy-MM-dd HH:mm"); } else { labCreateTimeS.Text = string.Empty; } labFinallyPerS.Text = CommonCtrl.IsNullToString(dr["update_name"]); //最后编辑人 string strFinallyTime = CommonCtrl.IsNullToString(dr["update_time"]); //最后编辑时间 if (!string.IsNullOrEmpty(strFinallyTime)) { labFinallyTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strFinallyTime)).ToString("yyyy-MM-dd HH:mm"); } else { labFinallyTimeS.Text = string.Empty; } strStatus = CommonCtrl.IsNullToString(dr["info_status"]);//单据状态 if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.Balance).ToString()) { //已结算状态屏蔽结算、编辑、删除按钮 base.btnBalance.Enabled = false; base.btnEdit.Enabled = false; base.btnDelete.Enabled = false; base.btnActivation.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString()) { //已审核时屏蔽结算、审核、编辑、删除按钮 base.btnBalance.Enabled = false; base.btnVerify.Enabled = false; base.btnEdit.Enabled = false; base.btnDelete.Enabled = false; base.btnActivation.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString() || strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.DRAFT).ToString()) { //审核没通过时屏蔽审核按钮 base.btnVerify.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.Invalid).ToString()) { base.btnActivation.Caption = "激活"; base.btnBalance.Enabled = false; base.btnVerify.Enabled = false; base.btnEdit.Enabled = false; } #endregion #region 结算表信息 labGshkS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["man_hour_sum_money"]), 2); //工时货款 labGsslS.Text = CommonCtrl.IsNullToString(dr["man_hour_tax_rate"]); //工时税率 labGsseS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["man_hour_tax_cost"]), 2); //工时税额 labGssjhjS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["man_hour_sum"]), 2); //工时价税合计 labPjhkS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["fitting_sum_money"]), 2); //配件货款 labPjslS.Text = CommonCtrl.IsNullToString(dr["fitting_tax_rate"]); //配件税率 labPjseS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["fitting_tax_cost"]), 2); //配件税额 labPjsjhjS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["fitting_sum"]), 2); //配件价税合计 labQtflS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["other_item_sum_money"]), 2); //其他项目费用 labQtslS.Text = CommonCtrl.IsNullToString(dr["other_item_tax_rate"]); //其他项目税率 labQtseS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["other_item_tax_cost"]), 2); //其他项目税额 labQthjS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["other_item_sum"]), 2); //其他项目价税合计 labYH.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["privilege_cost"]), 2); //优惠费用 labShould.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["should_sum"]), 2); //应收总额 labReceive.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["received_sum"]), 2); //实收总额 labDebt.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["debt_cost"]), 2); //欠款金额 labInvoiceType.Text = GetDicName(CommonCtrl.IsNullToString(dr["make_invoice_type"])); //开票类型 labPayment.Text = GetPaymentName(CommonCtrl.IsNullToString(dr["payment_terms"])); //结算方式 labSetAccount.Text = GetSetName(CommonCtrl.IsNullToString(dr["settlement_account"])); //结算账户 labSetCompany.Text = GetComName(CommonCtrl.IsNullToString(dr["settle_company"])); //结算单位 string strReTime = CommonCtrl.IsNullToString(dr["create_time"]); //结算时间 if (!string.IsNullOrEmpty(strReTime)) { labBalanceTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strReTime)).ToString("yyyy-MM-dd HH:mm"); } else { labBalanceTimeS.Text = string.Empty; } string strBYTime = CommonCtrl.IsNullToString(dr["maintain_time"]);//建议保养日期 if (!string.IsNullOrEmpty(strBYTime)) { labBYTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strBYTime)).ToString("yyyy-MM-dd HH:mm"); } else { labBYTimeS.Text = string.Empty; } #endregion #endregion #region 底部datagridview数据 #region 维修项目数据 //维修项目数据 decimal dcPmoney = 0; DataTable dpt = DBHelper.GetTable("维修项目数据", "tb_maintain_item", "*", string.Format(" maintain_id='{0}' and enable_flag='" + Convert.ToInt32(DataSources.EnumEnableFlag.USING).ToString() + "'", strRId), "", "");; if (dpt.Rows.Count > 0) { if (dpt.Rows.Count > dgvproject.Rows.Count) { dgvproject.Rows.Add(dpt.Rows.Count - dgvproject.Rows.Count + 1); } for (int i = 0; i < dpt.Rows.Count; i++) { DataRow dpr = dpt.Rows[i]; dgvproject.Rows[i].Cells["item_id"].Value = CommonCtrl.IsNullToString(dpr["item_id"]); dgvproject.Rows[i].Cells["three_warranty"].Value = CommonCtrl.IsNullToString(dpr["three_warranty"]) == "1" ? "是" : "否"; dgvproject.Rows[i].Cells["man_hour_type"].Value = CommonCtrl.IsNullToString(dpr["man_hour_type"]); dgvproject.Rows[i].Cells["item_no"].Value = CommonCtrl.IsNullToString(dpr["item_no"]); dgvproject.Rows[i].Cells["item_name"].Value = CommonCtrl.IsNullToString(dpr["item_name"]); dgvproject.Rows[i].Cells["item_type"].Value = CommonCtrl.IsNullToString(dpr["item_type"]); dgvproject.Rows[i].Cells["man_hour_quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["man_hour_quantity"]), 1); dgvproject.Rows[i].Cells["man_hour_norm_unitprice"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["man_hour_norm_unitprice"]), 2); dgvproject.Rows[i].Cells["remarks"].Value = CommonCtrl.IsNullToString(dpr["remarks"]); dgvproject.Rows[i].Cells["sum_money_goods"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["sum_money_goods"]), 2); dgvproject.Rows[i].Cells["member_discount"].Value = CommonCtrl.IsNullToString(dpr["member_discount"]); dgvproject.Rows[i].Cells["member_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["member_price"]), 2); dgvproject.Rows[i].Cells["member_sum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["member_sum_money"]), 2); } foreach (DataGridViewRow dgvr in dgvproject.Rows) { dcPmoney += Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvr.Cells["sum_money_goods"].Value)) ? dgvr.Cells["sum_money_goods"].Value : 0); } } #endregion #region 维修用料数据 //维修用料数据 decimal dcMmoney = 0; DataTable dmt = DBHelper.GetTable("维修用料数据", "tb_maintain_material_detail", "*", string.Format(" maintain_id='{0}'and enable_flag='" + Convert.ToInt32(DataSources.EnumEnableFlag.USING).ToString() + "'", strRId), "", ""); if (dmt.Rows.Count > 0) { if (dmt.Rows.Count > dgvMaterials.Rows.Count) { dgvMaterials.Rows.Add(dmt.Rows.Count - dgvMaterials.Rows.Count + 1); } for (int i = 0; i < dmt.Rows.Count; i++) { DataRow dmr = dmt.Rows[i]; dgvMaterials.Rows[i].Cells["material_id"].Value = CommonCtrl.IsNullToString(dmr["material_id"]); dgvMaterials.Rows[i].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dmr["parts_code"]); dgvMaterials.Rows[i].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dmr["parts_name"]); dgvMaterials.Rows[i].Cells["norms"].Value = CommonCtrl.IsNullToString(dmr["norms"]); dgvMaterials.Rows[i].Cells["unit"].Value = CommonCtrl.IsNullToString(dmr["unit"]); dgvMaterials.Rows[i].Cells["quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["quantity"]), 1); dgvMaterials.Rows[i].Cells["unit_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["unit_price"]), 2); dgvMaterials.Rows[i].Cells["Mmember_discount"].Value = CommonCtrl.IsNullToString(dmr["member_discount"]); dgvMaterials.Rows[i].Cells["Mmember_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["member_price"]), 2); dgvMaterials.Rows[i].Cells["sum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["sum_money"]), 2); dgvMaterials.Rows[i].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dmr["drawn_no"]); dgvMaterials.Rows[i].Cells["vehicle_brand"].Value = CommonCtrl.IsNullToString(dmr["vehicle_brand"]); dgvMaterials.Rows[i].Cells["Mthree_warranty"].Value = CommonCtrl.IsNullToString(dmr["three_warranty"]) == "1" ? "是" : "否"; dgvMaterials.Rows[i].Cells["Mremarks"].Value = CommonCtrl.IsNullToString(dmr["remarks"]); dgvMaterials.Rows[i].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dmr["whether_imported"]) == "1" ? "是" : "否"; } foreach (DataGridViewRow dgvr in dgvMaterials.Rows) { dcMmoney += Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvr.Cells["sum_money"].Value)) ? dgvr.Cells["sum_money"].Value : 0); } } #endregion #region 其他项目收费数据 //其他项目收费数据 decimal doMmoney = 0; DataTable dot = DBHelper.GetTable("其他项目收费数据", "tb_maintain_other_toll", "*", string.Format(" maintain_id='{0}'", strRId), "", ""); if (dot.Rows.Count > 0) { if (dot.Rows.Count > dgvOther.Rows.Count) { dgvOther.Rows.Add(dot.Rows.Count - dgvOther.Rows.Count + 1); } for (int i = 0; i < dot.Rows.Count; i++) { DataRow dor = dot.Rows[i]; dgvOther.Rows[i].Cells["toll_id"].Value = CommonCtrl.IsNullToString(dor["toll_id"]); dgvOther.Rows[i].Cells["Osum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dor["sum_money"]), 2); dgvOther.Rows[i].Cells["Oremarks"].Value = CommonCtrl.IsNullToString(dor["remarks"]); dgvOther.Rows[i].Cells["cost_types"].Value = GetDicName(CommonCtrl.IsNullToString(dor["cost_types"])); } foreach (DataGridViewRow dgvr in dgvOther.Rows) { doMmoney += Convert.ToDecimal(!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvr.Cells["Osum_money"].Value)) ? dgvr.Cells["Osum_money"].Value : 0); } } #endregion #region 附件信息数据 //附件信息数据 ucAttr.TableName = "tb_maintain_info"; ucAttr.TableNameKeyValue = strRId; ucAttr.BindAttachment(); #endregion #endregion } else { #region 没有数据时全部显示为空 labMaintain_noS.Text = string.Empty; labAttnS.Text = string.Empty; labCarBrandS.Text = string.Empty; labCarNOS.Text = string.Empty; labCarTypeS.Text = string.Empty; labContactPhoneS.Text = string.Empty; labContactS.Text = string.Empty; labCreatePersonS.Text = string.Empty; labCreateTimeS.Text = string.Empty; labCustomNameS.Text = string.Empty; labCustomNOS.Text = string.Empty; labDepartS.Text = string.Empty; labDriverPhoneS.Text = string.Empty; labDriverS.Text = string.Empty; labEngineNoS.Text = string.Empty; labFinallyPerS.Text = string.Empty; labFinallyTimeS.Text = string.Empty; labPayTypeS.Text = string.Empty; labRemarkS.Text = string.Empty; labRepTypeS.Text = string.Empty; labStatusS.Text = string.Empty; labVINS.Text = string.Empty; labMlS.Text = string.Empty; labMilS.Text = string.Empty; labMemberNoS.Text = string.Empty; labMemberGradeS.Text = string.Empty; labMemberPZkS.Text = string.Empty; labMemberLZkS.Text = string.Empty; #endregion } }
/// <summary> /// 根据预约单Id获取相应的详细信息 /// </summary> /// <param name="strRId">预约单reserv_id值</param> private void GetReservData(string strRId) { #region 基本信息 //SetBtnStatus(WindowStatus.View); DataTable dt = DBHelper.GetTable("预约单预览", "tb_maintain_reservation", "*", string.Format(" reserv_id='{0}'", strRId), "", ""); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dr["reservation_no"]))) { labReserveNoS.Text = CommonCtrl.IsNullToString(dr["reservation_no"]);//预约单号 } else { labReserveNoS.Text = string.Empty; } string strReTime = CommonCtrl.IsNullToString(dr["reservation_date"]);//预约日期 if (!string.IsNullOrEmpty(strReTime)) { labReTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strReTime)).ToString("yyyy-MM-dd HH:mm"); } else { labReTimeS.Text = string.Empty; } string strInTime = CommonCtrl.IsNullToString(dr["maintain_time"]);//预约进场日期 if (!string.IsNullOrEmpty(strInTime)) { labInTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strInTime)).ToString("yyyy-MM-dd HH:mm"); } else { labInTimeS.Text = string.Empty; } labRepPersonS.Text = CommonCtrl.IsNullToString(dr["reservation_man"]); //预约人 labRepPersonPhoneS.Text = CommonCtrl.IsNullToString(dr["reservation_mobile"]); //预约人手机 labYesS.Text = CommonCtrl.IsNullToString(dr["whether_greet"]) == "1"?"是":"否"; //是否接车 labAddressS.Text = CommonCtrl.IsNullToString(dr["greet_site"]); //接车地址 labDescS.Text = CommonCtrl.IsNullToString(dr["fault_describe"]); //故障描述 labCustomNOS.Text = CommonCtrl.IsNullToString(dr["customer_code"]); //客户编码 labCustomNameS.Text = CommonCtrl.IsNullToString(dr["customer_name"]); //客户名称 labCarNOS.Text = CommonCtrl.IsNullToString(dr["vehicle_no"]); //车牌号 labCarTypeS.Text = GetVmodel(CommonCtrl.IsNullToString(dr["vehicle_model"])); //车型 labCarBrandS.Text = GetDicName(CommonCtrl.IsNullToString(dr["vehicle_brand"])); //车辆品牌 labVINS.Text = CommonCtrl.IsNullToString(dr["vehicle_vin"]); //VIN labEngineNoS.Text = CommonCtrl.IsNullToString(dr["engine_type"]); //发动机号 labColorS.Text = GetDicName(CommonCtrl.IsNullToString(dr["vehicle_color"])); //颜色 labRepTypeS.Text = GetDicName(CommonCtrl.IsNullToString(dr["maintain_type"])); //维修类别 labPayTypeS.Text = GetDicName(CommonCtrl.IsNullToString(dr["maintain_payment"])); //维修付费方式 labContactS.Text = CommonCtrl.IsNullToString(dr["linkman"]); //联系人 labContactPhoneS.Text = CommonCtrl.IsNullToString(dr["link_man_mobile"]); //联系人手机 labRemarkS.Text = CommonCtrl.IsNullToString(dr["remark"]); //备注 labStatusS.Text = DataSources.GetDescription(typeof(DataSources.EnumAuditStatus), int.Parse(CommonCtrl.IsNullToString(dr["document_status"]))); //单据状态 //labMoney.Text = CommonCtrl.IsNullToString(dr["maintain_payment"]);//欠款余额 labDepartS.Text = GetDepartmentName(CommonCtrl.IsNullToString(dr["org_name"])); //部门 labAttnS.Text = GetUserSetName(CommonCtrl.IsNullToString(dr["responsible_opid"])); //经办人 labCreatePersonS.Text = CommonCtrl.IsNullToString(dr["create_name"]); //创建人 string strCreateTime = CommonCtrl.IsNullToString(dr["create_time"]); //创建时间 if (!string.IsNullOrEmpty(strCreateTime)) { labCreateTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strCreateTime)).ToString("yyyy-MM-dd HH:mm"); } else { labCreateTimeS.Text = string.Empty; } labFinallyPerS.Text = CommonCtrl.IsNullToString(dr["update_name"]); //最后编辑人 string strFinallyTime = CommonCtrl.IsNullToString(dr["update_time"]); //最后编辑时间 if (!string.IsNullOrEmpty(strFinallyTime)) { labFinallyTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strFinallyTime)).ToString("yyyy-MM-dd HH:mm"); } else { labFinallyTimeS.Text = string.Empty; } strStatus = CommonCtrl.IsNullToString(dr["document_status"]);//单据状态 if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.SUBMIT).ToString()) { //已提交状态屏蔽提交、编辑、删除按钮 base.btnSubmit.Enabled = false; base.btnEdit.Enabled = false; base.btnDelete.Enabled = false; base.btnActivation.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString()) { //已审核时屏蔽提交、审核、编辑、删除按钮 base.btnSubmit.Enabled = false; base.btnVerify.Enabled = false; base.btnEdit.Enabled = false; base.btnDelete.Enabled = false; base.btnActivation.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString() || strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.DRAFT).ToString()) { //审核没通过时屏蔽审核按钮 base.btnVerify.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.Invalid).ToString()) { base.btnActivation.Caption = "激活"; base.btnSubmit.Enabled = false; base.btnVerify.Enabled = false; base.btnEdit.Enabled = false; } #endregion #region 底部datagridview数据 #region 维修项目数据 //维修项目数据 DataTable dpt = DBHelper.GetTable("维修项目数据", "tb_maintain_item", "*", string.Format(" maintain_id='{0}' and enable_flag='" + Convert.ToInt32(DataSources.EnumEnableFlag.USING).ToString() + "'", strRId), "", ""); if (dpt.Rows.Count > 0) { if (dpt.Rows.Count > dgvproject.Rows.Count) { dgvproject.Rows.Add(dpt.Rows.Count - dgvproject.Rows.Count + 1); } for (int i = 0; i < dpt.Rows.Count; i++) { DataRow dpr = dpt.Rows[i]; dgvproject.Rows[i].Cells["item_id"].Value = CommonCtrl.IsNullToString(dpr["item_id"]); dgvproject.Rows[i].Cells["three_warranty"].Value = CommonCtrl.IsNullToString(dpr["three_warranty"]) == "1" ? "是" : "否"; dgvproject.Rows[i].Cells["man_hour_type"].Value = CommonCtrl.IsNullToString(dpr["man_hour_type"]); dgvproject.Rows[i].Cells["item_no"].Value = CommonCtrl.IsNullToString(dpr["item_no"]); dgvproject.Rows[i].Cells["item_name"].Value = CommonCtrl.IsNullToString(dpr["item_name"]); dgvproject.Rows[i].Cells["item_type"].Value = CommonCtrl.IsNullToString(dpr["item_type"]); dgvproject.Rows[i].Cells["man_hour_quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["man_hour_quantity"]), 1); dgvproject.Rows[i].Cells["man_hour_norm_unitprice"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["man_hour_norm_unitprice"]), 2); dgvproject.Rows[i].Cells["remarks"].Value = CommonCtrl.IsNullToString(dpr["remarks"]); dgvproject.Rows[i].Cells["sum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["sum_money"]), 2); } } #endregion #region 维修用料数据 //维修用料数据 DataTable dmt = DBHelper.GetTable("维修用料数据", "tb_maintain_material_detail", "*", string.Format(" maintain_id='{0}' and enable_flag='" + Convert.ToInt32(DataSources.EnumEnableFlag.USING).ToString() + "'", strRId), "", ""); if (dmt.Rows.Count > 0) { if (dmt.Rows.Count > dgvMaterials.Rows.Count) { dgvMaterials.Rows.Add(dmt.Rows.Count - dgvMaterials.Rows.Count + 1); } for (int i = 0; i < dmt.Rows.Count; i++) { DataRow dmr = dmt.Rows[i]; dgvMaterials.Rows[i].Cells["material_id"].Value = CommonCtrl.IsNullToString(dmr["material_id"]); dgvMaterials.Rows[i].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dmr["parts_code"]); dgvMaterials.Rows[i].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dmr["parts_name"]); dgvMaterials.Rows[i].Cells["norms"].Value = CommonCtrl.IsNullToString(dmr["norms"]); dgvMaterials.Rows[i].Cells["unit"].Value = CommonCtrl.IsNullToString(dmr["unit"]); dgvMaterials.Rows[i].Cells["quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["quantity"]), 1); dgvMaterials.Rows[i].Cells["unit_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["unit_price"]), 2); dgvMaterials.Rows[i].Cells["Msum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["sum_money"]), 2); dgvMaterials.Rows[i].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dmr["drawn_no"]); dgvMaterials.Rows[i].Cells["vehicle_model"].Value = CommonCtrl.IsNullToString(dmr["vehicle_model"]); dgvMaterials.Rows[i].Cells["Mthree_warranty"].Value = CommonCtrl.IsNullToString(dmr["three_warranty"]) == "1" ? "是" : "否"; dgvMaterials.Rows[i].Cells["Mremarks"].Value = CommonCtrl.IsNullToString(dmr["remarks"]); dgvMaterials.Rows[i].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dmr["whether_imported"]) == "1" ? "是" : "否"; } } #endregion #endregion } else { #region 置空 labAddressS.Text = string.Empty; labAttnS.Text = string.Empty; labCarBrandS.Text = string.Empty; labCarNOS.Text = string.Empty; labCarTypeS.Text = string.Empty; labColorS.Text = string.Empty; labContactPhoneS.Text = string.Empty; labContactS.Text = string.Empty; labCreatePersonS.Text = string.Empty; labCreateTimeS.Text = string.Empty; labCustomNameS.Text = string.Empty; labCustomNOS.Text = string.Empty; labDepartS.Text = string.Empty; labDescS.Text = string.Empty; labMoney.Text = "0.00"; labEngineNoS.Text = string.Empty; labFinallyPerS.Text = string.Empty; labFinallyTimeS.Text = string.Empty; labInTimeS.Text = string.Empty; labPayTypeS.Text = string.Empty; labRemarkS.Text = string.Empty; labRepPersonPhoneS.Text = string.Empty; labRepPersonS.Text = string.Empty; labRepTypeS.Text = string.Empty; labReserveNoS.Text = string.Empty; labReTimeS.Text = string.Empty; labStatusS.Text = string.Empty; labVINS.Text = string.Empty; labYesS.Text = string.Empty; #endregion } }
private void GetRepairInfo() { DataTable dt = DBHelper.GetTable("维修单详情", "tb_maintain_info a left join tb_maintain_settlement_info b on a.maintain_id=b.maintain_id ", "*", string.Format(" a.maintain_id='{0}'", strRepairId), "", ""); if (dt.Rows.Count > 0) { #region 基本信息 DataRow dr = dt.Rows[0]; labMaintain_noS.Text = CommonCtrl.IsNullToString(dr["maintain_no"]); //维修单号 string strReTime = CommonCtrl.IsNullToString(dr["reception_time"]); //接待时间 if (!string.IsNullOrEmpty(strReTime)) { labRTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strReTime)).ToString("yyyy-MM-dd HH:mm"); } else { labRTimeS.Text = string.Empty; } labCustomNOS.Text = CommonCtrl.IsNullToString(dr["customer_code"]); //客户编码 labCustomNameS.Text = CommonCtrl.IsNullToString(dr["customer_name"]); //客户名称 labContactS.Text = CommonCtrl.IsNullToString(dr["linkman"]); //联系人 labContactPhoneS.Text = CommonCtrl.IsNullToString(dr["link_man_mobile"]); //联系人电话 labCarNOS.Text = CommonCtrl.IsNullToString(dr["vehicle_no"]); //车牌号 labCarTypeS.Text = GetDicName(CommonCtrl.IsNullToString(dr["vehicle_model"])); //车型 labCarBrandS.Text = GetDicName(CommonCtrl.IsNullToString(dr["vehicle_brand"])); //车辆品牌 labVINS.Text = CommonCtrl.IsNullToString(dr["vehicle_vin"]); //VIN labEngineNoS.Text = CommonCtrl.IsNullToString(dr["engine_no"]); //发动机号 labColorS.Text = GetDicName(CommonCtrl.IsNullToString(dr["vehicle_color"])); //颜色 labDriverS.Text = CommonCtrl.IsNullToString(dr["driver_name"]); //司机 labDriverPhoneS.Text = CommonCtrl.IsNullToString(dr["driver_mobile"]); //司机手机 labRepTypeS.Text = GetDicName(CommonCtrl.IsNullToString(dr["maintain_type"])); //维修类别 labPayTypeS.Text = GetDicName(CommonCtrl.IsNullToString(dr["maintain_payment"])); //维修付费方式 labMlS.Text = CommonCtrl.IsNullToString(dr["oil_into_factory"]); //进场油量 labMilS.Text = CommonCtrl.IsNullToString(dr["travel_mileage"]); //行驶里程 labDescS.Text = CommonCtrl.IsNullToString(dr["fault_describe"]); //故障描述 labRemarkS.Text = CommonCtrl.IsNullToString(dr["remark"]); //备注 if (CommonCtrl.IsNullToString(dr["orders_source"]) == "3") { labStatusS.Text = "维修单结算" + DataSources.GetDescription(typeof(DataSources.EnumAuditStatus), int.Parse(CommonCtrl.IsNullToString(dr["info_status"])));; } else { if (CommonCtrl.IsNullToString(dr["info_status"]) != Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString()) { labStatusS.Text = "接待" + DataSources.GetDescription(typeof(DataSources.EnumAuditStatus), int.Parse(CommonCtrl.IsNullToString(dr["info_status"]))); } else { labStatusS.Text = DataSources.GetDescription(typeof(DataSources.EnumDispatchStatus), int.Parse(CommonCtrl.IsNullToString(dr["dispatch_status"])));//单据状态 } } labDepartS.Text = GetDepartmentName(CommonCtrl.IsNullToString(dr["org_name"])); //部门 labAttnS.Text = GetUserSetName(CommonCtrl.IsNullToString(dr["responsible_name"])); //经办人 labCreatePersonS.Text = CommonCtrl.IsNullToString(dr["create_name"]); //创建人 string strCreateTime = CommonCtrl.IsNullToString(dr["create_time"]); //创建时间 if (!string.IsNullOrEmpty(strCreateTime)) { labCreateTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strCreateTime)).ToString("yyyy-MM-dd HH:mm"); } else { labCreateTimeS.Text = string.Empty; } labFinallyPerS.Text = CommonCtrl.IsNullToString(dr["update_name"]); //最后编辑人 string strFinallyTime = CommonCtrl.IsNullToString(dr["update_time"]); //最后编辑时间 if (!string.IsNullOrEmpty(strFinallyTime)) { labFinallyTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strFinallyTime)).ToString("yyyy-MM-dd HH:mm"); } else { labFinallyTimeS.Text = string.Empty; } labmaintain_manS.Text = CommonCtrl.IsNullToString(dr["maintain_man"]);//服务顾问 #region 会员信息 string strMemnerID = CommonCtrl.IsNullToString(dr["member_id"]);//会员信息Id if (!string.IsNullOrEmpty(strMemnerID)) { DataTable dct = DBHelper.GetTable("获取会员信息", "tb_customer", "member_number,member_class,accessories_discount,workhours_discount", " is_member='1' and cust_id='" + strMemnerID + "'", "", ""); labMemberNoS.Text = CommonCtrl.IsNullToString(dr["member_number"]); //会员卡号 labMemberGradeS.Text = CommonCtrl.IsNullToString(dr["member_class"]); //会员等级 labMemberPZkS.Text = CommonCtrl.IsNullToString(dr["workhours_discount"]); //会员项目折扣 labMemberLZkS.Text = CommonCtrl.IsNullToString(dr["accessories_discount"]); //会员用料折扣 } else { labMemberNoS.Text = string.Empty; //会员卡号 labMemberGradeS.Text = string.Empty; //会员等级 labMemberPZkS.Text = string.Empty; //会员项目折扣 labMemberLZkS.Text = string.Empty; } #endregion labGshkS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["man_hour_sum_money"]), 2); //工时货款 labGsslS.Text = CommonCtrl.IsNullToString(dr["man_hour_tax_rate"]); //工时税率 labGsseS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["man_hour_tax_rate"]), 2); //工时税额 labGssjhjS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["man_hour_sum"]), 2); //工时税价合计 labPjhkS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["fitting_sum_money"]), 2); //配件货款 labPjslS.Text = CommonCtrl.IsNullToString(dr["fitting_tax_rate"]); //配件税率 labPjseS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["fitting_tax_cost"]), 2); //配件税额 labPjsjhjS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["fitting_sum"]), 2); //配件税价合计 labQtflS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["other_item_sum_money"]), 2); //其他项目费用 QtslS.Text = CommonCtrl.IsNullToString(dr["other_item_tax_rate"]); //其他项目税率 labQtseS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["other_item_tax_cost"]), 2); //其他项目税额 labQthjS.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["other_item_sum"]), 2); //其他项目价税合计 labYH.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["privilege_cost"]), 2); //优惠费用 labShould.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["should_sum"]), 2); //应收总额 labReceive.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["received_sum"]), 2); //实收总额 labDebt.Text = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dr["debt_cost"]), 2); //欠款金额 labInvoiceType.Text = CommonCtrl.IsNullToString(dr["make_invoice_type"]); //开票类型 labPayment.Text = CommonCtrl.IsNullToString(dr["payment_terms"]); //结算方式 labSetAccount.Text = CommonCtrl.IsNullToString(dr["settlement_account"]); //结算账户 labSetCompany.Text = CommonCtrl.IsNullToString(dr["settle_company"]); //结算单位 #endregion #region 底部datagridview数据 #region 维修项目数据 //维修项目数据 decimal dcPmoney = 0; DataTable dpt = DBHelper.GetTable("维修项目数据", "tb_maintain_item", "*", string.Format(" maintain_id='{0}'", strRepairId), "", "");; if (dpt.Rows.Count > 0) { if (dpt.Rows.Count > dgvproject.Rows.Count) { dgvproject.Rows.Add(dpt.Rows.Count - dgvproject.Rows.Count + 1); } for (int i = 0; i < dpt.Rows.Count; i++) { DataRow dpr = dpt.Rows[i]; dgvproject.Rows[i].Cells["item_id"].Value = CommonCtrl.IsNullToString(dpr["item_id"]); dgvproject.Rows[i].Cells["three_warranty"].Value = CommonCtrl.IsNullToString(dpr["three_warranty"]) == "1" ? "是" : "否"; dgvproject.Rows[i].Cells["man_hour_type"].Value = CommonCtrl.IsNullToString(dpr["man_hour_type"]); dgvproject.Rows[i].Cells["item_no"].Value = CommonCtrl.IsNullToString(dpr["item_no"]); dgvproject.Rows[i].Cells["item_name"].Value = CommonCtrl.IsNullToString(dpr["item_name"]); dgvproject.Rows[i].Cells["item_type"].Value = CommonCtrl.IsNullToString(dpr["item_type"]); dgvproject.Rows[i].Cells["man_hour_quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["man_hour_quantity"]), 1); dgvproject.Rows[i].Cells["man_hour_norm_unitprice"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["man_hour_norm_unitprice"]), 2); dgvproject.Rows[i].Cells["remarks"].Value = CommonCtrl.IsNullToString(dpr["remarks"]); dgvproject.Rows[i].Cells["sum_money_goods"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["sum_money_goods"]), 2); dgvproject.Rows[i].Cells["member_discount"].Value = CommonCtrl.IsNullToString(dpr["member_discount"]); dgvproject.Rows[i].Cells["member_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["member_price"]), 2); dgvproject.Rows[i].Cells["member_sum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["member_sum_money"]), 2); } } #endregion #region 维修用料数据 //维修用料数据 decimal dcMmoney = 0; DataTable dmt = DBHelper.GetTable("维修用料数据", "tb_maintain_material_detail", "*", string.Format(" maintain_id='{0}'", strRepairId), "", ""); if (dmt.Rows.Count > 0) { if (dmt.Rows.Count > dgvMaterials.Rows.Count) { dgvMaterials.Rows.Add(dmt.Rows.Count - dgvMaterials.Rows.Count + 1); } for (int i = 0; i < dmt.Rows.Count; i++) { DataRow dmr = dmt.Rows[i]; dgvMaterials.Rows[i].Cells["material_id"].Value = CommonCtrl.IsNullToString(dmr["material_id"]); dgvMaterials.Rows[i].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dmr["parts_code"]); dgvMaterials.Rows[i].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dmr["parts_name"]); dgvMaterials.Rows[i].Cells["norms"].Value = CommonCtrl.IsNullToString(dmr["norms"]); dgvMaterials.Rows[i].Cells["unit"].Value = CommonCtrl.IsNullToString(dmr["unit"]); dgvMaterials.Rows[i].Cells["quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["quantity"]), 1); dgvMaterials.Rows[i].Cells["unit_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["unit_price"]), 2); dgvMaterials.Rows[i].Cells["Mmember_discount"].Value = CommonCtrl.IsNullToString(dmr["member_discount"]); dgvMaterials.Rows[i].Cells["Mmember_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["member_price"]), 2); dgvMaterials.Rows[i].Cells["sum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["sum_money"]), 2); dgvMaterials.Rows[i].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dmr["drawn_no"]); dgvMaterials.Rows[i].Cells["vehicle_brand"].Value = CommonCtrl.IsNullToString(dmr["vehicle_brand"]); dgvMaterials.Rows[i].Cells["Mthree_warranty"].Value = CommonCtrl.IsNullToString(dmr["three_warranty"]) == "1" ? "是" : "否"; dgvMaterials.Rows[i].Cells["Mremarks"].Value = CommonCtrl.IsNullToString(dmr["remarks"]); dgvMaterials.Rows[i].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dmr["whether_imported"]) == "1" ? "是" : "否"; } } #endregion #region 其他项目收费数据 //其他项目收费数据 decimal doMmoney = 0; DataTable dot = DBHelper.GetTable("其他项目收费数据", "tb_maintain_other_toll", "*", string.Format(" maintain_id='{0}'", strRepairId), "", ""); if (dot.Rows.Count > 0) { if (dot.Rows.Count > dgvOther.Rows.Count) { dgvOther.Rows.Add(dot.Rows.Count - dgvOther.Rows.Count + 1); } for (int i = 0; i < dot.Rows.Count; i++) { DataRow dor = dot.Rows[i]; dgvOther.Rows[i].Cells["toll_id"].Value = CommonCtrl.IsNullToString(dor["toll_id"]); dgvOther.Rows[i].Cells["Osum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dor["sum_money"]), 2); dgvOther.Rows[i].Cells["Oremarks"].Value = CommonCtrl.IsNullToString(dor["remarks"]); dgvOther.Rows[i].Cells["cost_types"].Value = GetDicName(CommonCtrl.IsNullToString(dor["cost_types"])); } } #endregion #region 附件信息数据 //附件信息数据 ucAttr.TableName = "tb_maintain_info"; ucAttr.TableNameKeyValue = strRepairId; ucAttr.BindAttachment(); #endregion #endregion } }
public void Initialize(ControlsConfig controlsConfig) { _controlsConfig = controlsConfig; }
/// <summary> /// 根据预约单Id获取相应的详细信息 /// </summary> /// <param name="strRId">预约单reserv_id值</param> private void GetReservData(string strRId) { #region 基本信息 //SetBtnStatus(WindowStatus.View); DataTable dt = DBHelper.GetTable("维修返修单预览", "tb_maintain_back_repair", "*", string.Format(" repair_id='{0}'", strRId), "", ""); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; if (!string.IsNullOrEmpty(CommonCtrl.IsNullToString(dr["repair_no"]))) { labMaintain_noS.Text = CommonCtrl.IsNullToString(dr["repair_no"]);//返修单号 } else { labMaintain_noS.Text = string.Empty; } string strReTime = CommonCtrl.IsNullToString(dr["reception_time"]);//接待日期 if (!string.IsNullOrEmpty(strReTime)) { labReceptionTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strReTime)).ToString("yyyy-MM-dd HH:mm"); } else { labReceptionTimeS.Text = string.Empty; } labCustomNOS.Text = CommonCtrl.IsNullToString(dr["customer_code"]); //客户编码 labCustomNameS.Text = CommonCtrl.IsNullToString(dr["customer_name"]); //客户名称 labCarNOS.Text = CommonCtrl.IsNullToString(dr["vehicle_no"]); //车牌号 labCarTypeS.Text = GetVmodel(CommonCtrl.IsNullToString(dr["vehicle_model"])); //车型 labCarBrandS.Text = GetDicName(CommonCtrl.IsNullToString(dr["vehicle_brand"])); //车辆品牌 labVINS.Text = CommonCtrl.IsNullToString(dr["vehicle_vin"]); //VIN labEngineNoS.Text = CommonCtrl.IsNullToString(dr["engine_type"]); //发动机号 labturnerS.Text = CommonCtrl.IsNullToString(dr["turner"]); //车厂编码 labContactS.Text = CommonCtrl.IsNullToString(dr["linkman"]); //联系人 labContactPhoneS.Text = CommonCtrl.IsNullToString(dr["linkman_mobile"]); //联系人手机 labOrderStatusS.Text = DataSources.GetDescription(typeof(DataSources.EnumAuditStatus), int.Parse(CommonCtrl.IsNullToString(dr["document_status"]))); //单据状态 labBlamePersonS.Text = CommonCtrl.IsNullToString(dr["repairer_name"]); //返修负责人 labMilS.Text = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dr["mileage"]))?CommonCtrl.IsNullToString(dr["mileage"]) + "Km":""; //行驶里程 labSendPersonS.Text = CommonCtrl.IsNullToString(dr["driver_name"]); //报修人 labSendPhoneS.Text = CommonCtrl.IsNullToString(dr["driver_mobile"]); //报修人手机 labRepairDescS.Text = CommonCtrl.IsNullToString(dr["repair_describe"]); //故障原因 labOpinionS.Text = CommonCtrl.IsNullToString(dr["dispose_opinion"]); //处理意见 labResultS.Text = CommonCtrl.IsNullToString(dr["dispose_result"]); //处理结果 labDepartS.Text = GetDepartmentName(CommonCtrl.IsNullToString(dr["org_id"])); //部门 labAttnS.Text = GetUserSetName(CommonCtrl.IsNullToString(dr["responsible_opid"])); //经办人 labCreatePersonS.Text = CommonCtrl.IsNullToString(dr["create_name"]); //创建人 string strCreateTime = CommonCtrl.IsNullToString(dr["create_time"]); //创建时间 if (!string.IsNullOrEmpty(strCreateTime)) { labCreateTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strCreateTime)).ToString("yyyy-MM-dd HH:mm"); } else { labCreateTimeS.Text = string.Empty; } labFinallyPerS.Text = CommonCtrl.IsNullToString(dr["update_name"]); //最后编辑人 string strFinallyTime = CommonCtrl.IsNullToString(dr["update_time"]); //最后编辑时间 if (!string.IsNullOrEmpty(strFinallyTime)) { labFinallyTimeS.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(strFinallyTime)).ToString("yyyy-MM-dd HH:mm"); } else { labFinallyTimeS.Text = string.Empty; } string strStatus = CommonCtrl.IsNullToString(dr["document_status"]);//单据状态 if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.SUBMIT).ToString()) { //已提交状态屏蔽提交、编辑、删除按钮 base.btnSubmit.Enabled = false; base.btnEdit.Enabled = false; base.btnDelete.Enabled = false; base.btnActivation.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString()) { //已审核时屏蔽提交、审核、编辑、删除按钮 base.btnSubmit.Enabled = false; base.btnVerify.Enabled = false; base.btnEdit.Enabled = false; base.btnDelete.Enabled = false; base.btnActivation.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString() || strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.DRAFT).ToString()) { //审核没通过时屏蔽审核按钮 base.btnVerify.Enabled = false; } else if (strStatus == Convert.ToInt32(DataSources.EnumAuditStatus.Invalid).ToString()) { base.btnActivation.Caption = "激活"; base.btnSubmit.Enabled = false; base.btnVerify.Enabled = false; base.btnEdit.Enabled = false; } #endregion #region 底部datagridview数据 #region 维修项目数据 //维修项目数据 DataTable dpt = DBHelper.GetTable("维修项目数据", "tb_maintain_item", "*", string.Format(" maintain_id='{0}' and enable_flag='" + Convert.ToInt32(DataSources.EnumEnableFlag.USING).ToString() + "'", strRId), "", ""); if (dpt.Rows.Count > 0) { if (dpt.Rows.Count > dgvproject.Rows.Count) { dgvproject.Rows.Add(dpt.Rows.Count - dgvproject.Rows.Count + 1); } for (int i = 0; i < dpt.Rows.Count; i++) { DataRow dpr = dpt.Rows[i]; dgvproject.Rows[i].Cells["item_id"].Value = CommonCtrl.IsNullToString(dpr["item_id"]); dgvproject.Rows[i].Cells["three_warranty"].Value = CommonCtrl.IsNullToString(dpr["three_warranty"]) == "1" ? "是" : "否"; dgvproject.Rows[i].Cells["man_hour_type"].Value = CommonCtrl.IsNullToString(dpr["man_hour_type"]); dgvproject.Rows[i].Cells["item_no"].Value = CommonCtrl.IsNullToString(dpr["item_no"]); dgvproject.Rows[i].Cells["item_name"].Value = CommonCtrl.IsNullToString(dpr["item_name"]); dgvproject.Rows[i].Cells["item_type"].Value = CommonCtrl.IsNullToString(dpr["item_type"]); dgvproject.Rows[i].Cells["man_hour_quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["man_hour_quantity"]), 1); dgvproject.Rows[i].Cells["man_hour_norm_unitprice"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["man_hour_norm_unitprice"]), 2); dgvproject.Rows[i].Cells["remarks"].Value = CommonCtrl.IsNullToString(dpr["remarks"]); dgvproject.Rows[i].Cells["sum_money_goods"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dpr["sum_money_goods"]), 2); } } #endregion #region 维修用料数据 //维修用料数据 DataTable dmt = DBHelper.GetTable("维修用料数据", "tb_maintain_material_detail", "*", string.Format(" maintain_id='{0}' and enable_flag='" + Convert.ToInt32(DataSources.EnumEnableFlag.USING).ToString() + "'", strRId), "", ""); if (dmt.Rows.Count > 0) { if (dmt.Rows.Count > dgvMaterials.Rows.Count) { dgvMaterials.Rows.Add(dmt.Rows.Count - dgvMaterials.Rows.Count + 1); } for (int i = 0; i < dmt.Rows.Count; i++) { DataRow dmr = dmt.Rows[i]; dgvMaterials.Rows[i].Cells["material_id"].Value = CommonCtrl.IsNullToString(dmr["material_id"]); dgvMaterials.Rows[i].Cells["parts_code"].Value = CommonCtrl.IsNullToString(dmr["parts_code"]); dgvMaterials.Rows[i].Cells["parts_name"].Value = CommonCtrl.IsNullToString(dmr["parts_name"]); dgvMaterials.Rows[i].Cells["norms"].Value = CommonCtrl.IsNullToString(dmr["norms"]); dgvMaterials.Rows[i].Cells["unit"].Value = CommonCtrl.IsNullToString(dmr["unit"]); dgvMaterials.Rows[i].Cells["quantity"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["quantity"]), 1); dgvMaterials.Rows[i].Cells["unit_price"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["unit_price"]), 2); dgvMaterials.Rows[i].Cells["sum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dmr["sum_money"]), 2); dgvMaterials.Rows[i].Cells["drawn_no"].Value = CommonCtrl.IsNullToString(dmr["drawn_no"]); //dgvMaterials.Rows[i].Cells["vehicle_model"].Value = CommonCtrl.IsNullToString(dmr["vehicle_model"]); dgvMaterials.Rows[i].Cells["Mthree_warranty"].Value = CommonCtrl.IsNullToString(dmr["three_warranty"]) == "1" ? "是" : "否"; dgvMaterials.Rows[i].Cells["Mremarks"].Value = CommonCtrl.IsNullToString(dmr["remarks"]); dgvMaterials.Rows[i].Cells["whether_imported"].Value = CommonCtrl.IsNullToString(dmr["whether_imported"]) == "1" ? "是" : "否"; } } #endregion #region 其他项目收费数据 ////其他项目收费数据 DataTable dot = DBHelper.GetTable("其他项目收费数据", "tb_maintain_other_toll", "*", string.Format(" maintain_id='{0}'", strRId), "", ""); if (dot.Rows.Count > 0) { if (dot.Rows.Count > dgvOther.Rows.Count) { dgvOther.Rows.Add(dot.Rows.Count - dgvOther.Rows.Count + 1); } for (int i = 0; i < dot.Rows.Count; i++) { DataRow dor = dot.Rows[i]; dgvOther.Rows[i].Cells["toll_id"].Value = CommonCtrl.IsNullToString(dor["toll_id"]); dgvOther.Rows[i].Cells["Osum_money"].Value = ControlsConfig.SetNewValue(CommonCtrl.IsNullToString(dor["sum_money"]), 2); dgvOther.Rows[i].Cells["Oremarks"].Value = CommonCtrl.IsNullToString(dor["remarks"]); dgvOther.Rows[i].Cells["cost_types"].Value = GetDicName(CommonCtrl.IsNullToString(dor["cost_types"])); } } #endregion //附件信息数据 ucAttr.TableName = "tb_maintain_back_repair"; ucAttr.TableNameKeyValue = strRId; ucAttr.BindAttachment(); #endregion } else { #region labAttnS.Text = string.Empty; labCarBrandS.Text = string.Empty; labCarNOS.Text = string.Empty; labCarTypeS.Text = string.Empty; labturnerS.Text = string.Empty; labContactPhoneS.Text = string.Empty; labContactS.Text = string.Empty; labCreatePersonS.Text = string.Empty; labCreateTimeS.Text = string.Empty; labCustomNameS.Text = string.Empty; labCustomNOS.Text = string.Empty; labDepartS.Text = string.Empty; labEngineNoS.Text = string.Empty; labFinallyPerS.Text = string.Empty; labFinallyTimeS.Text = string.Empty; labVINS.Text = string.Empty; labBlamePersonS.Text = string.Empty; //返修负责人 labMilS.Text = string.Empty; //进站里程 labSendPersonS.Text = string.Empty; //送车人 labSendPhoneS.Text = string.Empty; //送车人手机 labRepairDescS.Text = string.Empty; //故障原因 labOpinionS.Text = string.Empty; //处理意见 labResultS.Text = string.Empty; //处理结果 #endregion } }
private void Awake() { _config = new ControlsConfig(); _config.Gameplay.SetCallbacks(this); }