public Sales(SaleObject sale)
 {
     InitializeComponent();
     InitializeListView(sales_list);
     MaximizeBox     = !MaximizeBox;
     MinimizeBox     = !MinimizeBox;
     FormBorderStyle = FormBorderStyle.FixedSingle;
     _sale           = sale;
 }
示例#2
0
 public int UpdateSale(SaleObject sale)
 {
     try
     {
         return(_saleRepository.UpdateSale(sale));
     }
     catch (Exception ex)
     {
         ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message);
         return(-2);
     }
 }
        public AccountChange(string recMoney, ListView recPoints, string recItems)
        {
            InitializeComponent();

            MaximizeBox     = !MaximizeBox;
            MinimizeBox     = !MinimizeBox;
            FormBorderStyle = FormBorderStyle.FixedSingle;

            reg_goods_sum.Text  = Form1.RegItemPriceSum.ToString();
            received_money.Text = recMoney;
            change.Text         = (int.Parse(received_money.Text) - int.Parse(reg_goods_sum.Text)).ToString();

            _itemList = recPoints;

            _sale = new SaleObject(
                recPoints.Items.Count,
                Form1.RegItemPriceSum,
                recItems,
                Config.GetInstance().Store.Id,
                PosInformation.GetInstance().GetStaffBarcode());
            new Database().Insert(_sale);
        }
示例#4
0
        public int UpdateSale(SaleObject sale)
        {
            try
            {
                if (sale == null)
                {
                    return(-2);
                }

                var saleEntity = ModelCrossMapper.Map <SaleObject, Sale>(sale);
                if (saleEntity == null || saleEntity.SaleId < 1)
                {
                    return(-2);
                }
                _repository.Update(saleEntity);
                _uoWork.SaveChanges();
                return(5);
            }
            catch (Exception ex)
            {
                ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message);
                return(-2);
            }
        }
示例#5
0
        public long AddSale(SaleObject sale)
        {
            try
            {
                if (sale == null)
                {
                    return(-2);
                }

                var saleEntity = ModelCrossMapper.Map <SaleObject, Sale>(sale);
                if (saleEntity == null || saleEntity.AmountDue < 1)
                {
                    return(-2);
                }
                var returnStatus = _repository.Add(saleEntity);
                _uoWork.SaveChanges();
                return(returnStatus.SaleId);
            }
            catch (Exception ex)
            {
                ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message);
                return(0);
            }
        }
示例#6
0
 public long UpdateSalePayment(SaleObject sale, UserProfileObject userProfile)
 {
     return(_saleRepository.UpdateSalePayment(sale, userProfile));
 }
示例#7
0
 public long AddSale(SaleObject sale, out string invoiceRef)
 {
     return(_saleRepository.AddSale(sale, out invoiceRef));
 }