コード例 #1
0
        public static List<ProductDetailsBLL> GetDetailByUser(int UserID)
        {
            DataSet ds = SIMSClassLibrary.DAL.ProductDetails.GetAllRecordsByUser(UserID);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                List<ProductDetailsBLL> lstproductdetailsBLL = new List<ProductDetailsBLL>();
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    ProductDetailsBLL objproductdetailsBLL = new ProductDetailsBLL();
                    if (!ds.Tables[0].Rows[i]["ProductID"].Equals(DBNull.Value))
                        objproductdetailsBLL._ProductID = Convert.ToInt32(ds.Tables[0].Rows[i]["ProductID"]);
                    //if (!ds.Tables[0].Rows[i]["VendorID"].Equals(DBNull.Value))
                    //    objproductdetailsBLL._VendorID = Convert.ToInt32(ds.Tables[0].Rows[i]["VendorID"]);
                    //if (!ds.Tables[0].Rows[i]["ProductCompanyID"].Equals(DBNull.Value))
                    //    objproductdetailsBLL._ProductCompanyID = Convert.ToInt32(ds.Tables[0].Rows[i]["ProductCompanyID"]);
                    //if (!ds.Tables[0].Rows[i]["ProductSizeID"].Equals(DBNull.Value))
                    //    objproductdetailsBLL._ProductSizeID = Convert.ToInt32(ds.Tables[0].Rows[i]["ProductSizeID"]);
                    //if (!ds.Tables[0].Rows[i]["ProductColorID"].Equals(DBNull.Value))
                    //    objproductdetailsBLL._ProductColorID = Convert.ToInt32(ds.Tables[0].Rows[i]["ProductColorID"]);
                    //if (!ds.Tables[0].Rows[i]["ProductCategoryID"].Equals(DBNull.Value))
                    //    objproductdetailsBLL._ProductCategoryID = Convert.ToInt32(ds.Tables[0].Rows[i]["ProductCategoryID"]);
                    //if (!ds.Tables[0].Rows[i]["ProductForID"].Equals(DBNull.Value))
                    //    objproductdetailsBLL._ProductForID = Convert.ToInt32(ds.Tables[0].Rows[i]["ProductForID"]);
                    if (!ds.Tables[0].Rows[i]["Name"].Equals(DBNull.Value))
                        objproductdetailsBLL._Name = Convert.ToString(ds.Tables[0].Rows[i]["Name"]);
                    //if (!ds.Tables[0].Rows[i]["Descryption"].Equals(DBNull.Value))
                    //    objproductdetailsBLL._Descryption = Convert.ToString(ds.Tables[0].Rows[i]["Descryption"]);
                    //if (!ds.Tables[0].Rows[i]["ShortCode"].Equals(DBNull.Value))
                    //    objproductdetailsBLL._ShortCode = Convert.ToString(ds.Tables[0].Rows[i]["ShortCode"]);
                    //if (!ds.Tables[0].Rows[i]["Quantity"].Equals(DBNull.Value))
                    //    objproductdetailsBLL._Quantity = Convert.ToInt32(ds.Tables[0].Rows[i]["Quantity"]);
                    //if (!ds.Tables[0].Rows[i]["TotalPrice"].Equals(DBNull.Value))
                    //    objproductdetailsBLL._TotalPrice = Convert.ToDecimal(ds.Tables[0].Rows[i]["TotalPrice"]);
                    //if (!ds.Tables[0].Rows[i]["PurchasePrice"].Equals(DBNull.Value))
                    //    objproductdetailsBLL._PurchasePrice = Convert.ToDecimal(ds.Tables[0].Rows[i]["PurchasePrice"]);
                    if (!ds.Tables[0].Rows[i]["MRP"].Equals(DBNull.Value))
                        objproductdetailsBLL._MRP = Convert.ToDecimal(ds.Tables[0].Rows[i]["MRP"]);
                    //if (!ds.Tables[0].Rows[i]["Discount"].Equals(DBNull.Value))
                    //    objproductdetailsBLL._Discount = Convert.ToInt32(ds.Tables[0].Rows[i]["Discount"]);
                    if (!ds.Tables[0].Rows[i]["CreatedOn"].Equals(DBNull.Value))
                        objproductdetailsBLL._CreatedOn = Convert.ToDateTime(ds.Tables[0].Rows[i]["CreatedOn"]);
                    if (!ds.Tables[0].Rows[i]["UpdateOn"].Equals(DBNull.Value))
                        objproductdetailsBLL._UpdatedOn = Convert.ToDateTime(ds.Tables[0].Rows[i]["UpdateOn"]);
                    if (!ds.Tables[0].Rows[i]["CreatedBy"].Equals(DBNull.Value))
                        objproductdetailsBLL._CreatedBy = Convert.ToInt32(ds.Tables[0].Rows[i]["CreatedBy"]);
                    if (!ds.Tables[0].Rows[i]["UpdatedBy"].Equals(DBNull.Value))
                        objproductdetailsBLL._UpdatedBy = Convert.ToInt32(ds.Tables[0].Rows[i]["UpdatedBy"]);

                    if (!ds.Tables[0].Rows[i]["ProductBarCodeDetaiID"].Equals(DBNull.Value))
                        objproductdetailsBLL._ProductBarCodeDetaiID = Convert.ToInt32(ds.Tables[0].Rows[i]["ProductBarCodeDetaiID"]);
                    if (!ds.Tables[0].Rows[i]["ProductID"].Equals(DBNull.Value))
                        objproductdetailsBLL._ProductID = Convert.ToInt32(ds.Tables[0].Rows[i]["ProductID"]);
                    if (!ds.Tables[0].Rows[i]["BarCodeNumber"].Equals(DBNull.Value))
                        objproductdetailsBLL._BarCodeNumber = Convert.ToString(ds.Tables[0].Rows[i]["BarCodeNumber"]);
                    if (!ds.Tables[0].Rows[i]["ExtaDiscount"].Equals(DBNull.Value))
                        objproductdetailsBLL._ExtaDiscount = Convert.ToInt32(ds.Tables[0].Rows[i]["ExtaDiscount"]);
                    //if (!ds.Tables[0].Rows[i]["CreatedBy"].Equals(DBNull.Value))
                    //    _CreatedBy = Convert.ToInt32(ds.Tables[0].Rows[i]["CreatedBy"]);
                    //if (!ds.Tables[0].Rows[i]["CreatedOn"].Equals(DBNull.Value))
                    //    _CreatedOn = Convert.ToDateTime(ds.Tables[0].Rows[i]["CreatedOn"]);
                    //if (!ds.Tables[0].Rows[i]["UpdatedBy"].Equals(DBNull.Value))
                    //    _UpdatedBy = Convert.ToInt32(ds.Tables[0].Rows[i]["UpdatedBy"]);
                    //if (!ds.Tables[0].Rows[i]["UpdateOn"].Equals(DBNull.Value))
                    //    _UpdateOn = Convert.ToDateTime(ds.Tables[0].Rows[i]["UpdateOn"]);
                    if (!ds.Tables[0].Rows[i]["IsDeleted"].Equals(DBNull.Value))
                        objproductdetailsBLL._IsDeleted = Convert.ToBoolean(ds.Tables[0].Rows[i]["IsDeleted"]);
                    if (!ds.Tables[0].Rows[i]["DeletedOn"].Equals(DBNull.Value))
                        objproductdetailsBLL._DeletedOn = Convert.ToDateTime(ds.Tables[0].Rows[i]["DeletedOn"]);
                    if (!ds.Tables[0].Rows[i]["IsBarcodeGenerated"].Equals(DBNull.Value))
                        objproductdetailsBLL._IsBarcodeGenerated = Convert.ToBoolean(ds.Tables[0].Rows[i]["IsBarcodeGenerated"]);

                    if (!ds.Tables[0].Rows[i]["CategoryName"].Equals(DBNull.Value))
                        objproductdetailsBLL._CategoryName = Convert.ToString(ds.Tables[0].Rows[i]["CategoryName"]);
                    if (!ds.Tables[0].Rows[i]["SizeName"].Equals(DBNull.Value))
                        objproductdetailsBLL._SizeName = Convert.ToString(ds.Tables[0].Rows[i]["SizeName"]);

                    lstproductdetailsBLL.Add(objproductdetailsBLL);
                }
                return lstproductdetailsBLL;
            }
            else
                return null;
        }
コード例 #2
0
 public static ProductDetailsBLL GetAllRecordsByUserAndBarcodeNumber(int UserID, string BarcodeNumber)
 {
     DataSet ds = SIMSClassLibrary.DAL.ProductDetails.GetAllRecordsByUserAndBarcodeNumber(UserID, BarcodeNumber);
     ProductDetailsBLL objproductdetailsBLL = new ProductDetailsBLL();
     if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
     {
         for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
         {
             if (!ds.Tables[0].Rows[i]["Name"].Equals(DBNull.Value))
                 objproductdetailsBLL._Name = Convert.ToString(ds.Tables[0].Rows[i]["Name"]);
             if (!ds.Tables[0].Rows[i]["MRP"].Equals(DBNull.Value))
                 objproductdetailsBLL._MRP = Convert.ToDecimal(ds.Tables[0].Rows[i]["MRP"]);
             if (!ds.Tables[0].Rows[i]["Discount"].Equals(DBNull.Value))
                 objproductdetailsBLL._Discount = Convert.ToInt32(ds.Tables[0].Rows[i]["Discount"]);
             if (!ds.Tables[0].Rows[i]["ProductBarCodeDetaiID"].Equals(DBNull.Value))
                 objproductdetailsBLL._ProductBarCodeDetaiID = Convert.ToInt32(ds.Tables[0].Rows[i]["ProductBarCodeDetaiID"]);
             if (!ds.Tables[0].Rows[i]["ProductID"].Equals(DBNull.Value))
                 objproductdetailsBLL._ProductID = Convert.ToInt32(ds.Tables[0].Rows[i]["ProductID"]);
             if (!ds.Tables[0].Rows[i]["BarCodeNumber"].Equals(DBNull.Value))
                 objproductdetailsBLL._BarCodeNumber = Convert.ToString(ds.Tables[0].Rows[i]["BarCodeNumber"]);
         }
         return objproductdetailsBLL;
     }
     else
         return null;
 }