Ejemplo n.º 1
0
        public IHttpActionResult getgrp_masterById(string GRP_CDs)
        {
            List <GRP_MASTERDomain> grp = new List <GRP_MASTERDomain>();

            grp = GRP_MASTERCRUD.GetMenuById(GRP_CDs);
            return(Ok(grp));
        }
Ejemplo n.º 2
0
        public IHttpActionResult getgrp_master()
        {
            List <GRP_MASTERDomain> grp = new List <GRP_MASTERDomain>();

            grp = GRP_MASTERCRUD.GetAllMenu();
            return(Ok(grp));
        }
Ejemplo n.º 3
0
        // GET: Category
        public ActionResult Index(int brandId)
        {
            ViewBag.BrandId = brandId;
            ViewBag.Brands  = BrandmasterCRUD.GetBrandMaster();
            var categories = GRP_MASTERCRUD.GetCategoryByBrandId(brandId);

            return(View());
        }
Ejemplo n.º 4
0
        public ActionResult GetCategoryList(string brandId, int?page, string record1, string ShortBy, string[] checkedValues)
        {
            try
            {
                int pageSize = 0;
                List <GRP_MASTERDomain> categories = new List <GRP_MASTERDomain>();
                if (string.IsNullOrEmpty(record1))
                {
                    pageSize = Convert.ToInt32(record1);
                }
                else
                {
                    pageSize = Convert.ToInt32(record1);
                }
                if (checkedValues == null)
                {
                    categories            = GRP_MASTERCRUD.GetCategoryByBrandId(Convert.ToInt32(brandId));
                    ViewBag.RecordPerPage = pageSize;
                    ViewBag.TotalRecord   = categories.Count();
                }

                else
                {
                    categories = GRP_MASTERCRUD.GetAllCategory().Where(x => checkedValues.Any(a => a.ToString() == x.BrandId)).ToList();
                }

                var pager = new Pager(categories.Count(), page, pageSize);
                pager.catId = brandId;

                var viewModel = new IndexViewModel
                {
                    Categories = categories.Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize).ToList(),
                    Pager      = pager
                };
                return(PartialView("_categoryListing", viewModel));
            }
            catch (Exception ex)
            {
                ExceptionLogDomain obj = new ExceptionLogDomain();
                obj.MethodName     = "GetProductList";
                obj.ControllerName = "Product";
                obj.ErrorText      = ex.Message;
                obj.StackTrace     = ex.StackTrace;
                obj.Datetime       = DateTime.Now;

                ExceptionLogCRUD.AddToExceptionLog(obj);
                return(RedirectToAction("Index", "Error"));
            }
        }
Ejemplo n.º 5
0
        public ActionResult GetMenuSubMenuList()
        {
            try
            {
                var data = GRP_MASTERCRUD.GetAllMenu();
                return(PartialView("Menu_Submenu", data));
            }
            catch (Exception ex)
            {
                ExceptionLogDomain obj = new ExceptionLogDomain();
                obj.MethodName     = "GetMenuSubMenuList";
                obj.ControllerName = "Menu";
                obj.ErrorText      = ex.Message;
                obj.StackTrace     = ex.StackTrace;
                obj.Datetime       = DateTime.Now;

                ExceptionLogCRUD.AddToExceptionLog(obj);
                return(RedirectToAction("Index", "Error"));
            }
        }
        //public IHttpActionResult getgrp_master()
        //{
        //    List<grp_masterTbl> grp = new List<grp_masterTbl>();
        //    string mainconn = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
        //    SqlConnection sqlconn = new SqlConnection(mainconn);
        //    string sqlquery = "select * from GRP_MASTER";
        //    SqlCommand sqlcmd = new SqlCommand(sqlquery, sqlconn);
        //    SqlDataReader sdr = sqlcmd.ExecuteReader();
        //    while (sdr.Read())
        //    {
        //        grp.Add(new grp_masterTbl()
        //        {
        //            GRP_CD = sdr.GetValue(0).ToString(),
        //            GRP_NAME = sdr.GetValue(1).ToString(),
        //            FOR_GRP_CD = sdr.GetValue(2).ToString(),
        //            LEVEL_TEXT = sdr.GetValue(3).ToString(),
        //            GROUP_YN = sdr.GetValue(4).ToString()
        //        });
        //    }
        //    return Ok(grp);
        //}
        public IHttpActionResult getgrp_masters()
        {
            HttpResponseMessage response;

            try
            {
                var detailsResponse = GRP_MASTERCRUD.GetAllMenu();
                if (detailsResponse != null)
                {
                    response = Request.CreateResponse <List <GRP_MASTERDomain> >(HttpStatusCode.OK, detailsResponse);
                }
                else
                {
                    response = new HttpResponseMessage(HttpStatusCode.NotFound);
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message);
            }
            return((IHttpActionResult)response);
        }
Ejemplo n.º 7
0
        public ActionResult GetMenuList()
        {
            try
            {
                var data = GRP_MASTERCRUD.GetAllMenu();
                ViewBag.totalItemsInWishList = CustmorWishlistCRUD.GetWishlistByCustomerId(Convert.ToInt32(Session["idUser"])).Count();

                return(PartialView("Menu", data));
            }
            catch (Exception ex)
            {
                ExceptionLogDomain obj = new ExceptionLogDomain();
                obj.MethodName     = "GetMenuList";
                obj.ControllerName = "Menu";
                obj.ErrorText      = ex.Message;
                obj.StackTrace     = ex.StackTrace;
                obj.Datetime       = DateTime.Now;

                ExceptionLogCRUD.AddToExceptionLog(obj);
                return(RedirectToAction("Index", "Error"));
            }
        }