protected void OnDepositSelected(Sales.Entities.Deposit item)
 {
     if (DepositSelected != null)
     {
         DepositSelected(this, item);
     }
 }
 public static Sales ModelToEnity(this SalesModel model, bool virtualActive = false)
 {
     Sales entity = new Sales()
     {
         AgenciesComission = model.AgenciesComission,
         Amount = model.Amount,
         BilgeTourCommission = model.BilgeTourCommission,
         CustomerId = model.CustomerId,
         EmployeeId = model.EmployeeId,
         IsCollect = model.IsCollect,
         IsSale = model.IsSale,
         PaymentMethodId = model.PaymentMethodId,
         ReserveDate = model.ReserveDate,
         SaleAgencyId = model.SaleAgencyId,
         Id = model.Id,
         IsActive = model.IsActive
     };
     if (virtualActive)
     {
         entity.PaymentMethod = model.PaymentMethod;
         entity.Customer = model.Customer;
         entity.Employee = model.Employee;
         entity.RoomSales = model.RoomSales;
     }
     return entity;
 }
        /// <summary>
        /// Checks for validation errors after invoice is saved
        /// </summary>
        public bool CheckForValidationError(Sales salesObject, string nameOfValidationError)
        {
            HtmlDiv validationErrorDiv = salesObject.SelectDivOnPage("notify01");
            var validationErrorCustomControl = validationErrorDiv.GetChildren();

            HtmlDiv currentValidationError = null;

            //loop throught the notification div to find if error exists
            foreach (var currentError in validationErrorCustomControl)
            {
                if (currentError.FriendlyName.Contains(nameOfValidationError))
                {
                    currentValidationError = (HtmlDiv)currentError;
                }
            }

            //check if div is present
            if (currentValidationError != null)
            {
                return true;
            }
            else
            {
                Assert.Fail("Validation box not thrown up");
            }

            return false;
        }
Example #4
0
        private static void Main(string[] args)
        {
            //Employee Jack = new Employee();
            //Console.Write("請輸入底薪($):");
            //Jack.BaseSalary = int.Parse(Console.ReadLine());
            //Console.Write("請輸入獎金($):");
            //Jack.Benefit = int.Parse(Console.ReadLine());

            //Console.WriteLine("薪水是:${0}", Jack.Salary);
            ///////////////////////////////////////////////////////////////////////////
            Sales sales = new Sales();
            //sales.                        //可看到新舊共四種屬性,但是prvate的欄位,子類別都看不到
        }
Example #5
0
        public ActionResult Create(MvcSales.Models.Sales sales)
        {
            User user = _user.Items.Where(m => m.Login == HttpContext.User.Identity.Name).FirstOrDefault();
            Sales sal = new Sales();
            if (user == null)
            {
                return RedirectToAction("LogOff", "Account");
            }
            if (ModelState.IsValid)
            {
                sal.Date = DateTime.Now;
                sal.Cost = sales.Cost;
                sal.ClientId = sales.ClientId;
                sal.GoodsId = sales.GoodsId;
                sal.ManagerId = sales.ManagerId;
                _sales.Add(sal);
                _sales.SaveChanges();

                return RedirectToAction("Index");
            }
            return View(sales);
        }
Example #6
0
    private void PopulateHistoryandSales()
    {
        using (BooksDataContext bookData = new BooksDataContext())
        {
            var myBooks = from book in bookData.Products
                          where book.UserName == this.User.Identity.Name
                          orderby book.ProductID descending
                          select new { book.ProductID, book.Name, book.Price, book.ISBN };
            GridView1.DataSource = myBooks;
            GridView1.DataBind();
        }

        using (BooksDataContext bookData = new BooksDataContext())
        {

            var orderHis = from book in bookData.Products
                           join ordLine in bookData.OrderLines on book.ProductID equals ordLine.ProductID
                           where book.UserName == this.User.Identity.Name
                           orderby ordLine.OrderDate descending
                           select new
                           {
                               title = book.Name,
                               quantity = ordLine.Quantity,
                               total = ordLine.Price,
                           };
            Sales sales = new Sales();
            foreach (var item in orderHis)
            {
                sales.Title = item.title;
                sales.Quantity = item.quantity;
                sales.Total = (decimal)item.total;
                MySalesList.Add(sales);
            }
            GridView2.DataSource = MySalesList;
            GridView2.DataBind();

        }
    }
 public int InsertSales(Sales sl)
 {
     return btac.InsertSales(sl.Sa_ID,sl.Name, sl.Minage, sl.Maxage, sl.Rate, sl.Status);
 }
 public int DeleteSalesByName(Sales sl)
 {
     return btac.DeleteSalesByName(sl.Name);
 }
 public int DeleteSalesByID(Sales sl)
 {
     return btac.DeleteSalesByID(sl.Sa_ID);
 }
Example #10
0
 public async Task InsertAsync(Sales obj)
 {
     _context.Add(obj);
     await _context.SaveChangesAsync();
 }
 public int UpdateSalesByName(Sales sl)
 {
     return btac.UpdateSalesByName(sl.Name, sl.Minage, sl.Maxage, sl.Rate, sl.Status);
 }
 public EmployeeController(Sales database)
 {
     db = database;
 }
Example #13
0
        private async Task <bool> ImportEntryData(string fileType, List <CSVDataSummary> eslst, int docSetId, bool overWriteExisting)
        {
            try
            {
                var ed = (from es in eslst
                          group es by new { es.EntryDataId, es.EntryDataDate, es.CustomerName, es.SupplierCode }
                          into g
                          let supplier = EntryDataDS.DataModels.BaseDataModel.Instance.SearchSuppliers(new List <string>()
                {
                    string.Format("SupplierCode == \"{0}\"", g.Key.SupplierCode)
                })

                                         //where supplier != null
                                         select new
                {
                    e =
                        new
                    {
                        EntryDataId = g.Key.EntryDataId,
                        EntryDataDate = g.Key.EntryDataDate,
                        AsycudaDocumentSetId = docSetId,
                        CustomerName = g.Key.CustomerName,
                        Tax = g.Sum(x => x.Tax),
                        Supplier = supplier
                    },
                    d = g.Select(x => new  EntryDataDetails()
                    {
                        EntryDataId = x.EntryDataId,
                        ItemNumber = x.ItemNumber.ToUpper(),
                        ItemDescription = x.ItemDescription,
                        Cost = Convert.ToDouble(x.Cost),
                        Quantity = Convert.ToDouble(x.Quantity),
                        Units = x.Units,
                        Freight = x.Freight,
                        Weight = x.Weight,
                        InternalFreight = x.InternalFreight
                    }),
                    f = g.Select(x => new
                    {
                        TotalWeight = x.TotalWeight,
                        TotalFreight = x.TotalFreight,
                        TotalInternalFreight = x.TotalInternalFreight
                    })
                }).ToList();

                if (ed == null)
                {
                    return(true);
                }


                List <EntryData> eLst = null;

                foreach (var item in ed)
                {
                    // check Existing items
                    var olded = await GetEntryData(item.e.EntryDataId, item.e.EntryDataDate).ConfigureAwait(false);

                    if (olded != null)
                    {
                        switch (overWriteExisting)
                        {
                        case true:
                            await ClearEntryDataDetails(olded).ConfigureAwait(false);
                            await DeleteEntryData(olded).ConfigureAwait(false);

                            break;

                        case false:
                            continue;
                        }
                    }


                    switch (fileType)
                    {
                    case "Sales":

                        var EDsale = new Sales(true)
                        {
                            EntryDataId   = item.e.EntryDataId,
                            EntryDataDate = item.e.EntryDataDate,
                            INVNumber     = item.e.EntryDataId,
                            TaxAmount     = item.e.Tax,
                            CustomerName  = item.e.CustomerName,
                            TrackingState = TrackingState.Added
                        };
                        EDsale.AsycudaDocumentSets.Add(new AsycudaDocumentSetEntryData(true)
                        {
                            AsycudaDocumentSetId = item.e.AsycudaDocumentSetId,
                            EntryDataId          = item.e.EntryDataId,
                            TrackingState        = TrackingState.Added
                        });
                        await CreateSales(EDsale).ConfigureAwait(false);

                        break;

                    case "PO":
                        var EDpo = new PurchaseOrders(true)
                        {
                            EntryDataId          = item.e.EntryDataId,
                            EntryDataDate        = item.e.EntryDataDate,
                            PONumber             = item.e.EntryDataId,
                            TrackingState        = TrackingState.Added,
                            TotalFreight         = item.f.Sum(x => x.TotalFreight),
                            TotalInternalFreight = item.f.Sum(x => x.TotalInternalFreight),
                            TotalWeight          = item.f.Sum(x => x.TotalWeight)
                        };
                        EDpo.AsycudaDocumentSets.Add(new AsycudaDocumentSetEntryData(true)
                        {
                            AsycudaDocumentSetId = item.e.AsycudaDocumentSetId,
                            EntryDataId          = item.e.EntryDataId,
                            TrackingState        = TrackingState.Added
                        });
                        await CreatePurchaseOrders(EDpo).ConfigureAwait(false);

                        break;

                    case "OPS":
                        var EDops = new OpeningStock(true)
                        {
                            EntryDataId          = item.e.EntryDataId,
                            EntryDataDate        = item.e.EntryDataDate,
                            OPSNumber            = item.e.EntryDataId,
                            TrackingState        = TrackingState.Added,
                            TotalFreight         = item.f.Sum(x => x.TotalFreight),
                            TotalInternalFreight = item.f.Sum(x => x.TotalInternalFreight),
                            TotalWeight          = item.f.Sum(x => x.TotalWeight)
                        };
                        EDops.AsycudaDocumentSets.Add(new AsycudaDocumentSetEntryData(true)
                        {
                            AsycudaDocumentSetId = item.e.AsycudaDocumentSetId,
                            EntryDataId          = item.e.EntryDataId,
                            TrackingState        = TrackingState.Added
                        });
                        await CreateOpeningStock(EDops).ConfigureAwait(false);

                        break;

                    default:
                        throw new ApplicationException("Unknown FileType");
                        return(true);
                    }

                    if (item.d.Count() == 0)
                    {
                        throw new ApplicationException(item.e.EntryDataId + " has no details");
                    }

                    var details = item.d;

                    using (var ctx = new EntryDataDetailsService())
                    {
                        foreach (var e in details)
                        {
                            await ctx.CreateEntryDataDetails(new EntryDataDetails(true)
                            {
                                EntryDataId     = e.EntryDataId,
                                ItemNumber      = e.ItemNumber,
                                ItemDescription = e.ItemDescription,
                                Quantity        = e.Quantity,
                                Cost            = e.Cost,
                                Units           = e.Units,
                                TrackingState   = TrackingState.Added,
                                Freight         = e.Freight,
                                Weight          = e.Weight,
                                InternalFreight = e.InternalFreight,
                            }).ConfigureAwait(false);
                        }
                    }
                }


                return(false);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #14
0
 public ABCPOS(IConfiguration config)
 {
     _SalesManager = new Sales(config.GetConnectionString("School"));
 }
Example #15
0
File: User.cs Project: tercini/shop
 public decimal?TotalSales(DateTime initial, DateTime final)
 {
     return(Sales.Where(s => s.Date >= initial && s.Date <= final).Sum(s => s.Total));
 }
Example #16
0
File: User.cs Project: tercini/shop
 public void RemoveSales(Sale s)
 {
     Sales.Remove(s);
 }
Example #17
0
File: User.cs Project: tercini/shop
 public void AddSales(Sale s)
 {
     Sales.Add(s);
 }
 public DataTable SelectSalesByID(Sales sl)
 {
     return btac.GetSalesByID(sl.Sa_ID);
 }
 public DataTable SelectSalesByName(Sales sl)
 {
     return btac.GetSalesByName(sl.Name);
 }
 public async Task Add(Sales sale)
 {
     _context.Sales.Add(sale);
 }
Example #21
0
        private XmlResource CreateUpdatedResource(Enums.ResourceType resourceType, string id,
                                                  string fieldAlias, string fieldValue)
        {
            XmlResource result = null;

            switch (resourceType)
            {
            case Enums.ResourceType.Client:
                result = new Client()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Activity:
                result = new Activity()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Sales:
                result = new Sales()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Contract:
                result = new Contract()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Process:
                result = new Process()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Job:
                result = new Job()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Recruiter:
                result = new Recruiter()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Resume:
                result = new Resume()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Candidate:
                result = new Candidate()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;
            }
            return(result);
        }
 public IList<CommandResponse> Save(Sales.Models.CustomerRegisterHelper.SaveRequest request)
 {
     return crh.Save(request);
 }
        private void submit_Click(object sender, EventArgs e)
        {
            if (this.name.Text == "")
            {
                MessageBox.Show("请输入用户名");
                return;
            }
            if (this.pass.Text == "")
            {
                MessageBox.Show("请输入密码");
                return;
            }

            //1-6权限分别对应售货,员工,收支,购物卡,设备,仓库,0为最高权限,可以进入所有模块
            String checkName = "select * from loginInfo where userName='******'" ;

            DBOperation op = new DBOperation();
            DataTable namedt = op.getDataTable(checkName, "loginInfo");
            if (namedt.Rows.Count == 0)
            {
                MessageBox.Show("用户名错误");
                return;
            }

            else
            {
                String password = namedt.Rows[0]["password"].ToString();
                String priv = namedt.Rows[0]["privilege"].ToString();

                String md5pass = AddAccount.MD5(this.pass.Text);

                if (!password.Equals(md5pass))
                {
                    MessageBox.Show("密码错误");
                }
                else
                {
                    if (Welcome.current.Equals("worker"))
                    {
                        if (priv.Equals("2") || priv.Equals("0"))
                        {
                            this.workers = new worker();
                            this.before();
                            this.workers.ShowDialog();
                            this.after();
                            this.workers.Dispose();
                        }
                        else
                        {
                            MessageBox.Show("您没有权限访问此模块");
                            this.name.Text = "";
                            this.pass.Text = "";
                        }
                    }

                    else if (Welcome.current.Equals("card"))
                    {
                        if (priv.Equals("4") || priv.Equals("0"))
                        {
                            cards = new Cards();
                            this.before();
                            cards.ShowDialog();
                            this.after();
                            cards.Dispose();
                        }

                        else
                        {
                            MessageBox.Show("您没有权限访问此模块");
                            this.name.Text = "";
                            this.pass.Text = "";
                        }
                    }

                    else if (Welcome.current.Equals("warehouse"))
                    {
                        if (priv.Equals("6") || priv.Equals("0"))
                        {
                            dep = new Depository();
                            this.before();
                            dep.ShowDialog();
                            this.after();
                            dep.Dispose();
                        }

                        else
                        {
                            MessageBox.Show("您没有权限访问此模块");
                            this.name.Text = "";
                            this.pass.Text = "";
                        }
                    }

                    else if (Welcome.current.Equals("facility"))
                    {
                        if (priv.Equals("5") || priv.Equals("0"))
                        {
                            facility = new Facility();
                            this.before();
                            facility.ShowDialog();
                            this.after();
                            facility.Dispose();
                        }

                        else
                        {
                            MessageBox.Show("您没有权限访问此模块");
                            this.name.Text = "";
                            this.pass.Text = "";
                        }
                    }

                    else if (Welcome.current.Equals("information"))
                    {
                        if (priv.Equals("0"))
                        {
                            info = new Information();
                            this.before();
                            info.ShowDialog();
                            this.after();
                            info.Dispose();
                        }
                        else
                        {
                            MessageBox.Show("您没有权限访问此模块");
                            this.name.Text = "";
                            this.pass.Text = "";
                        }
                    }

                    else if (Welcome.current.Equals("finance"))
                    {
                        if (priv.Equals("3") || priv.Equals("0"))
                        {
                            finance = new FinancialForm();
                            this.before();
                            finance.ShowDialog();
                            this.after();
                            finance.Dispose();
                        }
                        else
                        {
                            MessageBox.Show("您没有权限访问此模块");
                            this.name.Text = "";
                            this.pass.Text = "";
                        }
                    }

                    else if (Welcome.current.Equals("sales"))
                    {
                        if (priv.Equals("1") || priv.Equals("0"))
                        {
                            sales = new Sales();
                            this.before();
                            sales.ShowDialog();
                            this.after();
                            sales.Dispose();
                        }

                        else
                        {
                            MessageBox.Show("您没有权限访问此模块");
                            this.name.Text = "";
                            this.pass.Text = "";
                        }
                    }

                    else if (Welcome.current.Equals("addCourse"))
                    {
                        if (priv.Equals("0"))
                        {
                            add = new AddAccount();
                            this.before();
                            add.ShowDialog();
                            this.after();
                            add.Dispose();
                        }
                        else
                        {
                            MessageBox.Show("您没有权限访问此模块");
                            this.name.Text = "";
                            this.pass.Text = "";
                        }
                    }

                }
            }
        }
        public DataTable Search(Sales sales)
        {

            //Connection
            string connectionString = @"Server=DESKTOP-CR4IGJV; Database=SMS_RAMPAGE; Integrated Security=True";
            SqlConnection sqlConnection = new SqlConnection(connectionString);

            //Command 

            string commandString = @"SELECT Category.Name AS Category, Product.Code ,Product.Name As Product, SUM(Sales_Details.Quantity) AS Sold_Qty,
SUM(Sales_Details.Quantity)*(SELECT SUM(Unit_Price) FROM Purchase_Details WHERE Purchase_Details.Product_Id=Sales_Details.Product_Id GROUP BY Purchase_Details.Product_Id)/COUNT(*) AS CP,
SUM(Sales_Details.Quantity)*(SELECT SUM(MRP) FROM Purchase_Details WHERE Purchase_Details.Product_Id=Sales_Details.Product_Id GROUP BY Purchase_Details.Product_Id)/COUNT(*) AS Sales_Price,
SUM(Sales_Details.Quantity)*(SELECT SUM(MRP) FROM Purchase_Details WHERE Purchase_Details.Product_Id=Sales_Details.Product_Id GROUP BY Purchase_Details.Product_Id)/COUNT(*)-SUM(Sales_Details.Quantity)*(SELECT SUM(Unit_Price) FROM Purchase_Details WHERE Purchase_Details.Product_Id=Sales_Details.Product_Id GROUP BY Purchase_Details.Product_Id)/COUNT(*) AS Profit
FROM Sales_Details LEFT JOIN Product ON Sales_Details.Product_Id=Product.Id
LEFT JOIN Category ON Product.Category_Id=Category.Id
LEFT JOIN Sales ON Sales_Details.Sales_Id=Sales.Id WHERE Sales.Date1>='"+sales.Date1+"' and Sales.Date1<='"+sales.Date2+"' Group by Sales_Details.Product_Id,Product.Name,Product.Code, Category.Name";
            SqlCommand sqlCommand = new SqlCommand(commandString, sqlConnection);

            //Open
            sqlConnection.Open();

            //Show
            //With DataAdapter
            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
            DataTable dataTable = new DataTable();
            sqlDataAdapter.Fill(dataTable);

            //With DataAdapter
            //SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();

            //List<Customer> customers = new List<Customer>();

            //while (sqlDataReader.Read())
            //{
            //    Customer customer = new Customer();
            //    //District district = new District();
            //    customer.Id = Convert.ToInt32(sqlDataReader["Id"]);
            //    customer.Code = sqlDataReader["Code"].ToString();
            //    customer.Name = sqlDataReader["Name"].ToString();
            //    customer.Address = sqlDataReader["Address"].ToString();
            //    customer.Contact = sqlDataReader["Contact"].ToString();
            //    customer.District_Id =Convert.ToInt32(sqlDataReader["District_Id"]);
            //    // district.Name = sqlDataReader["District_Name"].ToString();

            //    customers.Add(customer);
            //}
            //if (sqlDataReader.NextResult())
            //{
            //    while (sqlDataReader.Read())
            //    {
            //        District district = new District();
            //        district.Name = sqlDataReader["District_Name"].ToString();
            //        //customers.Add(district);       
            //    }
            //}

            //if (dataTable.Rows.Count > 0)
            //{

            //    //showDataGridView.DataSource = dataTable;
            //}
            //else
            //{
            //    //MessageBox.Show("No Data Found");
            //}

            //Close
            sqlConnection.Close();
            //return dataTable;
            return dataTable;

        }
        public void CollectData(ISheet sheet)
        {
            var dbContext = new SupermarketsChainSqlServerEntities();

            var vendor = new Vendors();
            var product = new Products();
            var sale = new Sales();
            var supermarket = new Supermarkets();

            int quantity;
            string cellValue;

            int cell = 1;
            var saleCell = new Sales();
            for (int row = 1; row < sheet.LastRowNum; row++)
            {
                if (sheet.GetRow(row) != null)
                {

                    while (sheet.GetRow(row).GetCell(cell) != null && sheet.GetRow(row).GetCell(cell).ToString() != string.Empty)
                    {
                        cellValue = sheet.GetRow(row).GetCell(cell).ToString();

                        if (row == 1 && cell == 1)
                        {
                            vendor.Name = cellValue;
                            var supermarketName = vendor.Name.Substring(13);
                            supermarketName = supermarketName.Substring(0, supermarketName.Length - 1);
                            var supermarketTemp = dbContext.Supermarkets
                                    .Where(s => s.Name == supermarketName)
                                    .Select(s => s.Id)
                                    .FirstOrDefault();
                            saleCell.SupermarketId = supermarketTemp;
                        }
                        if (row > 2 && cellValue != null)
                        {
                            if (cell == 1)
                            {
                                product.Name = cellValue;
                                var productId = dbContext.Products
                                    .Where(p => p.Name == product.Name)
                                    .Select(p => p.Id)
                                    .FirstOrDefault();
                                saleCell.ProductId = productId;
                            }
                            if (cell == 2)
                            {
                                quantity = int.Parse(cellValue);
                                for (int quantityLines = 0; quantityLines < quantity; quantityLines++)
                                {
                                    var newCell = new Sales
                                                      {
                                                          ProductId = saleCell.ProductId,
                                                          SupermarketId = saleCell.SupermarketId,
                                                          OrderedOn = DateTime.Parse(this.DateOrder)
                                                      };
                                    dbContext.Sales.Add(newCell);
                                }

                                dbContext.SaveChanges();
                            }
                            if (cell == 3)
                            {
                                product.Price = decimal.Parse(cellValue);
                            }
                        }

                        cell++;
                    }
                }

                product.Name = string.Empty;
                cell = 1;
            }
        }
Example #26
0
        protected override void Seed(SalesContext context)
        {
            var sellers = new Seller[]
            {
                new Seller {
                    Id = 1, FirstName = "FirstSeller", LastName = "FirstSellerL"
                },
                new Seller {
                    Id = 2, FirstName = "SecondSeller", LastName = "SecondSellerL"
                },
                new Seller {
                    Id = 3, FirstName = "ThirdSeller", LastName = "ThirdSellerL"
                },
                new Seller {
                    Id = 4, FirstName = "FourthSeller", LastName = "FourthSellerL"
                },
                new Seller {
                    Id = 5, FirstName = "FifthSeller", LastName = "FifthSellerL"
                }
            };

            foreach (var author in sellers)
            {
                context.Sellers.Add(author);
            }

            var buyers = new Buyer[]
            {
                new Buyer {
                    Id = 1, FirstName = "FirdtBuyer", LastName = "FirdtBuyerL"
                },
                new Buyer {
                    Id = 2, FirstName = "SecondBuyer", LastName = "SecondBuyerL"
                },
                new Buyer {
                    Id = 3, FirstName = "ThirdBuyer", LastName = "ThirdBuyerL"
                },
                new Buyer {
                    Id = 4, FirstName = "FourthBuyer", LastName = "FourthBuyerL"
                },
                new Buyer {
                    Id = 5, FirstName = "FifthBuyer", LastName = "FifthBuyerL"
                }
            };

            foreach (var buyer in buyers)
            {
                context.Buyers.Add(buyer);
            }

            var salesI = new Sales[]
            {
                new Sales {
                    Id = 1, Date = new System.DateTime(2020, 04, 03), MoneySum = 900, Buyer = buyers[0], Seller = sellers[0]
                },
                new Sales {
                    Id = 2, Date = new System.DateTime(2020, 04, 03), MoneySum = 800, Buyer = buyers[1], Seller = sellers[1]
                },
                new Sales {
                    Id = 3, Date = new System.DateTime(2020, 04, 03), MoneySum = 700, Buyer = buyers[2], Seller = sellers[2]
                },
                new Sales {
                    Id = 4, Date = new System.DateTime(2020, 04, 03), MoneySum = 600, Buyer = buyers[3], Seller = sellers[3]
                },
                new Sales {
                    Id = 5, Date = new System.DateTime(2020, 04, 03), MoneySum = 500, Buyer = buyers[4], Seller = sellers[4]
                }
            };

            foreach (var sale in salesI)
            {
                context.SalesInfos.Add(sale);
            }

            base.Seed(context);
        }
Example #27
0
 void UpdateChart(Sales.MapItem salesItem) {
     chart.DataSource = ViewModel.GetSalesByCity(salesItem.City, ViewModel.Period).ToList();
 }
Example #28
0
 public bool SaveSalesProduct(Sales sales)
 {
     return(_salesRepository.SaveSalesProduct(sales));
 }