コード例 #1
0
 public void CheckDbConnection()
 {
     using (Billing_Customized_Entities billingEntities = new Billing_Customized_Entities())
     {
         billingEntities.AdminDetails.ToList();
     }
 }
コード例 #2
0
        public bool UpdateProductDetails(long productId, string productName, decimal quantity,
                                         decimal buyingPrice, decimal retailPrice, decimal wholesalePrice,
                                         decimal creditPrice, int gstPercentage)
        {
            bool isProductDetailsUpdated = false;

            using (Billing_Customized_Entities updateProductDetails = new Billing_Customized_Entities())
            {
                StockDetail stock = updateProductDetails.StockDetails.FirstOrDefault(obj => obj.ProductId == productId);

                if (stock != null)
                {
                    stock.ProductName       = productName;
                    stock.Quantity          = quantity;
                    stock.BuyingPrice       = Math.Round(buyingPrice, 2);
                    stock.RetailPrice       = Math.Round(retailPrice, 2);
                    stock.WholesalePrice    = Math.Round(wholesalePrice, 2);
                    stock.CreditPrice       = Math.Round(creditPrice, 2);
                    stock.GSTPercentage     = gstPercentage;
                    isProductDetailsUpdated = true;
                    updateProductDetails.SaveChanges();
                }

                return(isProductDetailsUpdated);
            }
        }
コード例 #3
0
 public List <WholeSaleBill> GetAllWholesaleSalesDetails()
 {
     using (Billing_Customized_Entities allSalesDetails = new Billing_Customized_Entities())
     {
         return(allSalesDetails.WholeSaleBills.ToList());
     }
 }
コード例 #4
0
 public List <CreditBillTransaction> GetCreditBillTransactions()
 {
     using (Billing_Customized_Entities creditTransactions = new Billing_Customized_Entities())
     {
         return(creditTransactions.CreditBillTransactions.ToList());
     }
 }
コード例 #5
0
 public List <CreditBillSalesDetail> RetrieveAllCreditProductSalesDetails()
 {
     using (Billing_Customized_Entities allSalesDetails = new Billing_Customized_Entities())
     {
         return(allSalesDetails.CreditBillSalesDetails.ToList());
     }
 }
コード例 #6
0
 public List <RetailBill> RetrieveAllRetailSalesDetails()
 {
     using (Billing_Customized_Entities allSalesDetails = new Billing_Customized_Entities())
     {
         return(allSalesDetails.RetailBills.ToList());
     }
 }
コード例 #7
0
 public List <AdminDetail> GetAllAdmin()
 {
     using (Billing_Customized_Entities allAdmin = new Billing_Customized_Entities())
     {
         return(allAdmin.AdminDetails.ToList());
     }
 }
コード例 #8
0
 public List <ExpenseDetail> GetAllExpenseDetails()
 {
     using (Billing_Customized_Entities expenseDetails = new Billing_Customized_Entities())
     {
         return(expenseDetails.ExpenseDetails.ToList());
     }
 }
コード例 #9
0
 public List <StockDetail> GetAllStock()
 {
     using (Billing_Customized_Entities getAllStock = new Billing_Customized_Entities())
     {
         return(getAllStock.StockDetails.ToList());
     }
 }
コード例 #10
0
 public List <CreditBill> GetAllCreditSalesDetails()
 {
     using (Billing_Customized_Entities allSalesDetails = new Billing_Customized_Entities())
     {
         return(allSalesDetails.CreditBills.ToList());
     }
 }
コード例 #11
0
 public List <WholeSaleBillSalesDetail> RetrieveAllWholesaleProductSalesDetails()
 {
     using (Billing_Customized_Entities allSalesDetails = new Billing_Customized_Entities())
     {
         return(allSalesDetails.WholeSaleBillSalesDetails.ToList());
     }
 }
コード例 #12
0
 public void UpdateWholeSaleBillSalesDetails(List <WholeSaleBillSalesDetail> purchasedProductDetails)
 {
     using (Billing_Customized_Entities addBilledProducts = new Billing_Customized_Entities())
     {
         addBilledProducts.WholeSaleBillSalesDetails.AddRange(purchasedProductDetails);
         addBilledProducts.SaveChanges();
     }
 }
コード例 #13
0
 public void AddCreditBillTransactions(CreditBillTransaction creditBillTransaction)
 {
     using (Billing_Customized_Entities addBilledProducts = new Billing_Customized_Entities())
     {
         addBilledProducts.CreditBillTransactions.Add(creditBillTransaction);
         addBilledProducts.SaveChanges();
     }
 }
コード例 #14
0
 public void AddNewExpenseDetails(ExpenseDetail expenseDetail)
 {
     using (Billing_Customized_Entities expenseDetails = new Billing_Customized_Entities())
     {
         expenseDetails.ExpenseDetails.Add(expenseDetail);
         expenseDetails.SaveChanges();
     }
 }
コード例 #15
0
 public void AddSalesDetailsForWholeSaleBill(WholeSaleBill billedProducts)
 {
     using (Billing_Customized_Entities billedProductDetails = new Billing_Customized_Entities())
     {
         billedProductDetails.WholeSaleBills.Add(billedProducts);
         billedProductDetails.SaveChanges();
     }
 }
コード例 #16
0
 public void AddLastLoggedOutTimeForLoggedAdmin(string loggedInAdminUserId)
 {
     using (Billing_Customized_Entities allAdmin = new Billing_Customized_Entities())
     {
         allAdmin.AdminDetails.Where(obj => obj.UserId.Equals(loggedInAdminUserId)).ToList().ForEach(obj => obj.Last_LoggedOut_Time = DateTime.Now);
         allAdmin.SaveChanges();
     }
 }
コード例 #17
0
 public bool SaveProduct(StockDetail newStock)
 {
     using (Billing_Customized_Entities saveProductDetails = new Billing_Customized_Entities())
     {
         saveProductDetails.StockDetails.Add(newStock);
         saveProductDetails.SaveChanges();
         return(true);
     }
 }
コード例 #18
0
 public void UpdateQuantity(List <Products> productDetails)
 {
     using (Billing_Customized_Entities billedProductDetails = new Billing_Customized_Entities())
     {
         foreach (Products details in productDetails)
         {
             billedProductDetails.StockDetails.Where(obj => obj.ProductId == details.ProductId).ToList().ForEach(obj => obj.Quantity -= details.Quantity);
         }
         billedProductDetails.SaveChanges();
     }
 }
コード例 #19
0
 public void AddCreditBillTransaction(CreditBillTransaction creditBillTransaction)
 {
     using (Billing_Customized_Entities creditTransactions = new Billing_Customized_Entities())
     {
         creditTransactions.CreditBillTransactions.Add(creditBillTransaction);
         var bill = creditTransactions.CreditBills.FirstOrDefault(obj => obj.BillNos.Equals(creditBillTransaction.BillNos) && obj.SoldDate == creditBillTransaction.BillDate);
         if (bill != null)
         {
             bill.PaidAmount += creditBillTransaction.PaidAmount;
         }
         creditTransactions.SaveChanges();
     }
 }
コード例 #20
0
        public void DeleteSalesDetailsForReturnBill(dynamic productSales, dynamic billDetails, int billType)
        {
            using (Billing_Customized_Entities allsalesdetails = new Billing_Customized_Entities())
            {
                if (billType.Equals(1))
                {
                    if (billDetails != null)
                    {
                        allsalesdetails.RetailBills.Attach(billDetails);
                        allsalesdetails.Entry(billDetails).State = EntityState.Deleted;
                    }
                    foreach (var item in productSales)
                    {
                        allsalesdetails.RetailBillSalesDetails.Attach(item);
                        allsalesdetails.Entry(item).State = EntityState.Deleted;
                    }
                }
                else if (billType.Equals(2))
                {
                    if (billDetails != null)
                    {
                        allsalesdetails.WholeSaleBills.Attach(billDetails);
                        allsalesdetails.Entry(billDetails).State = EntityState.Deleted;
                    }
                    foreach (var item in productSales)
                    {
                        allsalesdetails.WholeSaleBillSalesDetails.Attach(item);
                        allsalesdetails.Entry(item).State = EntityState.Deleted;
                    }
                }
                else
                {
                    if (billDetails != null)
                    {
                        allsalesdetails.CreditBills.Attach(billDetails);
                        allsalesdetails.Entry(billDetails).State = EntityState.Deleted;
                    }
                    foreach (var item in productSales)
                    {
                        allsalesdetails.CreditBillSalesDetails.Attach(item);
                        allsalesdetails.Entry(item).State = EntityState.Deleted;
                    }
                }

                allsalesdetails.SaveChanges();
            }
        }
コード例 #21
0
        public bool DeleteProduct(long productId)
        {
            bool isProductdeleted = false;

            using (Billing_Customized_Entities deleteProduct = new Billing_Customized_Entities())
            {
                StockDetail stockDetail = deleteProduct.StockDetails.FirstOrDefault(obj => obj.ProductId == productId);
                if (stockDetail != null)
                {
                    deleteProduct.StockDetails.Remove(stockDetail);
                    isProductdeleted = true;
                    deleteProduct.SaveChanges();
                }

                return(isProductdeleted);
            }
        }