Exemplo n.º 1
0
        /// <summary>
        /// 【详情】查询物流人员
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtGC_DeliveryByName_EditorButtonClick(object sender, EditorButtonEventArgs e)
        {
            if (string.IsNullOrEmpty(cbGC_DeliveryTypeName.Text))
            {
                //请先选择物流人员类型,再选择物流人员
                MessageBoxs.Show(Trans.SD, this.ToString(), MsgHelp.GetMsg(MsgCode.W_0034, new object[] { MsgParam.DELIVERYBY_TYPE, MsgParam.DELIVERYBY }), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (cbGC_DeliveryTypeName.Text == DeliveryTypeEnum.Name.YG)
            {
                #region 物流人员为{员工}的场合

                //查询当前组织下的用户
                FrmUserQuery userQuery = new FrmUserQuery(paramItemSelectedItemParentValue: LoginInfoDAX.OrgID, paramItemSelectedItemParentText: LoginInfoDAX.OrgShortName)
                {
                    StartPosition = FormStartPosition.CenterScreen
                };
                DialogResult dialogResult = userQuery.ShowDialog();
                if (dialogResult != DialogResult.OK)
                {
                    return;
                }
                if (userQuery.SelectedGridList != null && userQuery.SelectedGridList.Count == 1)
                {
                    //物流人员
                    txtGC_DeliveryByName.Text = userQuery.SelectedGridList[0].User_Name;
                    //物流人员ID
                    txtGC_DeliveryByID.Text = userQuery.SelectedGridList[0].User_ID;
                    //物流人员手机号
                    txtGC_DeliveryByPhoneNo.Text = userQuery.SelectedGridList[0].User_PhoneNo;
                }

                #endregion
            }
            else
            {
                #region 物流人员为{第三方个人}、{第三方公司}的场合

                //根据物流订单.[物流人员类型]查询相应物流订单中物流人员信息
                List <ComComboBoxDataSourceTC> paramDeliveryTypeList = new List <ComComboBoxDataSourceTC>();
                paramDeliveryTypeList = _deliveryTypeList.Where(x => x.Text == cbGC_DeliveryTypeName.Text).ToList();

                Dictionary <string, object> paramViewParameters = new Dictionary <string, object>
                {
                    { SDViewParamKey.DeliveryType.ToString(), paramDeliveryTypeList }
                };

                FrmLogisticsBillQuery logisticsBillQuery = new FrmLogisticsBillQuery(paramViewParameters)
                {
                    StartPosition = FormStartPosition.CenterScreen
                };
                DialogResult dialogResult = logisticsBillQuery.ShowDialog();
                if (dialogResult != DialogResult.OK)
                {
                    return;
                }
                if (logisticsBillQuery.SelectedGridList != null && logisticsBillQuery.SelectedGridList.Count == 1)
                {
                    //物流人员
                    txtGC_DeliveryByName.Text = logisticsBillQuery.SelectedGridList[0].LB_DeliveryBy;
                    //物流人员手机号
                    txtGC_DeliveryByPhoneNo.Text = logisticsBillQuery.SelectedGridList[0].LB_PhoneNo;
                }

                #endregion
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 收款对象EditorButton事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtPayObjectName_EditorButtonClick(object sender, EditorButtonEventArgs e)
        {
            if (string.IsNullOrEmpty(cbReceivableObjectTypeName.Text))
            {
                //请先选择收款对象类型,再选择收款对象
                MessageBoxs.Show(Trans.PIS, this.ToString(), MsgHelp.GetMsg(MsgCode.W_0034, new object[]
                                                                            { MsgParam.PAYOBJECT_TYPE, SystemTableColumnEnums.FM_PayBill.Name.PB_RecObjectName }), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            switch (cbReceivableObjectTypeName.Text)
            {
            case AmountTransObjectTypeEnum.Name.ORGANIZATION:
                #region [收款对象类型]为{组织}的场合

                //查询组织
                FrmOrgQuery frmOrgQuery = new FrmOrgQuery();
                if (frmOrgQuery.ShowDialog() == DialogResult.OK)
                {
                    if (frmOrgQuery.SelectedGridList != null && frmOrgQuery.SelectedGridList.Count == 1)
                    {
                        //收款对象ID
                        txtRecObjectID.Text = frmOrgQuery.SelectedGridList[0].Org_ID;
                        //收款对象
                        txtRecObjectName.Text = frmOrgQuery.SelectedGridList[0].Org_ShortName;
                    }
                }
                #endregion
                break;

            case AmountTransObjectTypeEnum.Name.AUTOPARTSSUPPLIER:
                #region [收款对象类型]为{供应商}的场合

                //查询供应商
                FrmSupplierQuery frmSupplierQuery = new FrmSupplierQuery(SystemTableColumnEnums.PIS_Supplier.Code.SUPP_ID,
                                                                         SystemTableColumnEnums.PIS_Supplier.Code.SUPP_Name);
                if (frmSupplierQuery.ShowDialog() == DialogResult.OK)
                {
                    //收款对象
                    txtRecObjectName.Text = frmSupplierQuery.SelectedText;
                    //收款对象ID
                    txtRecObjectID.Text = frmSupplierQuery.SelectedValue;
                }
                #endregion
                break;

            case AmountTransObjectTypeEnum.Name.GENERALAUTOFACTORY:
                #region [收款对象类型]为{一般汽修商户}的场合

                //查询一般汽修商客户
                Dictionary <string, object> generalAutoFactoryQueryParameters = new Dictionary <string, object>
                {
                    { ComViewParamKey.CustomerType.ToString(), CustomerTypeEnum.Name.YBQXSH },
                };
                FrmCustomerQuery frmGeneralAutoFactoryQuery = new FrmCustomerQuery(generalAutoFactoryQueryParameters);
                if (frmGeneralAutoFactoryQuery.ShowDialog() == DialogResult.OK)
                {
                    List <CustomerQueryUIModel> selectedGridList = frmGeneralAutoFactoryQuery.SelectedGridList;
                    if (selectedGridList != null && selectedGridList.Count == 1)
                    {
                        //收款对象ID
                        txtRecObjectID.Text = selectedGridList[0].CustomerID;
                        //收款对象
                        txtRecObjectName.Text = selectedGridList[0].CustomerName;
                    }
                }
                #endregion
                break;

            case AmountTransObjectTypeEnum.Name.PLATFORMAUTOFACTORY:
                #region [收款对象类型]为{平台内汽修商}的场合

                //查询平台内汽修商
                Dictionary <string, object> platformAutoFactoryParameters = new Dictionary <string, object>
                {
                    { ComViewParamKey.CustomerType.ToString(), CustomerTypeEnum.Name.PTNQXSH },
                };
                FrmCustomerQuery frmPlatformAutoFactoryQuery = new FrmCustomerQuery(platformAutoFactoryParameters);
                if (frmPlatformAutoFactoryQuery.ShowDialog() == DialogResult.OK)
                {
                    List <CustomerQueryUIModel> selectedGridList = frmPlatformAutoFactoryQuery.SelectedGridList;
                    if (selectedGridList != null && selectedGridList.Count == 1)
                    {
                        //收款对象ID
                        txtRecObjectID.Text = selectedGridList[0].CustomerID;
                        //收款对象
                        txtRecObjectName.Text = selectedGridList[0].CustomerName;
                    }
                }
                #endregion
                break;

            case AmountTransObjectTypeEnum.Name.REGULARCUSTOMER:
                #region [收款对象类型]为{普通客户}的场合

                //查询普通客户
                Dictionary <string, object> regularCustomerParameters = new Dictionary <string, object>
                {
                    { ComViewParamKey.CustomerType.ToString(), CustomerTypeEnum.Name.PTKH },
                };
                FrmCustomerQuery frmRegularCustomerQuery = new FrmCustomerQuery(regularCustomerParameters);
                if (frmRegularCustomerQuery.ShowDialog() == DialogResult.OK)
                {
                    List <CustomerQueryUIModel> selectedGridList = frmRegularCustomerQuery.SelectedGridList;
                    if (selectedGridList != null && selectedGridList.Count == 1)
                    {
                        //收款对象ID
                        txtRecObjectID.Text = selectedGridList[0].CustomerID;
                        //收款对象
                        txtRecObjectName.Text = selectedGridList[0].CustomerName;
                    }
                }
                #endregion
                break;

            case AmountTransObjectTypeEnum.Name.DELIVERYMAN:
                #region [收款对象类型]为{配送人员}的场合

                //查询物流单
                FrmLogisticsBillQuery logisticsBillQuery = new FrmLogisticsBillQuery()
                {
                    StartPosition = FormStartPosition.CenterScreen
                };
                if (logisticsBillQuery.ShowDialog() == DialogResult.OK)
                {
                    if (logisticsBillQuery.SelectedGridList != null && logisticsBillQuery.SelectedGridList.Count == 1)
                    {
                        //收款对象ID
                        txtRecObjectID.Text = logisticsBillQuery.SelectedGridList[0].LB_DeliveryByID;
                        //收款对象
                        txtRecObjectName.Text = logisticsBillQuery.SelectedGridList[0].LB_DeliveryBy;
                    }
                }
                #endregion
                break;

            case AmountTransObjectTypeEnum.Name.OTHERS:
                #region [收款对象类型]为{其他}的场合
                //手动输入

                #endregion
                break;
            }
        }