示例#1
0
    private void displayCustomerShop(CustomerShopInfo customerShop)
    {
        if (customerShop == null)
        {
            return;
        }

        this.tbCustomerCode.Text   = customerShop.Customer.Code;
        this.tbCustomerName.Text   = customerShop.Customer.Name;
        this.tbCustomerStatus.Text = customerShop.Customer.StatusDescription;

        this.tbShopCode.Text        = customerShop.Code;
        this.tbShopName.Text        = customerShop.Name;
        this.tbShopEnglishName.Text = customerShop.EnglishName;
        this.tbShopShortName.Text   = customerShop.ShortName;
        this.tbShopProvince.Text    = customerShop.Province;
        this.tbShopCity.Text        = customerShop.City;
        this.tbShopCountry.Text     = customerShop.Country;
        this.tbShopAddress.Text     = customerShop.Address;
        this.tbShopPostcode.Text    = customerShop.PostCode;
        this.tbShopContact.Text     = customerShop.Contact;
        this.tbShopTel.Text         = customerShop.Tel;
        this.tbShopFax.Text         = customerShop.Fax;
        this.tbShopEmail.Text       = customerShop.Email;
        this.tbShopStatus.Text      = customerShop.StatusDescription;
        this.tbShopRemark.Text      = customerShop.Remark;

        //this.tbSysModifyTime.Text = PageHelper.FormatDateTime(customerShop.LastSystemModifyStamp);
    }
示例#2
0
        /// <summary>
        /// 根据客户号与门店号码获取门店初始化详细信息
        /// </summary>
        /// <param name="customer_code">客户号</param>
        /// <param name="unit_code">门店号</param>
        /// <param name="strError">错误信息输出</param>
        /// <returns></returns>
        public InitialInfo GetPCInitialInfo(string customer_code, string unit_code, out string strError)
        {
            CustomerService customerService = new CustomerService();
            InitialInfo     initialInfo     = new InitialInfo();
            //获取客户标识
            string costomer_id = new CustomerService().GetCustomerIdByCode(customer_code);

            if (costomer_id.Equals(""))
            {
                strError = "客户不存在";
            }
            else
            {
                CustomerInfo customerInfo = new CustomerInfo();
                //获取客户信息
                customerInfo = customerService.GetCustomerByID(costomer_id, false, false);
                CustomerShopInfo customerShopInfo = new CustomerShopInfo();
                //获取门店标识
                string unit_id = customerService.GetCustomerShopIdByCode(customer_code, unit_code);
                if (unit_id.Equals(""))
                {
                    strError = "门店不存在";
                }
                else
                {
                    //获取门店信息
                    customerShopInfo = customerService.GetCustomerShopByID(unit_id);
                }
                strError = "ok";

                initialInfo.customerInfo     = customerInfo;
                initialInfo.customerShopInfo = customerShopInfo;
            }
            return(initialInfo);
        }
    public bool SynUnit(string customerID, int typeID, string unitInfo)
    {
        this.log(LogLevel.DEBUG, FunctionName.WS_SYS_UNIT, MessageType.PARAMATER, "customerID: " + customerID);
        this.log(LogLevel.DEBUG, FunctionName.WS_SYS_UNIT, MessageType.PARAMATER, "typeID: " + typeID.ToString());
        this.log(LogLevel.DEBUG, FunctionName.WS_SYS_UNIT, MessageType.PARAMATER, "unitInfo: " + unitInfo);

        //验证参数
        bool ret = ArgumentHelper.Validate("customerID", customerID, false);

        if (!ret)
        {
            this.log(LogLevel.ERROR, FunctionName.WS_SYS_UNIT, "customerID", "参数不正确");
            this.log(LogLevel.INFO, FunctionName.WS_SYS_UNIT, MessageType.RESULT, ret.ToString());
            return(ret);
        }

        CustomerConnectInfo cConnect = this.GetCustomerService().GetCustomerConnectByID(customerID);

        if (cConnect == null)
        {
            this.log(LogLevel.ERROR, FunctionName.WS_SYS_UNIT, "CustomerConnect", "未找到");
            this.log(LogLevel.INFO, FunctionName.WS_SYS_UNIT, MessageType.RESULT, "false");
            return(false);
        }

        if (typeID < 1 || typeID > 4)
        {
            this.log(LogLevel.ERROR, FunctionName.WS_SYS_UNIT, "typeID", "参数不正确");
            this.log(LogLevel.INFO, FunctionName.WS_SYS_UNIT, MessageType.RESULT, "false");
            return(false);
        }

        //解密
        cPos.Admin.Service.BaseService base_service = this.GetCustomerService() as cPos.Admin.Service.BaseService;
        string s = base_service.DecryptStringByCustomer(customerID, unitInfo);

        this.log(LogLevel.DEBUG, FunctionName.WS_SYS_UNIT, "DecryptCustomerUnit", s);

        CustomerShopInfo shop = (CustomerShopInfo)XMLGenerator.Deserialize(typeof(CustomerShopInfo), s);

        shop.Customer.ID = customerID;
        switch (typeID)
        {
        case 1:    //新建
            ret = this.GetCustomerService().InsertCustomerShopFromCP(shop);
            break;

        case 2:    //修改
            ret = this.GetCustomerService().ModifyCustomerShopFromCP(shop);
            break;

        case 3:    //启用
            ret = this.GetCustomerService().EnableCustomerShopFromCP(shop);
            break;

        case 4:    //停用
            ret = this.GetCustomerService().DisableCustomerShopFromCP(shop);
            break;

        default:
            ret = false;
            break;
        }
        this.log(LogLevel.INFO, FunctionName.WS_SYS_UNIT, MessageType.RESULT, ret.ToString());
        return(ret);
    }