Exemplo n.º 1
0
        public IHttpActionResult getgrp_master()
        {
            List <GRP_MASTERDomain> grp = new List <GRP_MASTERDomain>();

            grp = GRP_MASTERCRUD.GetAllMenu();
            return(Ok(grp));
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 4
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"));
            }
        }