コード例 #1
0
        public CustomerInfoServiceTest()
        {
            var unitOfWork = new UnitOfWork();

            _customerRepository  = new CustomerRepository(unitOfWork);
            _customerInfoService = new CustomerInfoService(unitOfWork, _customerRepository);
        }
コード例 #2
0
        private async Task <List <Customer> > InitializeDataAsync()
        {
            var CustomerService = new CustomerInfoService();

            customerList = await CustomerService.GetAllCustomers();

            return(customerList);
        }
コード例 #3
0
        public IActionResult OnGet()
        {
            var info = new CustomerInfoService(HttpContext.Session).Get();

            if (info == null)
            {
                return(RedirectToPage("/Checkout/CustomerInformation"));
            }
            return(Page());
        }
コード例 #4
0
        public IActionResult OnGet()
        {
            var order = new CustomerInfoService(HttpContext.Session).Get();

            if (order == null)
            {
                return(Page());
            }
            return(RedirectToPage("/Checkout/Payment"));
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var url = "customerlist.aspx";
            var cid = Request.QueryString["cid"].ToInt32();

            if (cid <= 0)
            {
                Redirect(url);
            }
            ICustomerInfoService _customerInfoService = new CustomerInfoService(_user);

            _model = _customerInfoService.GetById(cid);
            if (_model == null)
            {
                Redirect(url);
            }
        }
コード例 #6
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        private void InitData()
        {
            string errText = "";

            if (_customerInfoService == null)
            {
                _customerInfoService = new CustomerInfoService();
            }
            var list = _customerInfoService.GetEntityList(out errText);

            if (list == null || list.Count == 0)
            {
                this.dataGridView1.DataSource = CreateDtTemplate();
                return;
            }
            this.dataGridView1.DataSource = list;
        }
コード例 #7
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            string errText;

            if (_customerInfoService == null)
            {
                _customerInfoService = new CustomerInfoService();
            }
            var i = _customerInfoService.DeleteEntity(out errText, _currentId);

            if (i == 0)
            {
                MessageBox.Show(errText);
                return;
            }
            MessageBox.Show("删除成功!");
            ClearPage();
            InitData();
        }
コード例 #8
0
        /// <summary>
        /// 查找会员
        /// </summary>
        /// <param name="customerName"></param>
        private void QueryData(string customerName)
        {
            if (string.IsNullOrEmpty(customerName))
            {
                MessageBox.Show("请输入查询的会员名!");
                return;
            }
            if (_customerInfoService == null)
            {
                _customerInfoService = new CustomerInfoService();
            }
            string errText;
            var    result = _customerInfoService.QueryCustomerInfo(out errText, customerName);

            if (result == null || result.Count == 0)
            {
                MessageBox.Show("没有找到匹配的会员!");
                return;
            }
            this.dataGridView1.DataSource = result;
        }
コード例 #9
0
        /// <summary>
        /// 设置只读页面信息
        /// </summary>
        /// <param name="info"></param>
        private void SetReadOnlyPage(SalesInfo info)
        {
            if (_info == null)
            {
                ClearPage();
            }
            this.lblOrderNo.Text = info.SalesDocNo.ToString();
            UserInfoService _userInfoService = new UserInfoService();
            string          errText          = "";
            var             operatorName     = _userInfoService.GetUserNameById(out errText, info.OperatorId);

            this.lblOperator.Text = string.IsNullOrEmpty(operatorName) ? "" : operatorName;
            CustomerInfoService custmSrv = new CustomerInfoService();

            this.txtBoxCustomer.Text       = custmSrv.GetCustomerNameById(out errText, info.CustomerId);
            this.btnSelectCustomer.Visible = false;
            this.dtPicker1.Value           = info.SalesTime;
            this.dtPicker1.Enabled         = false;
            this.btnAdd.Visible            = this.btnDelete.Visible = this.btnCancel.Visible = this.btnOk.Visible = false;
            this.txtboxRemark.Text         = info.Remark;
            this.txtboxRemark.Enabled      = false;
            SetDetailInfo(info.SalesDocId);
        }
コード例 #10
0
 public CustomerHomeViewModel(Customer customer)
 {
     _customer            = customer;
     _customerInfoService = new CustomerInfoService(_customer);
     GetCustomerData();
 }
コード例 #11
0
 public CustomerInfoServiceTest()
 {
     this.customerInfoService = Resolve <CustomerInfoService>();
 }
コード例 #12
0
 public ChangePasswordViewModel(Customer customer)
 {
     _customer            = customer;
     _customerInfoService = new CustomerInfoService(_customer);
 }
コード例 #13
0
 public ChangeProfileDataViewModel(Customer customer)
 {
     _customer            = customer;
     _customerInfoService = new CustomerInfoService(_customer);
 }