Ejemplo n.º 1
0
        /// 初始化界面绑定
        private void InitFormValues()
        {
            dateCreateTrade.DateTime = DateTime.Now;                                     //订单时间
            dateEndTrade.DateTime    = DateTime.Now.AddDays(Constants.DEFAULT_END_DAYS); //默认为15天过后

            #region 客户名称
            cmbConsumerName.Properties.DataSource = ConsumerService.GetAllConsumer();
            cmbConsumerName.Properties.NullText   = "请选择客户";
            #endregion

            #region 收款方式
            cmbPayWay.Properties.DataSource = CodeService.GetCode(p => p.CodeCategory == Constants.CODE_TRADE_TYPE);
            cmbPayWay.EditValue             = Constants.DEFAULT_TRADE_TYPE;
            #endregion

            #region 销售人员
            cmbSeller.Properties.DataSource = UserService.GetAllUser();//待添加条件选择
            cmbSeller.Properties.NullText   = "请选择销售人员";
            #endregion

            #region 承担方式
            cmbStandWay.Properties.DataSource = CodeService.GetCode(p => p.CodeCategory == Constants.CODE_POSTFEE_OWNER);
            cmbStandWay.EditValue             = Constants.DEFAULT_POSTFEE_OWNER;
            #endregion

            #region 物流信息系列绑定
            try
            {
                cmbShippingType.Properties.DataSource = CodeService.GetCode(p => p.CodeCategory == Constants.CODE_SHIPPING_TYPE);
                cmbShippingType.EditValue             = Constants.DEFAULT_SHIPPING_TYPE;

                // 物流公司
                List <LogisticCompany> companySource = LogisticCompanyService.GetLogisticCompany(p => p.shippingType == cmbShippingType.EditValue.ToString());
                cmbShipCompany.Properties.DataSource = companySource;
                cmbShipCompany.EditValue             = companySource.FirstOrDefault(p => p.isdefault == true).code;

                //物流模板
                List <LogisticCompanyTemplate> templateSource = LogisticCompanyTemplateService.GetLogisticCompanyTemplate(p => p.LogisticCompanyCode == cmbShipCompany.EditValue.ToString());
                cmbShippingTemplate.Properties.DataSource = templateSource;
                cmbShippingTemplate.EditValue             = templateSource.FirstOrDefault().TemplateCode;
            }
            catch (Exception ex)
            {
            }

            #endregion

            #region  所属店铺
            cmbOwnerShop.Properties.DataSource = ShopService.GetAllShop();
            cmbOwnerShop.Properties.NullText   = "请选择店铺";
            cmbOwnerShop.Properties.PopupWidth = 400;
            #endregion

            radioHasTicket.EditValue = false; //默认不开票
            txtPostFee.Text          = "10";  //默认邮费为10元
            txtDiscountRate.Text     = "1.0"; //默认不打折
            txtDicountOutFee.Text    = "0.0";
            txtDiscountFee.Text      = "0.0";
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 客户
        /// </summary>
        /// <param name="treeList"></param>
        public void GetConsumer(TreeList treeList)
        {
            List <Alading.Entity.Consumer> list = ConsumerService.GetAllConsumer();

            foreach (Alading.Entity.Consumer item in list)
            {
                TreeListNode node = treeList.AppendNode(new object[] { item.nick }, null, item.alipay);
                //设置是否有子节点,有则会显示一个+号
                node.HasChildren = false;
            }
        }