private void UCReserveOrderQuery_Load(object sender, EventArgs e) { CommonCtrl.CmbBindDict(cobPayType, "sys_repair_pay_methods", true); //绑定维修付费方式 this.SetTopbuttonShow(); UIAssistants.SetButtonStyle4QueryAndClear(btnQuery, btnClear); //设置查询按钮和清除按钮样式 dtpReserveSTime.Value = DateTime.Now.AddMonths(-1); dtpReserveETime.Value = DateTime.Now; dtpReInSTime.Value = DateTime.Now.AddMonths(-1); dtpReInETime.Value = DateTime.Now; dgvRData.Dock = DockStyle.Fill; dgvRData.ReadOnly = false; foreach (DataGridViewColumn dgvc in dgvRData.Columns) { if (dgvc == colCheck) { continue; } dgvc.ReadOnly = true; } if (dt == null) { this._BindPageData(); } else { this.BindPageData(); } this.page.PageIndexChanged -= new ServiceStationClient.ComponentUI.WinFormPager.EventHandler(this.page_PageIndexChanged); this.page.PageIndexChanged += new ServiceStationClient.ComponentUI.WinFormPager.EventHandler(this.page_PageIndexChanged); }
private void UCSettlementManage_Load(object sender, EventArgs e) { base.RoleButtonStstus(this.Name);//角色按钮权限-是否隐藏 this.dgvRecord.ReadOnly = false; //结算方式 CommonCtrl.CmbBindDict(this.cmbJSFS, "sys_closing_way"); //绑定状态 DataSources.BindComBoxDataEnum(cboStatus, typeof(DataSources.EnumStatus), true);//绑定状态 DataSources.BindComDataGridViewBoxColumnDataEnum(this.colStatus, typeof(DataSources.EnumStatus)); this.uiHandler -= new UiHandler(this.ShowBindData); this.uiHandler += new UiHandler(this.ShowBindData); this.AddEvent += new ClickHandler(UCSettlementManage_AddEvent); this.EditEvent += new ClickHandler(UCSettlementManage_EditEvent); this.CopyEvent += new ClickHandler(UCSettlementManage_CopyEvent); this.ViewEvent += new ClickHandler(UCSettlementManage_ViewEvent); this.DeleteEvent += new ClickHandler(UCSettlementManage_DeleteEvent); base.StatusEvent -= new ClickHandler(UC_StatusEvent); base.StatusEvent += new ClickHandler(UC_StatusEvent); this.BindData(); }
private void InitQueryControlDataSource() //初始化查询控件数据项 { dtp_repairs_time_s.Value = DateTime.Now.AddMonths(-1); dtp_repairs_time_e.Value = DateTime.Now.AddDays(1); dtp_approval_date_s.Value = DateTime.Now.AddMonths(-1); dtp_approval_date_e.Value = DateTime.Now.AddDays(1); txt_vehicle_no.ChooserClick += delegate //车牌号 { var vechicleChooser = new frmVehicleGrade(); var result = vechicleChooser.ShowDialog(); if (result != DialogResult.OK) { return; } txt_vehicle_no.Text = vechicleChooser.strLicensePlate; }; txt_customer_code.ChooserClick += delegate //客户编码(同时会更新客户名称) { var custChooser = new frmCustomerInfo(); var result = custChooser.ShowDialog(); if (result != DialogResult.OK) { return; } txt_customer_code.Text = custChooser.strCustomerNo; txt_customer_name.Caption = custChooser.strCustomerName; }; CommonCtrl.CmbBindDict(cbo_bill_type_yt, "bill_type_yt", true); //单据类型 CommonCtrl.CmbBindDict(cbo_info_status, "sys_service_info_status", true); //单据状态 CommonCtrl.CmbBindDict(cbo_approve_status_yt, "review_status_name_yt", true); //宇通单据状态 }
private void InitData() { this.txtKeyNmae.Caption = string.Empty; dtpSTime.Value = DateTime.Now.AddMonths(-1); dtpETime.Value = DateTime.Now; CommonCtrl.CmbBindDict(this.cboannouncement_type, "announcement_type");//公告分类 DataSources.BindComBoxDataEnum(this.cmbStatus, typeof(DataSources.EnumStatus), true); CommonCtrl.CmbBindDeptment(this.cmbOrg, string.Empty); }
private void UCSettlementAddOrEdit_Load(object sender, EventArgs e) { base.SetBtnStatus(windowStatus); CommonCtrl.CmbBindDict(this.cmbJSFS, "sys_closing_way"); BindDefaultAccount(); //如果是编辑或者复制,则先绑定数据 if ((windowStatus == WindowStatus.Edit || windowStatus == WindowStatus.Copy) && id.Length > 0) { BindData(); } }
private void InitData() { this.tbCode.Caption = string.Empty; this.tbName.Caption = string.Empty; this.tbPhone.Caption = string.Empty; //维修资质 CommonCtrl.CmbBindDict(this.cmbWXZZ, "sys_repair_qualification"); //单位性质 CommonCtrl.CmbBindDict(this.cmbGSXZ, "sys_enterprise_property"); CommonCtrl.CmbBindProvice(this.cmbProvince, "省"); CommonCtrl.CmbBindCity(this.cmbCity, string.Empty, "市"); CommonCtrl.CmbBindCountry(this.cmbCountry, string.Empty, "县"); }
private void InitQueryControlDataSource() //初始化查询控件数据项 { txt_vehicle_no.ChooserClick += delegate //车牌号 { try { var vechicleChooser = new frmVehicleGrade(); var result = vechicleChooser.ShowDialog(); if (result != DialogResult.OK) { return; } txt_vehicle_no.Text = vechicleChooser.strLicensePlate; } catch (Exception ex) { _loggingService.WriteLog(ex); } }; txt_customer_code.ChooserClick += delegate //客户编码(同时会更新客户名称) { try { var custChooser = new frmCustomerInfo(); var result = custChooser.ShowDialog(); if (result != DialogResult.OK) { return; } txt_customer_code.Text = custChooser.strCustomerNo; txt_customer_name.Caption = custChooser.strCustomerName; } catch (Exception ex) { _loggingService.WriteLog(ex); } }; CommonCtrl.CmbBindDict(cbo_bill_type_yt, "bill_type_yt", true); //单据类型 CommonCtrl.CmbBindDict(cbo_approve_status_yt, "review_status_name_yt", true); //宇通单据状态 }
private void InitData() { CommonCtrl.CmbBindDict(this.cboannouncement_type, "announcement_type");//公告分类 DataSources.BindComBoxDataEnum(this.cmbStatus, typeof(DataSources.EnumStatus), true); CommonCtrl.CmbBindDeptment(this.cmbOrg, string.Empty); }
//初始化 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(); }; #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); #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) { 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(); _autoClose = false; deleteMenuByTag(Tag.ToString(), UCCallBackManager.Name); } }; #endregion #endregion }
//清除 private void btnClear_Click(object sender, EventArgs e) { CommonCtrl.CmbBindDict(this.cmbJSFS, "sys_closing_way"); DataSources.BindComBoxDataEnum(cboStatus, typeof(DataSources.EnumStatus), true);//绑定状态 }
//初始化 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 }