public bool AddSaleStock(DetailSaleInfo saleDetails)
        {
            bool          isAdd         = false;
            SqlConnection sqlConnection = new SqlConnection(connectionString);
            string        commandString = @"INSERT INTO SoldIn(SaleId,Category,Product,Quantity)
            VALUES(" + saleDetails.SaleId + ",'" + saleDetails.Category + "','" + saleDetails.Product + "'," + saleDetails.Quantity + ")";
            SqlCommand    sqlCommand    = new SqlCommand(commandString, sqlConnection);

            sqlConnection.Open();
            int isExecute = sqlCommand.ExecuteNonQuery();

            if (isExecute > 0)
            {
                isAdd = true;
            }
            sqlConnection.Close();
            return(isAdd);
        }
        public bool UpdateSalesProductQty(DetailSaleInfo saleDetails, double profit)
        {
            bool          isUpdate      = false;
            SqlConnection sqlConnection = new SqlConnection(connectionString);
            string        query         = @"UPDATE SaleDetails SET AvailableQuantity = AvailableQuantity + " + saleDetails.Quantity + ",MRP = " + saleDetails.MRP + ",Quantity = " + saleDetails.Quantity + "," +
                                          "TotalMRP = " + saleDetails.TotalMRP + ",UnitPrice = " + saleDetails.UnitPrice + ",Profit = " + profit + " WHERE Product = '" + saleDetails.Product + "'";
            SqlCommand sqlCommand = new SqlCommand(query, sqlConnection);

            sqlConnection.Open();
            int isExecute = sqlCommand.ExecuteNonQuery();

            if (isExecute > 0)
            {
                isUpdate = true;
            }
            sqlConnection.Close();
            return(isUpdate);
        }
        public bool SaveDetailsSale(DetailSaleInfo saleDetails, double unitPrice, double profit)
        {
            bool          isAdd         = false;
            SqlConnection sqlConnection = new SqlConnection(connectionString);
            string        commandString = @"INSERT INTO SaleDetails(Code,SaleId,CategoryId,ProductId,Category,Product,AvailableQuantity,Quantity,MRP,TotalMRP,UnitPrice,Profit)
            VALUES('" + saleDetails.Code + "'," + saleDetails.SaleId + "," + saleDetails.CategoryId + "," + saleDetails.ProductId + ",'" + saleDetails.Category + "','" + saleDetails.Product + "'," +
                                          "" + saleDetails.Quantity + "," + saleDetails.Quantity + "," + saleDetails.MRP + "," + saleDetails.TotalMRP + "," + unitPrice + "," + profit + ")";
            SqlCommand sqlCommand = new SqlCommand(commandString, sqlConnection);

            sqlConnection.Open();
            int isExecute = sqlCommand.ExecuteNonQuery();

            if (isExecute > 0)
            {
                isAdd = true;
            }
            sqlConnection.Close();
            return(isAdd);
        }
 public bool UpdateSalesProductQty(DetailSaleInfo saleDetails, double profit)
 {
     return(_saleModuleRepository.UpdateSalesProductQty(saleDetails, profit));
 }
 public bool SaveDetailsSale(DetailSaleInfo saleDetails, double unitPrice, double profit)
 {
     return(_saleModuleRepository.SaveDetailsSale(saleDetails, unitPrice, profit));
 }
 public bool AddSaleStock(DetailSaleInfo saleDetails)
 {
     return(_saleModuleRepository.AddSaleStock(saleDetails));
 }