//领料人选择 private void txtcPickingPeople_ChooserClick(object sender, EventArgs e) { frmUsers users = new frmUsers(); if (users.ShowDialog() == DialogResult.OK) { txtcPickingPeople.Text = users.User_Name; } }
private void txtcreate_by_ChooserClick(object sender, EventArgs e) { frmUsers frm = new frmUsers(); DialogResult result = frm.ShowDialog(); if (result == DialogResult.OK) { txtcreate_by.Text = frm.User_Name; txtcreate_by.Tag = frm.User_ID; } }
private void txtcreate_by_ChooserClick(object sender, EventArgs e) { try { frmUsers frm = new frmUsers(); DialogResult result = frm.ShowDialog(); if (result == DialogResult.OK) { txtcreate_by.Text = frm.User_Name; txtcreate_by.Tag = frm.User_ID; } } catch (Exception ex) { Utility.Log.Log.writeLineToLog("【字典码表】" + ex.Message, "client"); MessageBoxEx.ShowWarning("操作失败!"); } }
private void InitControlDataSource() //初始化数据字段控件数据 { try { #region 设置控件验证值 txt_repairer_mobile.VerifyTypeName = txt_link_man_mobile.VerifyTypeName = "Phone"; txt_repairer_mobile.ShowError = txt_link_man_mobile.ShowError = true; txt_customer_postcode.VerifyTypeName = "Postcode"; txt_customer_postcode.ShowError = true; txt_feedback_num.VerifyTypeName = "Integer"; txt_feedback_num.ShowError = true; txt_other_money.VerifyTypeName = txt_man_hour_subsidy.VerifyTypeName = txt_ccf.VerifyTypeName = txt_journey_subsidy.VerifyTypeName = txt_maintain_mileage.VerifyTypeName = txt_travel_mileage.VerifyTypeName = "UFloat"; txt_other_money.ShowError = txt_man_hour_subsidy.ShowError = txt_ccf.ShowError = txt_journey_subsidy.ShowError = txt_maintain_mileage.ShowError = txt_travel_mileage.ShowError = true; #endregion dtp_goout_back_time.Value = dtp_goout_time.Value = dtp_maintain_time.Value = dtp_parts_buy_time.Value = dtp_repairs_time.Value = dtp_start_work_time.Value = dtp_complete_work_time.Value = DBHelper.GetCurrentTime(); dgv_tb_maintain_three_guaranty_accessory.TableName = "tb_maintain_three_guaranty"; dgv_tb_maintain_three_guaranty_accessory.TableNameKeyValue = TgId; #region 基础数据 var isSecondStation = DBHelper.GetSingleValue("根据公司编码获取是否为二级站", GlobalStaticObj.CommAccCode, "tb_company", "category", "sap_code = '" + GlobalStaticObj.ServerStationCode+ "'", ""); if (!String.IsNullOrEmpty(isSecondStation)) { chk_whether_second_station_true.Checked = isSecondStation == "1"; //一级站 chk_whether_second_station_false.Checked = isSecondStation == "2"; //二级站 } txt_service_station_code.Text = GlobalStaticObj.ServerStationCode; //当前服务站代码 txt_service_station_name.Caption = GlobalStaticObj.ServerStationName; //当前服务站名称 dtp_repairs_time.Value = DateTime.Now; //报修日期(系统默认当前时间) //txt_service_station_code.ChooserClick += delegate //服务站选择器 //{ // var signInfoChooser = new FormSignInfoChooser(); // var result = signInfoChooser.ShowDialog(); // if (result != DialogResult.OK) return; // txt_service_station_code.Text = signInfoChooser.SignCode; // txt_service_station_code.Tag = signInfoChooser.SignId; // txt_service_station_name.Caption = signInfoChooser.SignName; //}; CommonCtrl.CmbBindDict(cbo_receipt_type, "bill_type_yt", false); //宇通单据类型 CommonCtrl.CmbBindDict(cbo_cost_type_service_zczg, "cost_type_care_policy_yt", false); //费用类型(政策照顾) CommonCtrl.BindComboBoxByTable(cbo_product_notice_no, "tb_product_no", "service_code", "activities", false); //产品改进通知 CommonCtrl.CmbBindDict(cbo_whether_go_out, "sys_true_false", false); //是否外出 cbo_whether_go_out.SelectedValue = DbDic2Enum.FALSE; //是否外出(默认选择为否) CommonCtrl.CmbBindDict(cbo_refit_case, "refit_case", false); //改装情况 cbo_refit_case.SelectedValue = DbDic2Enum.REFIT_CASE_FALSE; //改装请款(默认选择为无改装) DataSources.BindComBoxDataEnum(cbo_promise_guarantee, typeof(DataSources.EnumYesNo), false); //特殊约定质保 cbo_promise_guarantee.SelectedValue = DataSources.EnumYesNo.NO; //特殊约定质保(默认选择为否) UIAssistants.BindingServiceStationUser(cbo_approver_name_yt, true, "请选择"); txt_appraiser_name.ChooserClick += delegate //鉴定人选择器 { var chooser = new frmUsers{ cbo_data_source = { SelectedValue = "1", Enabled = false } }; var result = chooser.ShowDialog(); if (result != DialogResult.OK) return; if (String.IsNullOrEmpty(chooser.User_Name) || String.IsNullOrEmpty(chooser.CrmId)) { MessageBoxEx.Show("无效的数据,获取不到用户的CRM信息"); return; } //txt_approver_name_yt.Text = chooser.contName; //txt_approver_name_yt.Tag = chooser.crmId; txt_appraiser_name.Text = chooser.User_Name; txt_appraiser_name.Tag = chooser.CrmId; }; txt_repair_man.ChooserClick += delegate //维修人选择器 { var chooser = new frmUsers{ cbo_data_source = { SelectedValue = "1", Enabled = false } }; var result = chooser.ShowDialog(); if (result != DialogResult.OK) return; if (String.IsNullOrEmpty(chooser.User_Name) || String.IsNullOrEmpty(chooser.CrmId)) { MessageBoxEx.Show("无效的数据,获取不到用户的CRM信息"); return; } //txt_approver_name_yt.Text = chooser.contName; //txt_approver_name_yt.Tag = chooser.crmId; txt_repair_man.Text = chooser.User_Name; txt_repair_man.Tag = chooser.CrmId; }; CommonCtrl.BindComboBoxByTable(cbo_cost_type_service_fwhd, "tb_product_no", "service_code", "activities", false); //费用类型(服务活动) unknow CommonCtrl.CmbBindDict(cbo_customer_property, "custom_property_yt", false); //客户性质 txt_vehicle_use_corp.ChooserClick += delegate //车辆使用单位选择器 { var custChooser = new frmCustomerInfo(); var result = custChooser.ShowDialog(); if (result == DialogResult.OK) { if (String.IsNullOrEmpty(custChooser.CustomerInfo.CustName) || String.IsNullOrEmpty(custChooser.CustomerInfo.SAPCode)) { MessageBoxEx.Show("选择的数据不符合使用要求"); return; } txt_vehicle_use_corp.Text = custChooser.CustomerInfo.CustName; txt_vehicle_use_corp.Tag = custChooser.CustomerInfo.SAPCode; } }; txt_customer_code.ChooserClick += delegate //客户信息选择器 { var custChooser = new frmCustomerInfo(); var result = custChooser.ShowDialog(); if (result == DialogResult.OK) { if (String.IsNullOrEmpty(custChooser.CustomerInfo.CustCode)) { MessageBoxEx.Show("选择的数据不符合使用要求"); return; } txt_customer_code.Text = custChooser.CustomerInfo.CustCode; txt_customer_code.Tag = custChooser.CustomerInfo.CustId; txt_customer_name.Caption = custChooser.CustomerInfo.CustName; txt_customer_address.Caption = custChooser.CustomerInfo.CustAddress; txt_customer_postcode.Caption = custChooser.CustomerInfo.ZipCode; //联系人数据 var dpt = DBHelper.GetTable("联系人数据", "(select tr.relation_object_id, tr.is_default tr_is_default, tb.* from tb_contacts tb inner join tr_base_contacts tr on tb.cont_id = tr.cont_id) a", "*", string.Format(" a.relation_object_id='{0}'", custChooser.CustomerInfo.CustId), "", ""); if (dpt != null && dpt.Rows.Count > 0) { for (var i = 0; i < dpt.Rows.Count; i++) { var dpr = dpt.Rows[i]; if (CommonCtrl.IsNullToString(dpr["tr_is_default"]) == "1") { txt_linkman.Caption = CommonCtrl.IsNullToString(dpr["cont_name"]); txt_link_man_mobile.Caption = CommonCtrl.IsNullToString(dpr["cont_phone"]); } } } ValidationCustomer(); } }; txt_customer_code.Leave += delegate //客户信息校验 { ValidationCustomer(); }; #endregion #region 车辆信息 CommonCtrl.BindComboBoxByDictionarr(cbo_fault_cause, "cause_fault_yt", false); //故障原因 CommonCtrl.BindComboBoxByDictionarr(cbo_fault_duty_corp, "fault_company_yt", false); //故障责任单位 txt_vehicle_no.ChooserClick += delegate //车辆选择器 { var chooser = new frmVehicleGrade(); var result = chooser.ShowDialog(); if (result != DialogResult.OK) return; txt_vehicle_no.Text = chooser.strLicensePlate; //车牌号 txt_depot_no.Text = chooser.Turner; //车工号 txt_vehicle_vin.Caption = chooser.strVIN; //VIN txt_engine_num.Caption = chooser.strEngineNum; //发动机号 txt_vehicle_model.Tag = chooser.strModel; //车型 ValidationVehicle(); //txt_maintain_mileage.Caption = chooser.MaintainMileage; //协议保养里程 //txt_maintain_time.Caption = chooser.MaintainTime; //协议保养日期 }; txt_depot_no.ChooserClick += delegate //车工号选择器 { var chooser = new frmVehicleGrade(); var result = chooser.ShowDialog(); if (result != DialogResult.OK) return; txt_vehicle_no.Text = chooser.strLicensePlate; //车牌号 txt_depot_no.Text = chooser.Turner; //车工号 txt_vehicle_vin.Caption = chooser.strVIN; //VIN txt_engine_num.Caption = chooser.strEngineNum; //发动机号 txt_vehicle_model.Tag = chooser.strModel; //车型 ValidationDepto(); //txt_maintain_mileage.Caption = chooser.MaintainMileage; //协议保养里程 //txt_maintain_time.Caption = chooser.MaintainTime; //协议保养日期 }; txt_vehicle_no.Leave += delegate //车辆信息校验 { //ValidationVehicle(); }; txt_depot_no.Leave += delegate //车辆信息校验 { ValidationDepto(); }; txt_vehicle_model.ChooserClick += delegate //车型选择器 { var chooser = new frmVehicleModels(); var result = chooser.ShowDialog(); if (result != DialogResult.OK) return; txt_vehicle_model.Text = chooser.VMName; //车型 txt_vehicle_model.Tag = chooser.VMID; _vmClass = chooser.VMClass; }; txt_fault_system.ChooserClick += delegate //故障系统选择器 { var chooser = new FormChooserFault(); var result = chooser.ShowDialog(); if (result != DialogResult.OK) return; txt_fault_system.Text = chooser.SystemName; txt_fault_system.Tag = chooser.SystemCode; txt_fault_assembly.Caption = chooser.AssemblyName; txt_fault_assembly.Tag = chooser.AssemblyCode; txt_fault_part.Caption = chooser.PartmName; txt_fault_part.Tag = chooser.PartCode; //txt_fault_schema.Text = chooser.SchemaName; //txt_fault_schema.Tag = chooser.SchemaCode; }; txt_fault_schema.ChooserClick += delegate //故障模式选择器 { var chooser = new FormChooserFaultModel(); var result = chooser.ShowDialog(); if (result != DialogResult.OK) return; txt_fault_schema.Text = chooser.FmeaName; txt_fault_schema.Tag = chooser.FmeaCode; }; #endregion #region 外出信息 CommonCtrl.BindComboBoxByDictionarr(cbo_whether_yt, "sys_true_false", false); //是否宇通车 if(cbo_whether_yt.Items.Contains("0")) cbo_whether_yt.SelectedValue = "0"; CommonCtrl.BindComboBoxByDictionarr(cbo_means_traffic, "traffic_mode_yt", false); //外出交通方式 if (cbo_means_traffic.Items.Count > 0) cbo_means_traffic.SelectedIndex = 0; cbo_means_traffic.SelectedIndexChanged += delegate { if (CommonCtrl.IsNullToString(cbo_means_traffic.SelectedValue) == DbDic2Enum.TRAFFIC_MODE_YT_100000000) { txt_journey_subsidy.Enabled = false; } else { txt_journey_subsidy.Enabled = true; } }; UIAssistants.BindingServiceStationUser(cbo_goout_approver, true, "请选择"); //外出批准人选择器 #endregion #region 配件信息 dtp_parts_buy_time.Value = DateTime.Now; //txt_parts_buy_corp.ChooserClick += delegate //配件购买单位(客户选择器) //{ // var custChooser = new frmChooseCompany(); // var result = custChooser.ShowDialog(); // if (result == DialogResult.OK) // { // txt_parts_buy_corp.Text = custChooser.Sap_Code; // } //}; CommonCtrl.BindComboBoxByDictionarr(cbo_contain_man_hour_cost, "sys_true_false", false); //是否包含工时费 cbo_contain_man_hour_cost.SelectedValue = DbDic2Enum.TRUE; txt_parts_code.ChooserClick += delegate //配件编号(配件选择器) { var chooser = new frmParts(); var result = chooser.ShowDialog(); if (result == DialogResult.OK) { txt_parts_code.Text = chooser.CarPartsCode; txt_materiel_describe.Caption = chooser.PartsName; } }; //txt_first_install_station.ChooserClick += delegate //首次安装服务站(客户选择器) //{ // var custChooser = new frmChooseCompany(); // var result = custChooser.ShowDialog(); // if (result == DialogResult.OK) // { // txt_first_install_station.Text = custChooser.Sap_Code; // } //}; CommonCtrl.BindComboBoxByDictionarr(cbo_part_guarantee_period, "parts_warranty_agreement_yt", false); //协议保养日期 #endregion #region 经办人 txt_responsible_opid.ChooserClick += delegate //经办人选择器 { var chooser = new frmUsers(); var result = chooser.ShowDialog(); if (result != DialogResult.OK) return; txt_responsible_opid.Text = chooser.User_Name; txt_responsible_opid.Tag = chooser.User_ID; txt_org_name.Caption = chooser.OrgName; txt_org_name.Tag = chooser.OrgId; }; #endregion } catch (Exception ex) { //日记记录 } }
//初始化 private void Init() { #region 设置功能按钮可见性 UIAssistants.SetUCBaseFuncationVisible(this, new ObservableCollection<ButtonEx_sms>() { btnSave, btnCancel, btnSet, btnView, btnPrint }); #endregion #region 初始化下拉框数据绑定 CommonCtrl.CmbBindDict(cbo_cb_Callback_type, "sys_callback_type", false); //绑定回访类型 CommonCtrl.CmbBindDict(cbo_cb_Callback_mode, "sys_callback_mode", false); //绑定回访方式 CommonCtrl.CmbBindDict(cbo_member_class, "sys_member_grade", false); //绑定会员等级 CommonFuncCall.BindProviceComBox(cbo_province, "请选择"); //绑定省份 CommonFuncCall.BindCityComBox(cbo_city, "", "请选择"); //绑定城市 CommonFuncCall.BindCountryComBox(cbo_county, "", "请选择"); //绑定县/区 cbo_province.SelectedIndexChanged += ddlprovince_SelectedIndexChanged; cbo_city.SelectedIndexChanged += ddlcity_SelectedIndexChanged; CommonCtrl.CmbBindDict(cbo_cust_type, "sys_customer_category", false); //客户类别 #endregion lbl_cb_create_by.Text = GlobalStaticObj.CurrUserCom_Name; lbl_cb_create_by.Tag = GlobalStaticObj.UserID; if (OpType == WindowStatus.Edit || OpType == WindowStatus.View) { SetCustInfo(); SetContInfo(); SetCallbackInfo(); } if (OpType == WindowStatus.View) palQTop.Enabled = false; #region 注册功能按钮事件 #region 选择客户信息 txt_cust_code.ChooserClick += delegate { var frmCustomer = new frmCustomerInfo(); var result = frmCustomer.ShowDialog(); if (result == DialogResult.OK) { CustId = frmCustomer.strCustomerId; txt_cust_code.Tag = CustId; txt_cust_code.Text = frmCustomer.strCustomerNo; } SetCustInfo(); }; #endregion #region 选择被回访人 txt_cb_Callback_by.ChooserClick += delegate { var frmContacts = new frmContacts(); var result = frmContacts.ShowDialog(); if (result == DialogResult.OK) { ContId = frmContacts.contID; txt_cb_Callback_by.Tag = ContId; txt_cb_Callback_by.Text = frmContacts.contName; txt_cb_Callback_by_duty.Caption = frmContacts.contDuty; txt_cb_Callback_by_phone.Caption = frmContacts.contPhone; } }; #endregion #region 选择经办人 txt_handle_name.ChooserClick += delegate { var chooser = new frmUsers(); var result = chooser.ShowDialog(); if (result == DialogResult.OK) { txt_handle_name.Text = chooser.User_Name; txt_handle_name.Tag = chooser.User_ID; txt_cb_handle_org.Caption = chooser.OrgName; } }; #endregion #region 保存数据 SaveEvent += delegate { var check = CheckValue(); if (!check) return; var dicFileds = new Dictionary<String, String>(); if (OpType == WindowStatus.Add) { dicFileds.Add("create_by", GlobalStaticObj.UserID); //创建人 dicFileds.Add("create_time", DBHelper.GetCurrentTime().Ticks.ToString()); //创建时间 dicFileds.Add("update_by", GlobalStaticObj.UserID); //最后编辑人 dicFileds.Add("update_time", DBHelper.GetCurrentTime().Ticks.ToString()); //最后编辑时间 dicFileds.Add("Callback_id", Guid.NewGuid().ToString()); //客户ID dicFileds.Add("status", "58b325d2-0792-4847-8e4a-22b3f25628f3"); //数据状态 } else if (OpType == WindowStatus.Edit) { dicFileds.Add("update_by", GlobalStaticObj.UserID); //最后编辑人 dicFileds.Add("update_time", DBHelper.GetCurrentTime().Ticks.ToString()); //最后编辑时间 } dicFileds.Add("Callback_corp", txt_cust_code.Tag.ToString()); //客户ID dicFileds.Add("Callback_time", DBHelper.GetCurrentTime().Ticks.ToString()); //回访时间 dicFileds.Add("Callback_type", cbo_cb_Callback_type.SelectedValue.ToString()); //回访类型 dicFileds.Add("Callback_mode", cbo_cb_Callback_mode.SelectedValue.ToString()); //回访方式 dicFileds.Add("title",txt_cb_title.Caption); //回访标题 dicFileds.Add("record", rtx_cb_record.Text); //回访内容 dicFileds.Add("Callback_by", txt_cb_Callback_by.Tag.ToString()); //被回访人员名称 dicFileds.Add("Callback_by_org", txt_cb_Callback_by_org.Caption); //被回访人员部门名称 dicFileds.Add("Callback_by_phone", txt_cb_Callback_by_phone.Caption); //被回访人电话 dicFileds.Add("Callback_by_duty", txt_cb_Callback_by_duty.Caption); //被回访人职务 dicFileds.Add("handle_name", txt_handle_name.Tag.ToString()); //经办人 dicFileds.Add("handle_org", txt_cb_handle_org.Caption); //经办人部门名称 var result = false; try { result = DBHelper.Submit_AddOrEdit("保存客户回访", "tb_CustomerSer_Callback", "Callback_id", CallBackId, dicFileds); } catch (Exception ex) { result = false; } MessageBoxEx.Show(result ? "保存成功!" : "保存失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); if (result) { UCCallBackManager.BindPageData(); deleteMenuByTag(Tag.ToString(), UCCallBackManager.Name); } }; #endregion #endregion }
//初始化 private void Init() { #region 设置功能按钮可见性 UIAssistants.SetUCBaseFuncationVisible(this, new ObservableCollection<ButtonEx_sms>() { btnSave, btnCancel, btnSet, btnView, btnPrint }); #endregion #region 初始化下拉框数据绑定 CommonCtrl.CmbBindDict(cbo_cb_Callback_type, "sys_callback_type", false); //绑定回访类型 CommonCtrl.CmbBindDict(cbo_cb_Callback_mode, "sys_callback_mode", false); //绑定回访方式 CommonCtrl.CmbBindDict(cbo_member_class, "sys_member_grade", false); //绑定会员等级 CommonFuncCall.BindProviceComBox(cbo_province, "请选择"); //绑定省份 CommonFuncCall.BindCityComBox(cbo_city, "", "请选择"); //绑定城市 CommonFuncCall.BindCountryComBox(cbo_county, "", "请选择"); //绑定县/区 cbo_province.SelectedIndexChanged += ddlprovince_SelectedIndexChanged; cbo_city.SelectedIndexChanged += ddlcity_SelectedIndexChanged; CommonCtrl.CmbBindDict(cbo_cust_type, "sys_customer_category", false); //客户类别 #endregion lbl_cb_create_by.Text = GlobalStaticObj.CurrUserCom_Name; lbl_cb_create_by.Tag = GlobalStaticObj.UserID; if (windowStatus == WindowStatus.Edit || windowStatus == WindowStatus.View) { SetCustInfo(); SetContInfo(); SetCallbackInfo(); } if (windowStatus == WindowStatus.View) palQTop.Enabled = false; #region 注册功能按钮事件 #region 选择客户信息 txt_cust_code.ChooserClick += delegate { var frmCustomer = new frmCustomerInfo(); var result = frmCustomer.ShowDialog(); if (result == DialogResult.OK) { CustId = frmCustomer.strCustomerId; txt_cust_code.Tag = CustId; txt_cust_code.Text = frmCustomer.strCustomerNo; SetCustInfo(); } }; dataGridViewEx1.CellContentClick += delegate(object sender, DataGridViewCellEventArgs args) { if (args.ColumnIndex < 0 || args.RowIndex < 0) return; if (dataGridViewEx1.Columns[args.ColumnIndex] == drtxt_maintain_no) { var ytServiceNo = CommonCtrl.IsNullToString(dataGridViewEx1.Rows[args.RowIndex].Cells[drtxt_maintain_id.Name].Value); if (String.IsNullOrEmpty(CommonCtrl.IsNullToString(ytServiceNo))) return; var uc = new RepairQueryView(ytServiceNo); uc.addUserControl(uc, "维修单-详细信息", "RepairQueryView" + ytServiceNo, Tag.ToString(), Name); } }; #endregion #region 选择被回访人 txt_cb_Callback_by.ChooserClick += delegate { var frmContacts = new frmContacts(); var result = frmContacts.ShowDialog(); if (result == DialogResult.OK) { ContId = frmContacts.contID; txt_cb_Callback_by.Tag = ContId; txt_cb_Callback_by.Text = frmContacts.contName; txt_cb_Callback_by_duty.Caption = frmContacts.contDuty; txt_cb_Callback_by_phone.Caption = frmContacts.contPhone; } }; #endregion #region 选择经办人 txt_handle_name.ChooserClick += delegate { var chooser = new frmUsers(); var result = chooser.ShowDialog(); if (result == DialogResult.OK) { txt_handle_name.Text = chooser.User_Name; txt_handle_name.Tag = chooser.User_ID; txt_cb_handle_org.Caption = chooser.OrgName; } }; #endregion //CancelEvent += (sender, args) => deleteMenuByTag(Tag.ToString(), UCCallBackManager.Name); CancelEvent += new ClickHandler(UCCallBackAddOrEdit_CancelEvent); #region 保存数据 SaveEvent += delegate { var check = CheckValue(); if (!check) return; var dicFileds = new Dictionary<String, String>(); if (windowStatus == WindowStatus.Add) { dicFileds.Add("create_by", GlobalStaticObj.UserID); //创建人 dicFileds.Add("create_time", DBHelper.GetCurrentTime().Ticks.ToString()); //创建时间 dicFileds.Add("update_by", GlobalStaticObj.UserID); //最后编辑人 dicFileds.Add("update_time", DBHelper.GetCurrentTime().Ticks.ToString()); //最后编辑时间 dicFileds.Add("Callback_id", Guid.NewGuid().ToString()); //客户ID dicFileds.Add("status", "58b325d2-0792-4847-8e4a-22b3f25628f3"); //数据状态 } else if (windowStatus == WindowStatus.Edit) { DBHelper.BatchDeleteDataByWhere("删除客户与维修单关系", "tr_maintain_customer_callback", String.Format("callback_id = '{0}'", CallBackId)); dicFileds.Add("update_by", GlobalStaticObj.UserID); //最后编辑人 dicFileds.Add("update_time", DBHelper.GetCurrentTime().Ticks.ToString()); //最后编辑时间 } dicFileds.Add("Callback_corp", txt_cust_code.Tag.ToString()); //客户ID dicFileds.Add("Callback_time", DBHelper.GetCurrentTime().Ticks.ToString()); //回访时间 dicFileds.Add("Callback_type", cbo_cb_Callback_type.SelectedValue.ToString()); //回访类型 dicFileds.Add("Callback_mode", cbo_cb_Callback_mode.SelectedValue.ToString()); //回访方式 dicFileds.Add("title",txt_cb_title.Caption); //回访标题 dicFileds.Add("record", rtx_cb_record.Text); //回访内容 dicFileds.Add("Callback_by", txt_cb_Callback_by.Tag.ToString()); //被回访人员名称 dicFileds.Add("Callback_by_org", txt_cb_Callback_by_org.Caption); //被回访人员部门名称 dicFileds.Add("Callback_by_phone", txt_cb_Callback_by_phone.Caption); //被回访人电话 dicFileds.Add("Callback_by_duty", txt_cb_Callback_by_duty.Caption); //被回访人职务 dicFileds.Add("handle_name", txt_handle_name.Tag.ToString()); //经办人 dicFileds.Add("handle_org", txt_cb_handle_org.Caption); //经办人部门名称 var result = false; try { result = DBHelper.Submit_AddOrEdit("保存客户回访", "tb_CustomerSer_Callback", "Callback_id", CallBackId, dicFileds); if (result) { const string sqlStr = "INSERT INTO tr_maintain_customer_callback(id,maintain_id,customer_id ,callback_id) VALUES(@id,@maintain_id,@customer_id,@callback_id)"; var list = GetCheckRows(); var sysSqlStrList = list.Select(str => new SysSQLString { cmdType = CommandType.Text, sqlString = sqlStr, Param = new Dictionary<string, string> { {"@id", Guid.NewGuid().ToString()}, {"@maintain_id", str}, {"@customer_id", txt_cust_code.Tag.ToString()}, {"@callback_id", String.IsNullOrEmpty(CallBackId) ? dicFileds["Callback_id"] : CallBackId} } }).ToList(); DBHelper.BatchExeSQLStringMultiByTrans("添加客户与维修单关系", sysSqlStrList); } } catch (Exception ex) { result = false; } MessageBoxEx.Show(result ? "保存成功!" : "保存失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); if (result) { UCCallBackManager.BindPageData(); _autoClose = false; deleteMenuByTag(Tag.ToString(), UCCallBackManager.Name); } }; #endregion #endregion }