コード例 #1
0
ファイル: SaleBLL.cs プロジェクト: xyzthought/iBeyondZ
 public Sale GetFinalCheckOutDeatils(ref Sale objSale)
 {
     return objDB.GetFinalCheckOutDeatils(ref objSale);
 }
コード例 #2
0
ファイル: SaleBLL.cs プロジェクト: xyzthought/iBeyondZ
 public Message DeleteExistingSalesDetails(Sale objSale)
 {
     return objDB.DeleteExistingSalesDetails(objSale);
 }
コード例 #3
0
ファイル: SaleBLL.cs プロジェクト: xyzthought/iBeyondZ
 public Message InsertUpdateSaleDetail(Sale objSale)
 {
     return objDB.InsertUpdateSaleDetail(objSale);
 }
コード例 #4
0
ファイル: SaleBLL.cs プロジェクト: xyzthought/iBeyondZ
 public List<Sale> GetSaleDetailBySaleID(Sale objSale)
 {
     return objDB.GetSaleDetailBySaleID(objSale);
 }
コード例 #5
0
ファイル: SaleDB.cs プロジェクト: xyzthought/iBeyondZ
        private Sale PopulateProductBarCode(IDataReader drData)
        {
            Sale objData = new Sale();
            try
            {

                if (FieldExists(drData, "ProductID") && drData["ProductID"] != DBNull.Value)
                {
                    objData.ProductID = Convert.ToInt32(drData["ProductID"]);
                }
                if (FieldExists(drData, "ProductName") && drData["ProductName"] != DBNull.Value)
                {
                    objData.ProductName = Convert.ToString(drData["ProductName"]);
                }
                if (FieldExists(drData, "SizeName") && drData["SizeName"] != DBNull.Value)
                {
                    objData.SizeName = Convert.ToString(drData["SizeName"]);
                }
                if (FieldExists(drData, "BarCode") && drData["BarCode"] != DBNull.Value)
                {
                    objData.BarCode = Convert.ToString(drData["BarCode"]);
                }
                if (FieldExists(drData, "SizeBarCode") && drData["SizeBarCode"] != DBNull.Value)
                {
                    objData.SizeBarCode = Convert.ToString(drData["SizeBarCode"]);
                }
                if (FieldExists(drData, "Price") && drData["Price"] != DBNull.Value)
                {
                    objData.Price = Convert.ToDecimal(drData["Price"]);
                }
                if (FieldExists(drData, "Brand") && drData["Brand"] != DBNull.Value)
                {
                    objData.Brand = Convert.ToString(drData["Brand"]);
                }
                if (FieldExists(drData, "Quantity") && drData["Quantity"] != DBNull.Value)
                {
                    objData.Quantity = Convert.ToInt32(drData["Quantity"]);
                }
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objData;
        }
コード例 #6
0
ファイル: SaleBLL.cs プロジェクト: xyzthought/iBeyondZ
 public Message InsertUpdateSaleMaster(Sale objSale)
 {
     return objDB.InsertUpdateSaleMaster(objSale);
 }
コード例 #7
0
ファイル: SaleDB.cs プロジェクト: xyzthought/iBeyondZ
        public Message DeleteExistingSalesDetails(Sale objSale)
        {
            Message objMessage = new Message();
            try
            {
                DbCommand objCmd = dBase.GetStoredProcCommand("sprocCS_DeleteExistingSalesDetails");
                dBase.AddInParameter(objCmd, "@SaleID", DbType.Int32, objSale.SaleID);
                dBase.AddOutParameter(objCmd, "@ReturnValue", DbType.Int32, 4);
                dBase.AddOutParameter(objCmd, "@ReturnMessage", DbType.String, 255);
                dBase.ExecuteNonQuery(objCmd);

                objMessage.ReturnValue = (int)dBase.GetParameterValue(objCmd, "@ReturnValue");
                objMessage.ReturnMessage = (string)dBase.GetParameterValue(objCmd, "@ReturnMessage");
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objMessage;
        }
コード例 #8
0
ファイル: SaleDB.cs プロジェクト: xyzthought/iBeyondZ
        private Sale PopulateData(IDataReader drData)
        {
            Sale objData = new Sale();
            try
            {

                if (FieldExists(drData, "SaleID") && drData["SaleID"] != DBNull.Value)
                {
                    objData.SaleID = Convert.ToInt32(drData["SaleID"]);
                }
                if (FieldExists(drData, "SaleOrder") && drData["SaleOrder"] != DBNull.Value)
                {
                    objData.SaleOrder = Convert.ToString(drData["SaleOrder"]);
                }
                if (FieldExists(drData, "FirstName") && drData["FirstName"] != DBNull.Value)
                {
                    objData.FirstName = Convert.ToString(drData["FirstName"]);
                }
                if (FieldExists(drData, "LastName") && drData["LastName"] != DBNull.Value)
                {
                    objData.LastName = Convert.ToString(drData["LastName"]);
                }

                if (FieldExists(drData, "SaleDate") && drData["SaleDate"] != DBNull.Value)
                {
                    objData.SaleDate = Convert.ToDateTime(drData["SaleDate"]);
                }


                if (FieldExists(drData, "Price") && drData["Price"] != DBNull.Value)
                {
                    objData.Price = Convert.ToDecimal(drData["Price"]);
                }
                if (FieldExists(drData, "StandardRebate") && drData["StandardRebate"] != DBNull.Value)
                {
                    objData.StandardRebate = Convert.ToDecimal(drData["StandardRebate"]);

                }
                if (FieldExists(drData, "Discount") && drData["Discount"] != DBNull.Value)
                {
                    objData.Discount = Convert.ToDecimal(drData["Discount"]);

                }
                if (FieldExists(drData, "FinalDiscount") && drData["FinalDiscount"] != DBNull.Value)
                {
                    objData.FinalDiscount = Convert.ToDecimal(drData["FinalDiscount"]);

                }
                if (FieldExists(drData, "FinalPayableAmount") && drData["FinalPayableAmount"] != DBNull.Value)
                {
                    objData.FinalPayableAmount = Convert.ToDecimal(drData["FinalPayableAmount"]);

                }
                if (FieldExists(drData, "BankAmount") && drData["BankAmount"] != DBNull.Value)
                {
                    objData.BankAmount = Convert.ToDecimal(drData["BankAmount"]);

                }
                if (FieldExists(drData, "CCAmount") && drData["CCAmount"] != DBNull.Value)
                {
                    objData.CCAmount = Convert.ToDecimal(drData["CCAmount"]);

                }
                if (FieldExists(drData, "Cash") && drData["Cash"] != DBNull.Value)
                {
                    objData.Cash = Convert.ToDecimal(drData["Cash"]);

                }

                if (FieldExists(drData, "ProductDetails") && drData["ProductDetails"] != DBNull.Value)
                {
                    objData.ProductDetails = Convert.ToString(drData["ProductDetails"]);

                }
                
                if (FieldExists(drData, "SaleMadeByName") && drData["SaleMadeByName"] != DBNull.Value)
                {
                    objData.SaleMadeByName = Convert.ToString(drData["SaleMadeByName"]);

                }
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objData;
        }
コード例 #9
0
ファイル: SaleDB.cs プロジェクト: xyzthought/iBeyondZ
        private Sale PopulateFinalCheckOutData(IDataReader drData)
        {
            Sale objData = new Sale();
            try
            {

                if (FieldExists(drData, "CustomerID") && drData["CustomerID"] != DBNull.Value)
                {
                    objData.CustomerID = Convert.ToInt32(drData["CustomerID"]);
                }
                if (FieldExists(drData, "CFirstName") && drData["CFirstName"] != DBNull.Value)
                {
                    objData.CFirstName = Convert.ToString(drData["CFirstName"]);
                }
                if (FieldExists(drData, "Address") && drData["Address"] != DBNull.Value)
                {
                    objData.Address = Convert.ToString(drData["Address"]);
                }
                if (FieldExists(drData, "ZIP") && drData["ZIP"] != DBNull.Value)
                {
                    objData.ZIP = Convert.ToString(drData["ZIP"]);
                }
                if (FieldExists(drData, "City") && drData["City"] != DBNull.Value)
                {
                    objData.City = Convert.ToString(drData["City"]);
                }
                if (FieldExists(drData, "TeleNumber") && drData["TeleNumber"] != DBNull.Value)
                {
                    objData.TeleNumber = Convert.ToString(drData["TeleNumber"]);
                }
                if (FieldExists(drData, "Country") && drData["Country"] != DBNull.Value)
                {
                    objData.Country = Convert.ToString(drData["Country"]);
                }
                if (FieldExists(drData, "Email") && drData["Email"] != DBNull.Value)
                {
                    objData.Email = Convert.ToString(drData["Email"]);
                }
                if (FieldExists(drData, "SaleNote") && drData["SaleNote"] != DBNull.Value)
                {
                    objData.SaleNote = Convert.ToString(drData["SaleNote"]);
                }
                if (FieldExists(drData, "Discount") && drData["Discount"] != DBNull.Value)
                {
                    objData.Discount = Convert.ToDecimal(drData["Discount"]);
                }
                if (FieldExists(drData, "FinalDiscountType") && drData["FinalDiscountType"] != DBNull.Value)
                {
                    objData.FinalDiscountType = Convert.ToString(drData["FinalDiscountType"]);
                }
                if (FieldExists(drData, "FinalDiscount") && drData["FinalDiscount"] != DBNull.Value)
                {
                    objData.FinalDiscount = Convert.ToDecimal(drData["FinalDiscount"]);
                }
                if (FieldExists(drData, "FinalPayableAmount") && drData["FinalPayableAmount"] != DBNull.Value)
                {
                    objData.FinalPayableAmount = Convert.ToDecimal(drData["FinalPayableAmount"]);
                }

                if (FieldExists(drData, "CCAmount") && drData["CCAmount"] != DBNull.Value)
                {
                    objData.CCAmount = Convert.ToDecimal(drData["CCAmount"]);
                }
                if (FieldExists(drData, "BankAmount") && drData["BankAmount"] != DBNull.Value)
                {
                    objData.BankAmount = Convert.ToDecimal(drData["BankAmount"]);
                }
                if (FieldExists(drData, "Cash") && drData["Cash"] != DBNull.Value)
                {
                    objData.Cash = Convert.ToDecimal(drData["Cash"]);
                }
                

            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objData;
        }
コード例 #10
0
ファイル: SaleDB.cs プロジェクト: xyzthought/iBeyondZ
        public Sale GetFinalCheckOutDeatils(ref Sale objSale)
        {
            try
            {
                DbCommand objCmd = dBase.GetStoredProcCommand("sprocCS_GetFinalCheckOutDeatils");
                dBase.AddInParameter(objCmd, "@SaleID", DbType.Int32, objSale.SaleID);

                using (IDataReader reader = dBase.ExecuteReader(objCmd))
                {
                    while (reader.Read())
                    {
                        objSale=PopulateFinalCheckOutData(reader);
                    }
                }
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objSale;
        }
コード例 #11
0
ファイル: SaleDB.cs プロジェクト: xyzthought/iBeyondZ
        public List<Sale> GetSaleDetailBySaleID(Sale objSale)
        {
            List<Sale> lstobjData = new List<Sale>();
            try
            {

                DbCommand objCmd = dBase.GetStoredProcCommand("sprocCS_GetSaleDetailBySaleID");
                dBase.AddInParameter(objCmd, "@SaleID", DbType.Int32, objSale.SaleID);

                using (IDataReader reader = dBase.ExecuteReader(objCmd))
                {
                    while (reader.Read())
                    {
                        lstobjData.Add(PopulateProductData(reader));
                    }
                }
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return lstobjData;
        }
コード例 #12
0
ファイル: SaleDB.cs プロジェクト: xyzthought/iBeyondZ
        public Message InsertUpdateSaleDetail(Sale objSale)
        {
            Message objMessage = new Message();
            try
            {
                DbCommand objCmd = dBase.GetStoredProcCommand("sprocCS_InsertUpdateSaleDetail");
                dBase.AddInParameter(objCmd, "@SaleID", DbType.Int32, objSale.SaleID);
                dBase.AddInParameter(objCmd, "@ProductID", DbType.Int32, objSale.ProductID);
                dBase.AddInParameter(objCmd, "@SizeID", DbType.Int32, objSale.SizeID);
                dBase.AddInParameter(objCmd, "@Quantity", DbType.Decimal, objSale.Quantity);
                dBase.AddInParameter(objCmd, "@Discount", DbType.Decimal, objSale.Discount);
                dBase.AddInParameter(objCmd, "@DiscountType", DbType.String, objSale.DiscountType);
                dBase.AddInParameter(objCmd, "@Price", DbType.Decimal, objSale.Price);

                dBase.AddOutParameter(objCmd, "@ReturnValue", DbType.Int32, 4);
                dBase.AddOutParameter(objCmd, "@ReturnMessage", DbType.String, 255);
                dBase.ExecuteNonQuery(objCmd);

                objMessage.ReturnValue = (int)dBase.GetParameterValue(objCmd, "@ReturnValue");
                objMessage.ReturnMessage = (string)dBase.GetParameterValue(objCmd, "@ReturnMessage");
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objMessage;
        }
コード例 #13
0
ファイル: SaleDB.cs プロジェクト: xyzthought/iBeyondZ
        public Message InsertUpdateSaleMaster(Sale objSale)
        {
            Message objMessage = new Message();
            try
            {
                DbCommand objCmd = dBase.GetStoredProcCommand("sprocCS_InsertUpdateSaleMaster");
                dBase.AddInParameter(objCmd, "@SaleID", DbType.Int32, objSale.SaleID);
                dBase.AddInParameter(objCmd, "@CustomerID", DbType.Int32, objSale.CustomerID);
                dBase.AddInParameter(objCmd, "@CFirstName", DbType.String, objSale.CFirstName);
                dBase.AddInParameter(objCmd, "@Address", DbType.String, objSale.Address);
                dBase.AddInParameter(objCmd, "@City", DbType.String, objSale.City);
                dBase.AddInParameter(objCmd, "@ZIP", DbType.String, objSale.ZIP);
                dBase.AddInParameter(objCmd, "@Country", DbType.String, objSale.Country);
                dBase.AddInParameter(objCmd, "@Email", DbType.String, objSale.Email);
                dBase.AddInParameter(objCmd, "@TeleNumber", DbType.String, objSale.TeleNumber);
                dBase.AddInParameter(objCmd, "@SaleNote", DbType.String, objSale.SaleNote);
                dBase.AddInParameter(objCmd, "@CCAmount", DbType.Decimal, objSale.CCAmount);
                dBase.AddInParameter(objCmd, "@BankAmount", DbType.Decimal, objSale.BankAmount);
                dBase.AddInParameter(objCmd, "@Cash", DbType.Decimal, objSale.Cash);
                dBase.AddInParameter(objCmd, "@Discount", DbType.Decimal, objSale.Discount);
                dBase.AddInParameter(objCmd, "@FinalDiscountType", DbType.String, objSale.FinalDiscountType);
                dBase.AddInParameter(objCmd, "@FinalDiscount", DbType.Decimal, objSale.FinalDiscount);
                dBase.AddInParameter(objCmd, "@FinalPayableAmount", DbType.Decimal, objSale.FinalPayableAmount);
                dBase.AddInParameter(objCmd, "@SaleMadeBy", DbType.Int32, objSale.SaleMadeBy);
                dBase.AddInParameter(objCmd, "@ThisSaleDate", DbType.String, objSale.ThisSaleDate);
                dBase.AddOutParameter(objCmd, "@ReturnValue", DbType.Int32, 4);
                dBase.AddOutParameter(objCmd, "@ReturnMessage", DbType.String, 255);
                dBase.ExecuteNonQuery(objCmd);

                objMessage.ReturnValue = (int)dBase.GetParameterValue(objCmd, "@ReturnValue");
                objMessage.ReturnMessage = (string)dBase.GetParameterValue(objCmd, "@ReturnMessage");
            }
            catch (Exception ex)
            {

                Common.LogError("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
            }
            return objMessage;
        }