public List <BZProductBanner> BZProductBannerList() { DataSet DS = new VideoCartDal().Get_BZProductBanner(); List <BZProductBanner> _viewModel = new List <BZProductBanner>(); if (DS != null && DS.Tables[0] != null) { if (DS.Tables[0].Rows.Count > 0) { foreach (DataRow item in DS.Tables[0].Rows) { var combo = new BZProductBanner() { BannerId = item["BannerId"] == DBNull.Value ? 0 : Convert.ToInt32(item["BannerId"]), BannerName = item["BannerName"] == DBNull.Value ? string.Empty : Convert.ToString(item["BannerName"]), BannerType = item["BannerType"] == DBNull.Value ? string.Empty : Convert.ToString(item["BannerType"]), ImagePath = item["ImagePath"] == DBNull.Value ? string.Empty : Convert.ToString(item["ImagePath"]) }; _viewModel.Add(combo); } } } return(_viewModel); }
public List <ComboBZProduct> Get_BZComboProductList() { DataSet DS = new VideoCartDal().Get_BZComboProductList(); List <ComboBZProduct> _viewModel = new List <ComboBZProduct>(); if (DS != null && DS.Tables[0] != null) { if (DS.Tables[0].Rows.Count > 0) { foreach (DataRow item in DS.Tables[0].Rows) { var combo = new ComboBZProduct() { ComboId = item["ComboId"] == DBNull.Value ? 0 : Convert.ToInt32(item["ComboId"]), ComboName = item["ComboName"] == DBNull.Value ? string.Empty : Convert.ToString(item["ComboName"]), ComboHindiName = item["CHindName"] == DBNull.Value ? string.Empty : Convert.ToString(item["CHindName"]), ImagePath = item["ImagePath"] == DBNull.Value ? string.Empty : Convert.ToString(item["ImagePath"]), MRP = item["MRP"] == DBNull.Value ? 0 : Convert.ToInt32(item["MRP"]), DiscountAmt = item["ComboDiscount"] == DBNull.Value ? 0 : Convert.ToInt32(item["ComboDiscount"]), OfferPrice = Convert.ToInt32(item["MRP"]) - Convert.ToInt32(item["ComboDiscount"]) }; _viewModel.Add(combo); } } } return(_viewModel); }
public FSCOrderDetails GetOrderDetails(int FSCId, int RoleId, string fromdate, string todate, int status, string Mode) { FSCOrderDetails FSCOrderList = new FSCOrderDetails(); DataSet ds = new VideoCartDal().GetOrderDetails(FSCId, RoleId, fromdate, todate, status, Mode); if (ds != null && ds.Tables.Count > 0) { { List <FSCOrderList> _FscOList = new List <FSCOrderList>(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { FSCOrderList _fscOrd = new FSCOrderList(); _fscOrd.OrderId = ds.Tables[0].Rows[i]["OrderID"] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[i]["OrderID"].ToString()); _fscOrd.OrderRefNo = ds.Tables[0].Rows[i]["OrderRefNo"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["OrderRefNo"]); _fscOrd.FarmerName = ds.Tables[0].Rows[i]["FarmerName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["FarmerName"]); _fscOrd.CreateDate = ds.Tables[0].Rows[i]["CreatedDate"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["CreatedDate"]); //_fscOrd.Deliverydate = ds.Tables[0].Rows[i]["DeliveryInstruction"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["DeliveryInstruction"]); _fscOrd.Deliverydate = (ds.Tables[0].Rows[i]["DeliveryInstruction"] == DBNull.Value ? DateTime.Now : Convert.ToDateTime(ds.Tables[0].Rows[i]["DeliveryInstruction"])).ToString("dd/MM/yyyy"); _fscOrd.TotalPrice = ds.Tables[0].Rows[i]["OrderAmt"] == DBNull.Value ? 0 : Convert.ToDecimal(ds.Tables[0].Rows[i]["OrderAmt"]); _fscOrd.OrderStatus = ds.Tables[0].Rows[i]["OrderStatus"] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[i]["OrderStatus"].ToString()); _fscOrd.Status = ds.Tables[0].Rows[i]["Status"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["Status"]); _FscOList.Add(_fscOrd); } FSCOrderList.OrderList = _FscOList; } } return(FSCOrderList); }
public BZProduct GetBzProducts(int CategoryId) { BZProduct BZProductList = new BZProduct(); DataSet ds = new VideoCartDal().GetBzProducts(CategoryId); if (ds != null && ds.Tables.Count > 0) { { List <BzProduct> _BzPrdctList = new List <BzProduct>(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { BzProduct _BzPrdct = new BzProduct(); _BzPrdct.PackID = ds.Tables[0].Rows[i]["PackageID"] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[i]["PackageID"].ToString()); _BzPrdct.ProductName = ds.Tables[0].Rows[i]["ProductName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["ProductName"]); _BzPrdct.ProductHindiName = ds.Tables[0].Rows[i]["ProductHindiName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["ProductHindiName"]); _BzPrdct.OrganisationName = ds.Tables[0].Rows[i]["OrganisationName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["OrganisationName"]); _BzPrdct.BrandName = ds.Tables[0].Rows[i]["BrandName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["BrandName"]); _BzPrdct.TechnicalName = ds.Tables[0].Rows[i]["TechnicalName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["TechnicalName"]); _BzPrdct.CategoryName = ds.Tables[0].Rows[i]["CategoryName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["CategoryName"]); _BzPrdct.SubCategoryName = ds.Tables[0].Rows[i]["SubCategoryName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["SubCategoryName"]); _BzPrdct.CreatedDate = ds.Tables[0].Rows[i]["CreatedDate"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["CreatedDate"]); _BzPrdct.OurPrice = ds.Tables[0].Rows[i]["OurPrice"] == DBNull.Value ? 0 : Convert.ToDecimal(ds.Tables[0].Rows[i]["OurPrice"]); _BzPrdct.OfferPrice = ds.Tables[0].Rows[i]["OfferPrice"] == DBNull.Value ? 0 : Convert.ToDecimal(ds.Tables[0].Rows[i]["OfferPrice"]); _BzPrdct.UnitName = ds.Tables[0].Rows[i]["UnitName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["UnitName"]); _BzPrdct.ImagePath = ds.Tables[0].Rows[i]["ImagePath"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["ImagePath"]); _BzPrdct.BzProductId = ds.Tables[0].Rows[i]["RecordID"] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[i]["RecordID"].ToString()); _BzPrdct.IsActive = ds.Tables[0].Rows[i]["IsActive"] == DBNull.Value ? false : Convert.ToBoolean(ds.Tables[0].Rows[i]["IsActive"]); _BzPrdctList.Add(_BzPrdct); } BZProductList.BzProduct = _BzPrdctList; } } return(BZProductList); }
public SearchProduct GetSearchProducts(bool IsActive, int CatId, int SubCatId, int ComnyId, int BrandId, int stateID, int DistrictId, int blockID, string technicalName, int cropID, string searh, int pageNo, int pageSize, string sortColumn, string sortColumnDir) { SearchProduct SearchPrdctList = new SearchProduct(); DataSet ds = new VideoCartDal().GetSearchProducts(IsActive, CatId, SubCatId, ComnyId, BrandId, stateID, DistrictId, cropID, blockID, technicalName, cropID, searh, pageNo, pageSize, sortColumn, sortColumnDir); if (ds != null && ds.Tables.Count > 0) { { List <SearchProductList> _SearchPrdctList = new List <SearchProductList>(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { SearchProductList _Prdouct = new SearchProductList(); // _Prdouct.ROWNUM = ds.Tables[0].Rows[i]["ROWNUM"] == DBNull.Value ? 0 : Convert.ToInt64(ds.Tables[0].Rows[i]["ROWNUM"].ToString()); _Prdouct.CategoryId = ds.Tables[0].Rows[i]["CategoryId"] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[i]["CategoryId"].ToString()); _Prdouct.Company = ds.Tables[0].Rows[i]["OrganisationName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["OrganisationName"]); _Prdouct.DealerId = ds.Tables[0].Rows[i]["DealerId"] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[i]["DealerId"].ToString()); _Prdouct.DealerName = ds.Tables[0].Rows[i]["DealerName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["DealerName"]); _Prdouct.ImageUrl = ds.Tables[0].Rows[i]["ImageUrl"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["ImageUrl"]); _Prdouct.PackageId = ds.Tables[0].Rows[i]["packageId"] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[i]["packageId"].ToString()); _Prdouct.PackageName = ds.Tables[0].Rows[i]["Amount"].ToString() + " " + ds.Tables[0].Rows[i]["unitname"].ToString(); _Prdouct.Price = ds.Tables[0].Rows[i]["OurPrice"] == DBNull.Value ? 0 : Convert.ToDecimal(ds.Tables[0].Rows[i]["OurPrice"]); _Prdouct.ProductId = ds.Tables[0].Rows[i]["ProductID"] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[i]["ProductID"].ToString()); _Prdouct.ProductName = ds.Tables[0].Rows[i]["ProductName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["ProductName"]); _Prdouct.DistrictId = ds.Tables[0].Rows[i]["DistrictId"] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[i]["DistrictId"].ToString()); _Prdouct.DistrictName = ds.Tables[0].Rows[i]["DistrictName"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["DistrictName"]); _Prdouct.VideoUrl = ds.Tables[0].Rows[i]["VideoUrl"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[i]["VideoUrl"]); _SearchPrdctList.Add(_Prdouct); } SearchPrdctList.ProductList = _SearchPrdctList; } } return(SearchPrdctList); }