Exemplo n.º 1
0
        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); //宇通单据状态
        }
Exemplo n.º 2
0
 private void InitQueryControlDataSource()   //初始化查询控件数据项
 {
     if ((fld_vehicle_no.ValueControl as ExtTextChooser) != null)
     {
         (fld_vehicle_no.ValueControl as ExtTextChooser).ChooserClick += delegate //车牌号
         {
             var vechicleChooser = new frmVehicleGrade();
             var result          = vechicleChooser.ShowDialog();
             if (result != DialogResult.OK)
             {
                 return;
             }
             fld_vehicle_no.Value = fld_vehicle_no.DisplayValue = vechicleChooser.strLicensePlate;
         };
     }
     if ((fld_customer_code.ValueControl as ExtTextChooser) != null)
     {
         (fld_customer_code.ValueControl as ExtTextChooser).ChooserClick += delegate //客户编码(同时会更新客户名称)
         {
             var custChooser = new frmCustomerInfo();
             var result      = custChooser.ShowDialog();
             if (result != DialogResult.OK)
             {
                 return;
             }
             fld_customer_code.DisplayValue = custChooser.strCustomerNo;
             fld_customer_code.Value        = custChooser.strCustomerName;
         };
     }
     fld_info_status.ContentTypeName         = fld_info_status_yt.ContentTypeName = fld_receipt_type.ContentTypeName = "DbDic";
     fld_info_status.ContentTypeParameter    = "sys_service_info_status"; //单据状态
     fld_info_status_yt.ContentTypeParameter = "review_status_name_yt";   //宇通单据状态
     fld_receipt_type.ContentTypeParameter   = "bill_type_yt";            //单据类型
 }
Exemplo n.º 3
0
 private void txtclicense_plate_ChooserClick(object sender, EventArgs e)
 {
     frmVehicleGrade frmVG = new frmVehicleGrade();
     if (frmVG.ShowDialog() == DialogResult.OK)
     {
         txtclicense_plate.Text = frmVG.strLicensePlate;
     }
 }
        private void txtCarNO_ChooserClick(object sender, EventArgs e)
        {
            frmVehicleGrade frmVehicle = new frmVehicleGrade();
            DialogResult    result     = frmVehicle.ShowDialog();

            if (result == DialogResult.OK)
            {
                txtCarNO.Text = frmVehicle.strLicensePlate;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 车牌号选择器事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtCarNO_ChooserClick(object sender, EventArgs e)
        {
            frmVehicleGrade frmVehicle = new frmVehicleGrade();
            DialogResult    result     = frmVehicle.ShowDialog();

            if (result == DialogResult.OK)
            {
                txtCarNO.Text       = frmVehicle.strLicensePlate;
                txtEngineNo.Caption = frmVehicle.strEngineNum;
                txtCarType.Text     = frmVehicle.strModel;
            }
        }
Exemplo n.º 6
0
        private void txtCarNO_ChooserClick(object sender, EventArgs e)
        {
            frmVehicleGrade frmVehicle = new frmVehicleGrade();
            DialogResult    result     = frmVehicle.ShowDialog();

            if (result == DialogResult.OK)
            {
                txtCarNO.Text             = frmVehicle.strLicensePlate;
                txtVIN.Caption            = frmVehicle.strVIN;
                cobCarBrand.SelectedValue = frmVehicle.strBrand;
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 车牌号选择器事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtCarNO_ChooserClick(object sender, EventArgs e)
        {
            frmVehicleGrade frmVehicle = new frmVehicleGrade();
            DialogResult    result     = frmVehicle.ShowDialog();

            if (result == DialogResult.OK)
            {
                txtCarNO.Text         = frmVehicle.strLicensePlate;
                txtCarType.Text       = GetDicName(frmVehicle.strModel);
                txtCarType.Tag        = frmVehicle.strModel;
                txtCustomNO.Text      = frmVehicle.strCustCode;
                txtCustomNO.Tag       = frmVehicle.strCustId;
                txtCustomName.Caption = frmVehicle.strCustName;
            }
        }
Exemplo n.º 8
0
        private void txtCarNO_ChooserClick(object sender, EventArgs e)
        {
            frmVehicleGrade frmVehicle = new frmVehicleGrade();
            DialogResult    result     = frmVehicle.ShowDialog();

            if (result == DialogResult.OK)
            {
                txtCarNO.Text             = frmVehicle.strLicensePlate;
                txtVIN.Caption            = frmVehicle.strVIN;
                txtCarType.Text           = GetVmodel(frmVehicle.strModel);
                txtCarType.Tag            = frmVehicle.strModel;
                cobCarBrand.SelectedValue = frmVehicle.strBrand;
                txtYardCode.Caption       = frmVehicle.Turner;
                txtCustomNO.Text          = frmVehicle.strCustName;
                txtCustomNO.Tag           = frmVehicle.strCustId;
            }
        }
Exemplo n.º 9
0
 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); //宇通单据状态
 }
 /// <summary>
 /// 车牌号选择器事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void txtCarNO_ChooserClick(object sender, EventArgs e)
 {
     try
     {
         frmVehicleGrade frmVehicle = new frmVehicleGrade();
         DialogResult    result     = frmVehicle.ShowDialog();
         if (result == DialogResult.OK)
         {
             txtCarNO.Text           = frmVehicle.strLicensePlate;
             txtCarType.Text         = GetVmodel(frmVehicle.strModel);
             txtCarType.Tag          = frmVehicle.strModel;
             txtCustomNO.Text        = frmVehicle.strCustCode;
             txtCustomNO.Tag         = frmVehicle.strCustId;
             txtCustomName.Caption   = frmVehicle.strCustName;
             txtContact.Caption      = frmVehicle.strContactName;
             txtContactPhone.Caption = frmVehicle.strContactPhone;
         }
     }
     catch (Exception ex)
     {
         HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex);
     }
 }
Exemplo n.º 11
0
        private void InitDataGridCellFormatting()   //初始化数据表格
        {
            try
            {
                dgvVehicle.CellFormatting += delegate(object sender, DataGridViewCellFormattingEventArgs args)
                {
                    UIAssistants.DgvCellDataConvert2DicData(dgvVehicle, args, "v_brand");
                    UIAssistants.DgvCellDataConvert2DicData(dgvVehicle, args, "v_model");
                };

                #region 车辆信息
                dgvVehicle.ReadOnly = false;
                dgvVehicle.Rows.Add(3);
                dgvVehicle.AllowUserToAddRows     = true;
                tb_vehicle_license_plate.ReadOnly = true;
                tb_vehicle_remark.ReadOnly        = true;
                tb_vehicle_v_brand.ReadOnly       = true;
                tb_vehicle_v_id.ReadOnly          = true;
                tb_vehicle_v_model.ReadOnly       = true;
                tb_vehicle_vin.ReadOnly           = true;

                dgvVehicle.CellClick += delegate(object sender, DataGridViewCellEventArgs args)
                {
                    if (args.ColumnIndex < 0)
                    {
                        return;
                    }
                    //if (dgvVehicle.Columns[args.ColumnIndex] != tb_vehicle_license_plate) return;
                    var chooser = new frmVehicleGrade();
                    var result  = chooser.ShowDialog();
                    if (result != DialogResult.OK)
                    {
                        return;
                    }
                    var strId = chooser.strLicensePlate;
                    var dpt   = DBHelper.GetTable("查询车辆档案信息", "tb_vehicle", "*", " license_plate='" + strId + "'", "", "");
                    if (dpt.Rows.Count <= 0)
                    {
                        return;
                    }
                    var dpr = dpt.Rows[0];
                    dgvVehicle.Rows[args.RowIndex].Cells["tb_vehicle_license_plate"].Value = CommonCtrl.IsNullToString(dpr["license_plate"]);
                    dgvVehicle.Rows[args.RowIndex].Cells["tb_vehicle_remark"].Value        = CommonCtrl.IsNullToString(dpr["remark"]);
                    dgvVehicle.Rows[args.RowIndex].Cells["tb_vehicle_v_brand"].Value       = CommonCtrl.IsNullToString(dpr["v_brand"]);
                    dgvVehicle.Rows[args.RowIndex].Cells["tb_vehicle_v_id"].Value          = CommonCtrl.IsNullToString(dpr["v_id"]);
                    dgvVehicle.Rows[args.RowIndex].Cells["tb_vehicle_v_model"].Value       = CommonCtrl.IsNullToString(dpr["v_model"]);
                    dgvVehicle.Rows[args.RowIndex].Cells["tb_vehicle_vin"].Value           = CommonCtrl.IsNullToString(dpr["vin"]);
                };
                #endregion

                #region 联系人信息
                dgvcontacts.CellFormatting += delegate(object sender, DataGridViewCellFormattingEventArgs args)
                {
                    UIAssistants.DgvCellDataConvert2DicData(dgvcontacts, args, "cont_post");
                    UIAssistants.DgvCellDataConvert2Datetime(dgvcontacts, args, "cont_birthday");
                };

                dgvcontacts.ReadOnly = false;
                dgvcontacts.Rows.Add(3);
                dgvcontacts.AllowUserToAddRows = true;
                cont_name.ReadOnly             = true;
                cont_post.ReadOnly             = true;
                cont_phone.ReadOnly            = true;
                cont_tel.ReadOnly      = true;
                cont_birthday.ReadOnly = true;
                cont_email.ReadOnly    = true;
                is_default.ReadOnly    = false;
                remark.ReadOnly        = true;

                dgvcontacts.CellContentClick += delegate(object sender, DataGridViewCellEventArgs e)
                {
                    if (e.RowIndex > -1 && e.ColumnIndex > -1)//双击表头或列头时不起作用
                    {
                        //获取控件的值
                        for (int i = 0; i < dgvcontacts.Rows.Count; i++)
                        {
                            dgvcontacts.Rows[i].Cells["is_default"].Value = "0";
                        }
                        dgvcontacts.Rows[e.RowIndex].Cells["is_default"].Value = "1";
                    }
                };

                dgvcontacts.CellClick += delegate(object sender, DataGridViewCellEventArgs args)
                {
                    if (args.ColumnIndex < 0 || args.RowIndex < 0)
                    {
                        return;
                    }
                    if (dgvcontacts.Columns[args.ColumnIndex] != cont_name)
                    {
                        return;
                    }
                    var frmPart = new frmContacts();
                    var result  = frmPart.ShowDialog();
                    if (result != DialogResult.OK)
                    {
                        return;
                    }
                    var strId = frmPart.contID;
                    var dpt   = DBHelper.GetTable("查询联系人信息", "v_contacts", string.Format("*,{0} phone ,{1} tel", EncryptByDB.GetDesFieldValue("cont_phone"), EncryptByDB.GetDesFieldValue("cont_tel")), " cont_id='" + strId + "'", "", "");
                    if (dpt.Rows.Count <= 0)
                    {
                        return;
                    }
                    var dpr = dpt.Rows[0];
                    dgvcontacts.Rows[args.RowIndex].Cells["cont_id"].Value       = CommonCtrl.IsNullToString(dpr["cont_id"]);
                    dgvcontacts.Rows[args.RowIndex].Cells["cont_name"].Value     = CommonCtrl.IsNullToString(dpr["cont_name"]);
                    dgvcontacts.Rows[args.RowIndex].Cells["cont_post"].Value     = CommonCtrl.IsNullToString(dpr["cont_post_name"]);
                    dgvcontacts.Rows[args.RowIndex].Cells["cont_phone"].Value    = CommonCtrl.IsNullToString(dpr["phone"]);
                    dgvcontacts.Rows[args.RowIndex].Cells["cont_tel"].Value      = CommonCtrl.IsNullToString(dpr["tel"]);
                    dgvcontacts.Rows[args.RowIndex].Cells["cont_birthday"].Value = CommonCtrl.IsNullToString(dpr["cont_birthday"]);
                    dgvcontacts.Rows[args.RowIndex].Cells["cont_email"].Value    = CommonCtrl.IsNullToString(dpr["cont_email"]);
                    dgvcontacts.Rows[args.RowIndex].Cells["is_default"].Value    = "0";
                    dgvcontacts.Rows[args.RowIndex].Cells["remark"].Value        = CommonCtrl.IsNullToString(dpr["remark"]);
                };
                #endregion
            }
            catch (Exception)
            {
            }
        }