コード例 #1
0
        /// <summary>
        /// 遍历Tree
        /// </summary>
        private void TraversTreeToSearch()
        {
            if (string.IsNullOrEmpty(txtWhere_APT_Name.Text.Trim()))
            {
                return;
            }
            int  noodCount  = 0;
            bool isContinue = false;

            foreach (UltraTreeNode loopNode in treeAutoPartsType.Nodes)
            {
                noodCount++;
                if (!TraversTreeNodeToSearch(loopNode))
                {
                    isContinue = true;
                    continue;
                }
                isContinue = false;
                break;
            }
            if (isContinue && noodCount == treeAutoPartsType.Nodes.Count)
            {
                _alreadySearchDic.Clear();
                txtWhere_APT_Name.SelectAll();
                txtWhere_APT_Name.Focus();

                MessageBoxs.Show(Trans.COM, ToString(), "找不到‘" + txtWhere_APT_Name.Text.Trim() + "’", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #2
0
        /// <summary>
        /// 仓位查询
        /// </summary>
        /// <param name="paramSelectedValuePropertyName">选中项的值对应数据源中的属性名</param>
        /// <param name="paramSelectedTextPropertyName">选中项的描述对应数据源中的属性名</param>
        /// <param name="paramSelectedValue">默认选中项的值</param>
        /// <param name="paramCustomeSelectionMode">选择模式,默认单选</param>
        /// <param name="paramItemSelectedItemParentValue">默认选中项的父级值</param>
        public FrmWarehouseBinQuery(string paramSelectedValuePropertyName,
                                    string paramSelectedTextPropertyName = null,
                                    string paramSelectedValue            = null,
                                    CustomEnums.CustomeSelectionMode paramCustomeSelectionMode = CustomEnums.CustomeSelectionMode.Single,
                                    string paramItemSelectedItemParentValue = null)
        {
            if (string.IsNullOrEmpty(paramSelectedValuePropertyName))
            {
                MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.W_0021, new object[] { MsgParam.paramSelectedValuePropertyName }), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            SelectedValuePropertyName = paramSelectedValuePropertyName;
            SelectedValue             = paramSelectedValue;

            //paramSelectedTextPropertyName为空时,用paramSelectedValuePropertyName代替
            if (string.IsNullOrEmpty(paramSelectedTextPropertyName))
            {
                SelectedTextPropertyName = paramSelectedValuePropertyName;
                SelectedText             = paramSelectedValue;
            }
            else
            {
                SelectedTextPropertyName = paramSelectedTextPropertyName;
            }

            ListSelectionMode       = paramCustomeSelectionMode;
            SelectedItemParentValue = paramItemSelectedItemParentValue;

            InitializeComponent();
        }
コード例 #3
0
        /// <summary>
        /// 确定并继续
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConfirmAndContinue_Click(object sender, EventArgs e)
        {
            gdGrid.UpdateData();
            if (_pickPartsDetailFunc != null)
            {
                var pickPartsResult = _pickPartsDetailFunc(SelectedGridList);
                if (!pickPartsResult)
                {
                    //领取配件失败
                    MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0010, new object[] { MsgParam.PICK + MsgParam.AUTOPARTS }), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                //领料成功,取消选中
                var tempSelectedList = ListGridDS.Where(x => x.IsChecked).ToList();
                foreach (var loopSelected in tempSelectedList)
                {
                    loopSelected.IsChecked = false;
                }

                gdGrid.Refresh();
            }
            if (SelectedGridList.Count == 0)
            {
                //请至少勾选一条数据
                MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0038, new object[] { }), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
コード例 #4
0
        /// <summary>
        /// Grid的双击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gdGrid_DoubleClick(object sender, EventArgs e)
        {
            //是否允许获取Grid数据
            if (!IsAllowSetGridDataToCard())
            {
                return;
            }
            if (_pickPartsDetailFunc != null)
            {
                var pickPartsResult = _pickPartsDetailFunc(SelectedGridList);
                if (!pickPartsResult)
                {
                    //领取配件失败
                    MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0010, new object[] { MsgParam.PICK + MsgParam.AUTOPARTS }), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                //领料成功,取消选中
                var tempSelectedList = ListGridDS.Where(x => x.IsChecked).ToList();
                foreach (var loopSelected in tempSelectedList)
                {
                    loopSelected.IsChecked = false;
                }
            }
            this.DialogResult = DialogResult.OK;

            MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.I_0001, new object[] { MsgParam.PICK + MsgParam.AUTOPARTS }), MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
コード例 #5
0
 /// <summary>
 /// 确定按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnConfirm_Click(object sender, EventArgs e)
 {
     if (SelectedGridList.Count == 0)
     {
         MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0038, new object[] { }), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     this.DialogResult = DialogResult.OK;
 }
コード例 #6
0
        /// <summary>
        /// 双击单元格
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gdGrid_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
        {
            //是否允许获取Grid数据
            if (!IsAllowSetGridDataToCard())
            {
                return;
            }
            if (e.Cell.Column.Key == "IsChecked")
            {
                return;
            }
            string tempRowID = e.Cell.Row.Cells[SysConst.RowID].Value != null ? e.Cell.Row.Cells[SysConst.RowID].Value.ToString() : string.Empty;

            foreach (var loopSourceItem in ListGridDS)
            {
                if (loopSourceItem.RowID == tempRowID)
                {
                    if (!loopSourceItem.IsChecked)
                    {
                        loopSourceItem.IsChecked = true;
                        this.gdGrid.Refresh();
                    }
                }
                else
                {
                    //双击当前行,且为单选模式时,取消选中其他行
                    if (ListSelectionMode == CustomEnums.CustomeSelectionMode.Single)
                    {
                        if (loopSourceItem.IsChecked)
                        {
                            loopSourceItem.IsChecked = false;
                        }
                    }
                }
            }
            GenerateSelectedValueAndText();

            if (_pickPartsDetailFunc != null)
            {
                var pickPartsResult = _pickPartsDetailFunc(SelectedGridList);
                if (!pickPartsResult)
                {
                    //领取配件失败
                    MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0010, new object[] { MsgParam.PICK + MsgParam.AUTOPARTS }), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                //领料成功,取消选中
                var tempSelectedList = ListGridDS.Where(x => x.IsChecked).ToList();
                foreach (var loopSelected in tempSelectedList)
                {
                    loopSelected.IsChecked = false;
                }
            }
            this.DialogResult = DialogResult.OK;

            MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.I_0001, new object[] { MsgParam.PICK + MsgParam.AUTOPARTS }), MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
コード例 #7
0
 /// <summary>
 /// 确定按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnConfirm_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(SelectedValue) ||
         string.IsNullOrEmpty(SelectedText))
     {
         MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0038, new object[] { }), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     this.DialogResult = DialogResult.OK;
 }
コード例 #8
0
        /// <summary>
        /// 确定按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            SelectedValue = treeAutoPartsType.SelectedNodes[0].Key;
            SelectedText  = treeAutoPartsType.SelectedNodes[0].Text;

            if (string.IsNullOrEmpty(SelectedValue) ||
                string.IsNullOrEmpty(SelectedText))
            {
                //请选择配件类别
                MessageBoxs.Show(Trans.COM, ToString(), MsgHelp.GetMsg(MsgCode.E_0013, new object[] { SystemTableEnums.Name.BS_AutoPartsType }), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            DialogResult = DialogResult.OK;
            Close();
        }
コード例 #9
0
        /// <summary>
        /// 确定按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            //前端检查-保存
            if (!ClientCheckForSave())
            {
                return;
            }
            //将页面内控件的值赋值给基类的_payBillManager
            SetCardCtrlsToDetailDS();
            if (!_bll.SaveBusinessPayConfirmData(_payBillManager, ListGridDS))
            {
                //保存失败
                MessageBoxs.Show(Trans.COM, this.ToString(), _bll.ResultMsg, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            //保存成功
            MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.I_0001, new object[] { SystemActionEnum.Name.SAVE }), MessageBoxButtons.OK, MessageBoxIcon.Information);

            this.DialogResult = DialogResult.OK;
        }
コード例 #10
0
        /// <summary>
        /// 前端检查-保存
        /// </summary>
        private bool ClientCheckForSave()
        {
            #region 验证

            if (string.IsNullOrEmpty(numThisPayAmount.Text.Trim()))
            {
                MessageBoxs.Show(Trans.FM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { MsgParam.THIS_PAYAMOUNT }), MessageBoxButtons.OK, MessageBoxIcon.Information);
                numThisPayAmount.Focus();
                return(false);
            }

            if (cbPayTypeName.Text == TradeTypeEnum.Name.WALLET)
            {
                decimal walletBalance = Convert.ToDecimal(txtWalletBalance.Text.Trim() == "" ? "0" : txtWalletBalance.Text.Trim());

                decimal thisPayAmount = Convert.ToDecimal(numThisPayAmount.Value ?? 0);
                if (walletBalance < thisPayAmount)
                {
                    //本次付款总金额超出钱包金额,不能支付
                    MessageBoxs.Show(Trans.FM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0000, new object[] { "本次付款总金额超出钱包金额,不能支付" }), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return(false);
                }
            }

            decimal payAmount   = Convert.ToDecimal(numThisPayAmount.Value ?? 0);
            decimal unPayAmount = Convert.ToDecimal(txtUnPayTotalAmount.Text.Trim() == "" ? "0" : txtUnPayTotalAmount.Text.Trim());
            if (payAmount > unPayAmount)
            {
                //本次付款金额大于未付金额,是否确认支付?\r\n单击【确定】支付单据,【取消】返回。
                DialogResult isPay = MessageBoxs.Show(Trans.FM, this.ToString(), MsgHelp.GetMsg(MsgCode.W_0037, new object[] { MsgParam.THIS_PAYAMOUNT, SystemTableColumnEnums.FM_AccountPayableBill.Name.APB_UnpaidAmount, MsgParam.PAY }), MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (isPay != DialogResult.OK)
                {
                    return(false);
                }
            }

            #endregion

            return(true);
        }
コード例 #11
0
        /// <summary>
        /// 双击单元格
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gdGrid_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
        {
            //是否允许获取Grid数据
            if (!IsAllowSetGridDataToCard())
            {
                return;
            }
            object relatedSourItem = null;
            string tempRowID       = e.Cell.Row.Cells[SysConst.RowID].Value != null ? e.Cell.Row.Cells[SysConst.RowID].Value.ToString() : string.Empty;

            foreach (var loopSourceItem in ListGridDS)
            {
                if (loopSourceItem.RowID == tempRowID)
                {
                    relatedSourItem = loopSourceItem;
                    if (!loopSourceItem.IsChecked)
                    {
                        loopSourceItem.IsChecked = true;
                        this.gdGrid.Refresh();
                    }
                }
                else
                {
                    //双击当前行,且为单选模式时,取消选中其他行
                    if (ListSelectionMode == CustomEnums.CustomeSelectionMode.Single)
                    {
                        if (loopSourceItem.IsChecked)
                        {
                            loopSourceItem.IsChecked = false;
                        }
                    }
                }
            }

            #region 验证数据源是否存在选中项相关属性
            if (!_dataSourceHasSelectedValueProperty || !_dataSourceHasSelectedTextProperty)
            {
                if (relatedSourItem != null)
                {
                    Type tp = relatedSourItem.GetType();

                    foreach (PropertyInfo pi in tp.GetProperties())
                    {
                        //过滤索引器
                        if (SysConst.EN_ITEM.Equals(pi.Name))
                        {
                            continue;
                        }

                        if (pi.Name == SelectedValuePropertyName)
                        {
                            _dataSourceHasSelectedValueProperty = true;
                        }
                        if (pi.Name == SelectedTextPropertyName)
                        {
                            _dataSourceHasSelectedTextProperty = true;
                        }
                        if (_dataSourceHasSelectedValueProperty && _dataSourceHasSelectedTextProperty)
                        {
                            break;
                        }
                    }
                    if (!_dataSourceHasSelectedValueProperty)
                    {
                        MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.W_0022, new object[] { SelectedValuePropertyName }), MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                    if (!_dataSourceHasSelectedTextProperty)
                    {
                        MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.W_0022, new object[] { SelectedTextPropertyName }), MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                }
            }
            #endregion

            GenerateSelectedValueAndText();

            this.DialogResult = DialogResult.OK;
        }
コード例 #12
0
        /// <summary>
        /// 单元格的值变化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gdGrid_CellChange(object sender, CellEventArgs e)
        {
            //提交数据到数据源
            gdGrid.UpdateData();
            if (e.Cell != null && e.Cell.Row != null)
            {
                bool curRowIsChecked = Convert.ToBoolean(e.Cell.Row.Cells[SysConst.IsChecked].Value);

                if (curRowIsChecked)
                {
                    object relatedSourItem = null;
                    //选中当前行,且为单选模式时,取消选中其他行
                    if (ListSelectionMode == CustomEnums.CustomeSelectionMode.Single)
                    {
                        string curRowID = e.Cell.Row.Cells[SysConst.RowID].Value != null ? e.Cell.Row.Cells[SysConst.RowID].Value.ToString() : string.Empty;

                        foreach (var loopSourceItem in ListGridDS)
                        {
                            if (loopSourceItem.RowID != curRowID)
                            {
                                if (loopSourceItem.IsChecked)
                                {
                                    loopSourceItem.IsChecked = false;
                                }
                            }
                            else
                            {
                                relatedSourItem = loopSourceItem;
                            }
                        }
                        this.gdGrid.Refresh();
                    }

                    #region 验证数据源是否存在选中项相关属性
                    if (!_dataSourceHasSelectedValueProperty || !_dataSourceHasSelectedTextProperty)
                    {
                        if (relatedSourItem != null)
                        {
                            Type tp = relatedSourItem.GetType();

                            foreach (PropertyInfo pi in tp.GetProperties())
                            {
                                //过滤索引器
                                if (SysConst.EN_ITEM.Equals(pi.Name))
                                {
                                    continue;
                                }

                                if (pi.Name == SelectedValuePropertyName)
                                {
                                    _dataSourceHasSelectedValueProperty = true;
                                }
                                if (pi.Name == SelectedTextPropertyName)
                                {
                                    _dataSourceHasSelectedTextProperty = true;
                                }
                                if (_dataSourceHasSelectedValueProperty && _dataSourceHasSelectedTextProperty)
                                {
                                    break;
                                }
                            }
                            if (!_dataSourceHasSelectedValueProperty)
                            {
                                MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.W_0022, new object[] { SelectedValuePropertyName }), MessageBoxButtons.OK, MessageBoxIcon.Information);
                                return;
                            }
                            if (!_dataSourceHasSelectedTextProperty)
                            {
                                MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.W_0022, new object[] { SelectedTextPropertyName }), MessageBoxButtons.OK, MessageBoxIcon.Information);
                                return;
                            }
                        }
                    }
                    #endregion
                }
                GenerateSelectedValueAndText();
            }
        }
コード例 #13
0
        /// <summary>
        /// 窗体加载事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmPickPartsQuery_Load(object sender, EventArgs e)
        {
            #region 固定
            //基类.工具栏(翻页)
            ToolBarPaging = toolBarManagerListTabPaging;
            //查询委托(基类控制翻页用)
            ExecuteQuery = QueryAction;
            //工具栏(翻页)单击事件
            toolBarManagerListTabPaging.ToolClick += new ToolClickEventHandler(ToolBarPaging_ToolClick);
            //工具栏(翻页)[当前页]值改变事件
            toolBarManagerListTabPaging.ToolValueChanged += new ToolEventHandler(ToolBarPaging_ToolValueChanged);
            //初始化【列表】Tab内控件
            InitializeListTabControls();
            #endregion

            #region 处理参数

            #region 获取PickAutoPartsFunc

            if (_viewParameters.ContainsKey(ComViewParamKey.PickAutoPartsFunc.ToString()))
            {
                var tempFunc = _viewParameters[ComViewParamKey.PickAutoPartsFunc.ToString()] as Func <List <PickPartsQueryUIModel>, bool>;
                if (tempFunc != null)
                {
                    _pickPartsDetailFunc = tempFunc;
                }
                else
                {
                    MessageBoxs.Show(Trans.COM, this.ToString(), "请传入Func<PickPartsQueryUIModel, bool>,以便处理配件明细", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            #endregion

            #region 获取供应商查询条件
            if (_viewParameters.ContainsKey(ComViewParamKey.SpecialSupplierName.ToString()))
            {
                var stringSupplierName = _viewParameters[ComViewParamKey.SpecialSupplierName.ToString()] as string;
                if (stringSupplierName != null)
                {
                    mcbWhere_Supplier.SelectedText = Convert.ToString(_viewParameters[ComViewParamKey.SpecialSupplierName.ToString()]);
                    mcbWhere_Supplier.Enabled      = false;
                }
            }
            if (_viewParameters.ContainsKey(ComViewParamKey.SpecialSupplierID.ToString()))
            {
                var stringSupplierId = _viewParameters[ComViewParamKey.SpecialSupplierID.ToString()] as string;
                if (stringSupplierId != null)
                {
                    mcbWhere_Supplier.SelectedValue = Convert.ToString(_viewParameters[ComViewParamKey.SpecialSupplierID.ToString()]);
                }
            }
            #endregion

            #endregion

            if (ListSelectionMode == CustomEnums.CustomeSelectionMode.Multiple)
            {
                //可多选
                gdGrid.DisplayLayout.Bands[0].Columns[SysConst.IsChecked].Header.CheckBoxVisibility = HeaderCheckBoxVisibility.Always;
            }
            else
            {
                //只能单选
                gdGrid.DisplayLayout.Bands[0].Columns[SysConst.IsChecked].Header.CheckBoxVisibility = HeaderCheckBoxVisibility.Never;
            }
        }
コード例 #14
0
        /// <summary>
        /// 生成选中项的值和描述
        /// </summary>
        void GenerateSelectedValueAndText()
        {
            SelectedGridList = new List <CustomerQueryUIModel>();
            foreach (var loopSourceItem in ListGridDS)
            {
                if (!loopSourceItem.IsChecked)
                {
                    continue;
                }
                if (_sourceFormName == ComViewParamValue.CustomerQuerySourForm.SD_FrmSalesOrderManager ||
                    _sourceFormName == ComViewParamValue.CustomerQuerySourForm.SD_FrmProactiveSalesManager)
                {
                    //来源画面是[销售订单管理]、[主动销售管理]的场合
                    if (loopSourceItem.IsEndSales == true)
                    {
                        //客户loopSourceItem.CustomerName已终止销售,不能创建销售订单
                        MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0039, new object[] { loopSourceItem.CustomerName, SystemTableEnums.Name.SD_SalesOrder }), MessageBoxButtons.OK, MessageBoxIcon.Information);
                        loopSourceItem.IsChecked = false;
                        gdGrid.DataSource        = ListGridDS;
                        gdGrid.DataBind();
                    }
                }
                if (loopSourceItem.IsChecked)
                {
                    CustomerQueryUIModel argsCustomerQuery = new CustomerQueryUIModel
                    {
                        CustomerType       = loopSourceItem.CustomerType,
                        CustomerID         = loopSourceItem.CustomerID,
                        CustomerName       = loopSourceItem.CustomerName,
                        AutoFactoryCode    = loopSourceItem.AutoFactoryCode,
                        AutoFactoryName    = loopSourceItem.AutoFactoryName,
                        AutoFactoryOrgCode = loopSourceItem.AutoFactoryOrgCode,
                        AutoFactoryOrgID   = loopSourceItem.AutoFactoryOrgID,
                        CustomerPhoneNo    = loopSourceItem.CustomerPhoneNo,
                        CustomerAddress    = loopSourceItem.CustomerAddress,
                        CreditAmount       = loopSourceItem.CreditAmount,
                        DebtAmount         = loopSourceItem.DebtAmount,
                        PaymentTypeCode    = loopSourceItem.PaymentTypeCode,
                        PaymentTypeName    = loopSourceItem.PaymentTypeName,
                        BillingTypeCode    = loopSourceItem.BillingTypeCode,
                        BillingTypeName    = loopSourceItem.BillingTypeName,
                        DeliveryTypeCode   = loopSourceItem.DeliveryTypeCode,
                        DeliveryTypeName   = loopSourceItem.DeliveryTypeName,
                        DeliveryByID       = loopSourceItem.DeliveryByID,
                        DeliveryByName     = loopSourceItem.DeliveryByName,
                        IsEndSales         = loopSourceItem.IsEndSales,
                        AutoPartsPriceType = loopSourceItem.AutoPartsPriceType,

                        Wal_ID               = loopSourceItem.Wal_ID,
                        Wal_No               = loopSourceItem.Wal_No,
                        Wal_Org_ID           = loopSourceItem.Wal_Org_ID,
                        Wal_Org_Name         = loopSourceItem.Wal_Org_Name,
                        Wal_AvailableBalance = loopSourceItem.Wal_AvailableBalance,

                        //汽修商户组织信息
                        AutoFactoryOrgInfo = loopSourceItem.CustomerID + SysConst.Semicolon_DBC + loopSourceItem.AutoFactoryOrgID
                                             + SysConst.Semicolon_DBC + loopSourceItem.AutoFactoryOrgCode,
                    };
                    SelectedGridList.Add(argsCustomerQuery);
                }
            }
        }
コード例 #15
0
        /// <summary>
        /// 查询
        /// </summary>
        public void QueryAction()
        {
            if (cbWhere_CustomerType.Text == CustomerTypeEnum.Name.PTNQXSH &&
                (string.IsNullOrEmpty(mcbWhere_AutoFactoryName.SelectedText) ||
                 string.IsNullOrEmpty(mcbWhere_AutoFactoryName.SelectedValue)))
            {
                //请选择汽修商户
                MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0013, new object[] { MsgParam.AUTOFACTORY }), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            List <CustomerQueryUIModel> resultCustomerList = new List <CustomerQueryUIModel>();

            _bll.QueryForList(SQLID.COMM_SQL11, new CustomerQueryQCModel
            {
                PageSize  = PageSize,
                PageIndex = PageIndex,
                //客户类型
                WHERE_CustomerType = cbWhere_CustomerType.Text.Trim(),
                //客户名称
                WHERE_CustomerName = txtWhere_CustomerName.Text.Trim(),
                //汽修商户名称
                WHERE_AutoFactoryName = mcbWhere_AutoFactoryName.SelectedText,
                //组织ID
                WHERE_OrgID = LoginInfoDAX.UserID == SysConst.SUPER_ADMIN ? null : LoginInfoDAX.OrgID,
            }, resultCustomerList);

            if (cbWhere_CustomerType.Text == CustomerTypeEnum.Name.PTNQXSH)
            {
                ListGridDS = new List <CustomerQueryUIModel>();

                //根据指定的汽修商户数据库信息获取Venus组织列表
                List <MDLSM_Organization> tempVenusOrgList = new List <MDLSM_Organization>();
                BLLCom.QueryAutoFactoryCustomerOrgList(mcbWhere_AutoFactoryName.SelectedValue, tempVenusOrgList);

                foreach (var loopVenusOrg in tempVenusOrgList)
                {
                    foreach (var loopCustomer in resultCustomerList)
                    {
                        if (loopCustomer.AutoFactoryOrgCode == loopVenusOrg.Org_Code &&
                            loopCustomer.CustomerName == loopVenusOrg.Org_ShortName)
                        {
                            CustomerQueryUIModel authorityVenusOrg = new CustomerQueryUIModel()
                            {
                                CustomerType         = loopCustomer.CustomerType,
                                CustomerID           = loopCustomer.CustomerID,
                                CustomerName         = loopCustomer.CustomerName,
                                AutoFactoryCode      = loopCustomer.AutoFactoryCode,
                                AutoFactoryName      = loopCustomer.AutoFactoryName,
                                AutoFactoryOrgID     = loopVenusOrg.Org_ID,
                                AutoFactoryOrgCode   = loopCustomer.AutoFactoryOrgCode,
                                CustomerPhoneNo      = loopCustomer.CustomerPhoneNo,
                                CustomerAddress      = loopCustomer.CustomerAddress,
                                CreditAmount         = loopCustomer.CreditAmount,
                                DebtAmount           = loopCustomer.DebtAmount,
                                PaymentTypeCode      = loopCustomer.PaymentTypeCode,
                                PaymentTypeName      = loopCustomer.PaymentTypeName,
                                BillingTypeCode      = loopCustomer.BillingTypeCode,
                                BillingTypeName      = loopCustomer.BillingTypeName,
                                DeliveryTypeCode     = loopCustomer.DeliveryTypeCode,
                                DeliveryTypeName     = loopCustomer.DeliveryTypeName,
                                DeliveryByID         = loopCustomer.DeliveryByID,
                                DeliveryByName       = loopCustomer.DeliveryByName,
                                DeliveryByPhone      = loopCustomer.DeliveryByPhone,
                                IsEndSales           = loopCustomer.IsEndSales,
                                AutoPartsPriceType   = loopCustomer.AutoPartsPriceType,
                                Wal_ID               = loopCustomer.Wal_ID,
                                Wal_No               = loopCustomer.Wal_No,
                                Wal_Org_ID           = loopCustomer.Wal_Org_ID,
                                Wal_Org_Name         = loopCustomer.Wal_Org_Name,
                                Wal_AvailableBalance = loopCustomer.Wal_AvailableBalance,
                                RowID       = loopCustomer.RowID,
                                RecordCount = loopCustomer.RecordCount,
                                //汽修商户组织信息
                                AutoFactoryOrgInfo = loopCustomer.CustomerID + SysConst.Semicolon_DBC + loopVenusOrg.Org_ID + SysConst.Semicolon_DBC + loopCustomer.AutoFactoryOrgCode,
                            };
                            ListGridDS.Add(authorityVenusOrg);
                        }
                    }
                }
            }
            else
            {
                _bll.CopyModelList(resultCustomerList, ListGridDS);
            }

            gdGrid.DataSource = ListGridDS;
            gdGrid.DataBind();

            if (ListGridDS.Count > 0)
            {
                dynamic subObject = ListGridDS[0];

                TotalRecordCount = subObject.RecordCount;
            }
            else
            {
                TotalRecordCount = 0;
            }
            //设置翻页控件
            SetBarPaging(TotalRecordCount);
            //设置单元格是否可以编辑
            SetPayConfirmWindowStyle();
        }