Esempio n. 1
0
        public List <UserCustomerList_VM> GetCustomerData(UserCustomerList_VM Model)
        {
            var query = new List <UserCustomerList_VM>();

            try
            {
                using (var db = new DBConnection())
                {
                    var ds  = new DataSet();
                    var par = new SqlParameter[] {
                        new SqlParameter("@p_LocationID", GetDBNULL(Model.LocationID, true)),

                        new SqlParameter("@p_LanguageCode", GetDBNULLString(Model.CurrentLanguageCode)),
                        new SqlParameter("@p_EndUserID", GetDBNULL(Model.EndUserID, true)),
                        new SqlParameter("@p_UserRoleID", GetDBNULL(Model.CurrentUserRoleID, true)),
                        new SqlParameter("@p_ScreenID", GetDBNULL(Model.CurrentScreenID, true)),
                        new SqlParameter("@p_AccessPoint", GetDBNULLString(Model.AccessPoint))
                    };

                    ds    = db.ExecuteDataSet("GetOrganizationAndCustomer", par);
                    query = ConvertToList <UserCustomerList_VM>(ds.Tables[0]);
                }
            }
            catch (Exception ex)
            {
                logger.Error("EndUserRepository_GetCustomerData Error: ", ex);
                throw;
            }

            return(query);
        }
Esempio n. 2
0
        public JsonResult GetCustomerData(UserCustomerList_VM Model)
        {
            List <UserCustomerList_VM> vm = new List <UserCustomerList_VM>();

            try
            {
                GetUserInfo(Model);
                vm = _UserRepo.GetCustomerData(Model);

                return(Json(new JsonResponse("Success", "Success", vm), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new JsonResponse("Error", "Error occured while processing request: " + ex.Message.ToString(), null), JsonRequestBehavior.AllowGet));
            }
        }