public TempOrderDetailsModel GetTempOrderDetail(int UserId, string MobileNo)
        {
            DataSet ds = _rsdal.GetTempOrderDetail(UserId, MobileNo);

            TempOrderDetailsModel  _TempOrdList = new TempOrderDetailsModel();
            List <TempOrderDetail> _TempList    = new List <TempOrderDetail>();

            if (ds != null && ds.Tables[0] != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        TempOrderDetail      _OrdDetails = new TempOrderDetail();
                        BZProductDescription _TempOrd    = new BZProductDescription();
                        _TempOrd.PackageId   = Convert.ToInt32(ds.Tables[0].Rows[i]["PackageId"].ToString());
                        _TempOrd.PackageName = ds.Tables[0].Rows[i]["ProductName"].ToString() + " - " + ds.Tables[0].Rows[i]["TechnicalName"].ToString()
                                               + "(" + ds.Tables[0].Rows[i]["Amount"].ToString() + ds.Tables[0].Rows[i]["unitname"].ToString()
                                               + ds.Tables[0].Rows[i]["ourprice"].ToString() + ")";
                        _TempOrd.CategoryId  = Convert.ToInt32(ds.Tables[0].Rows[i]["categoryId"].ToString());
                        _TempOrd.ProductId   = Convert.ToInt32(ds.Tables[0].Rows[i]["ProductID"].ToString());
                        _TempOrd.ProductName = ds.Tables[0].Rows[i]["ProductName"].ToString();
                        _TempOrd.Company     = ds.Tables[0].Rows[i]["OrganisationName"].ToString();
                        _TempOrd.Price       = Convert.ToDecimal(ds.Tables[0].Rows[i]["ourprice"].ToString());
                        _TempOrd.DealerId    = Convert.ToInt32(ds.Tables[0].Rows[i]["dealerId"].ToString());
                        _TempOrd.DealerName  = ds.Tables[0].Rows[i]["DealerName"].ToString();
                        _TempOrd.ImageUrl    = ds.Tables[0].Rows[i]["ImageUrl"].ToString();
                        _TempOrd.VideoUrl    = ds.Tables[0].Rows[i]["VideoUrl"].ToString();

                        _OrdDetails.Quantity = Convert.ToInt32(ds.Tables[0].Rows[i]["Quantity"].ToString());
                        _OrdDetails.product  = _TempOrd;
                        _TempList.Add(_OrdDetails);
                    }
                }
            }
            _TempOrdList.List = _TempList;


            return(_TempOrdList);
        }
        public CategogyProductViewModel GetCategoryProductDetail(int StateId, int DistrictId, int CatId, int SubCatId)
        {
            DataSet ds = _rsdal.GetCategoryProductDetail(StateId, DistrictId, CatId, SubCatId);

            CategogyProductViewModel _catProList = new CategogyProductViewModel();

            //if (ds != null && ds.Tables[0] != null)
            //{
            //    if (ds.Tables[0].Rows.Count > 0)
            //    {
            //        List<CategoryDetail> _catList = new List<CategoryDetail>();
            //        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            //        {
            //            CategoryDetail _category = new CategoryDetail();
            //            _category.CategoryId = Convert.ToInt32(ds.Tables[0].Rows[i]["CategoryID"].ToString());
            //            _category.CategoryName = ds.Tables[0].Rows[i]["CategoryName"].ToString();
            //            _catList.Add(_category);
            //        }
            //        _catProList._categoryList = _catList;
            //    }
            //}

            /*
             * productId	PackageId	ProductName	TechNameID	TechnicalName	Amount	ourprice
             * unitname	SubCategoryId	SubCategoryName	categoryId	categoryName	CompanyId	OrganisationName	dealerId
             */
            if (ds != null && ds.Tables[1] != null)
            {
                if (ds.Tables[1].Rows.Count > 0)
                {
                    List <BZProductDescription> _prodList = new List <BZProductDescription>();
                    for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
                    {
                        BZProductDescription _product = new BZProductDescription();
                        _product.PackageId = Convert.ToInt32(ds.Tables[1].Rows[i]["PackageId"].ToString());
                        //  _product.PackageName = ds.Tables[1].Rows[i]["ProductName"].ToString() + " - " + ds.Tables[1].Rows[i]["TechnicalName"].ToString()
                        //     + "(" + ds.Tables[1].Rows[i]["Amount"].ToString() + ds.Tables[1].Rows[i]["unitname"].ToString()
                        //    + ds.Tables[1].Rows[i]["ourprice"].ToString() + ")";
                        _product.PackageName = ds.Tables[1].Rows[i]["Amount"].ToString() + " " + ds.Tables[1].Rows[i]["unitname"].ToString();
                        _product.CategoryId  = Convert.ToInt32(ds.Tables[1].Rows[i]["categoryId"].ToString());
                        _product.ProductId   = Convert.ToInt32(ds.Tables[1].Rows[i]["productId"].ToString());
                        _product.ProductName = ds.Tables[1].Rows[i]["ProductName"].ToString();
                        _product.Company     = ds.Tables[1].Rows[i]["OrganisationName"].ToString();
                        _product.Price       = Convert.ToDecimal(ds.Tables[1].Rows[i]["ourprice"].ToString());
                        _product.DealerId    = Convert.ToInt32(ds.Tables[1].Rows[i]["dealerId"].ToString());
                        _product.DealerName  = ds.Tables[1].Rows[i]["DealerName"].ToString();
                        _product.ImageUrl    = ds.Tables[1].Rows[i]["ImageUrl"].ToString();
                        _product.VideoUrl    = ds.Tables[1].Rows[i]["VideoUrl"].ToString();

                        _prodList.Add(_product);
                    }
                    _catProList._productList = _prodList;
                }
            }

            if (ds != null && ds.Tables[2] != null)
            {
                if (ds.Tables[2].Rows.Count > 0)
                {
                    List <DealerDetail> _dealerList = new List <DealerDetail>();
                    for (int i = 0; i < ds.Tables[2].Rows.Count; i++)
                    {
                        DealerDetail _dealer = new DealerDetail();
                        _dealer.DealerId   = Convert.ToInt32(ds.Tables[2].Rows[i]["DealerId"].ToString());
                        _dealer.DealerName = ds.Tables[2].Rows[i]["DealerName"].ToString();
                        _dealerList.Add(_dealer);
                    }
                    _catProList._dealerList = _dealerList;
                }
            }


            return(_catProList);
        }
        public BZAgentProductViewModel GetCategoryProductDetail(int StateId, int DistrictId, int CatId, int SubCatId, int PackageID = 0)
        {
            DataSet ds = _Apdal.GetCategoryProductDetail(StateId, DistrictId, CatId, SubCatId, PackageID);

            BZAgentProductViewModel _catProList = new BZAgentProductViewModel();

            //if (ds != null && ds.Tables[0] != null)
            //{
            //    if (ds.Tables[0].Rows.Count > 0)
            //    {
            //        List<ProductPopularDetail> _popularList = new List<ProductPopularDetail>();
            //        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            //        {
            //            ProductPopularDetail _popular = new ProductPopularDetail();
            //            _popular.ProductId = Convert.ToInt32(ds.Tables[0].Rows[i]["ProductId"].ToString());
            //            _popular.ProductName = ds.Tables[0].Rows[i]["ProductName"].ToString();
            //            _popularList.Add(_popular);
            //        }
            //        _catProList._PopularProductList = _popularList;
            //    }
            //}

            /*
             * productId	PackageId	ProductName	TechNameID	TechnicalName	Amount	ourprice
             * unitname	SubCategoryId	SubCategoryName	categoryId	categoryName	CompanyId	OrganisationName	dealerId
             */
            if (ds != null && ds.Tables[0] != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    List <BZProductDescription> _prodList = new List <BZProductDescription>();
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        BZProductDescription _product = new BZProductDescription();
                        _product.PackageId   = Convert.ToInt32(ds.Tables[0].Rows[i]["PackageId"].ToString());
                        _product.PackageName = ds.Tables[0].Rows[i]["Amount"].ToString() + " " + ds.Tables[0].Rows[i]["unitname"].ToString();

                        _product.CategoryId    = Convert.ToInt32(ds.Tables[0].Rows[i]["categoryId"].ToString());
                        _product.SubCategoryId = Convert.ToInt32(ds.Tables[0].Rows[i]["SubCategoryId"].ToString());
                        _product.BrandID       = Convert.ToInt32(ds.Tables[0].Rows[i]["BrandID"].ToString());
                        _product.ProductId     = Convert.ToInt32(ds.Tables[0].Rows[i]["productId"].ToString());
                        _product.ProductName   = ds.Tables[0].Rows[i]["ProductName"].ToString();
                        _product.DistrictId    = Convert.ToInt32(ds.Tables[0].Rows[i]["DistrictID"].ToString());
                        _product.DistrictName  = ds.Tables[0].Rows[i]["DistrictName"].ToString();
                        _product.Company       = ds.Tables[0].Rows[i]["OrganisationName"].ToString();
                        _product.TechnicalName = ds.Tables[0].Rows[i]["TechnicalName"].ToString();
                        _product.CompanyId     = Convert.ToInt32(ds.Tables[0].Rows[i]["CompanyID"].ToString());
                        _product.Price         = Convert.ToDecimal(ds.Tables[0].Rows[i]["ourprice"].ToString());
                        _product.DealerId      = Convert.ToInt32(ds.Tables[0].Rows[i]["dealerId"].ToString());
                        _product.DealerName    = ds.Tables[0].Rows[i]["DealerName"].ToString();
                        _product.IsTrending    = Convert.ToInt32(ds.Tables[0].Rows[i]["IsTrendingProduct"].ToString());
                        _prodList.Add(_product);
                    }
                    _catProList._productList = _prodList;
                }
            }



            return(_catProList);
        }