Esempio n. 1
0
        public ActionResult GetByID(int entryid)
        {
            IDbConnection dbConn = new OrmliteConnection().openConn();

            try
            {
                var data      = AuthUser.GetById(entryid);
                var ref_Roles = CustomModel.GetActiveStatus();

                var data_images_common = new List <ImgUploadModel>();
                if (!string.IsNullOrEmpty(data.avatarpath))
                {
                    data_images_common.Add(new ImgUploadModel()
                    {
                        key = 0, value = data.avatarpath
                    });
                }

                return(Json(new
                {
                    success = true,
                    data = data
                    ,
                    ref_Roles = ref_Roles
                    ,

                    data_images_common = data_images_common
                }));
            }
            catch (Exception e)
            {
                return(Json(new { success = false, message = e.Message }));
            }
            finally { dbConn.Close(); }
        }
Esempio n. 2
0
        public ActionResult Index(string redirectbyajax, string entryid, string actiontype, string fa)
        {
            //fa: form another - default form popup
            IDbConnection dbConn = new OrmliteConnection().openConn();
            var           dict   = new Dictionary <string, object>();

            dict["activestatus"]   = CustomModel.GetActiveStatus();
            dict["listlanguage"]   = CustomModel.GetLanguage();
            dict["areasname"]      = "Admin";
            dict["redirectbyajax"] = string.IsNullOrEmpty(redirectbyajax) ? "0" : "1";
            dbConn.Close();


            var dataModel = HomePage.GetLast();

            if (dataModel == null)
            {
                dataModel = new HomePage();
            }
            dict["dataModel"] = dataModel;
            dbConn.Close();

            //param cho form
            ViewBag.entryid    = dataModel.entryid == 0 ? "0" : dataModel.entryid.ToString();
            ViewBag.actiontype = string.IsNullOrEmpty(actiontype) ? "" : actiontype;
            ViewBag.fa         = string.IsNullOrEmpty(fa) ? "" : fa;
            return(View("HomePageManagementTree", dict));
        }
        //===============================================Import export==================================================

        //===============================================Openpopup======================================================


        #endregion
        #region Form
        public ActionResult FormPopup(string entryid, string entrykey, string redirectbyajax)
        {
            IDbConnection dbConn = new OrmliteConnection().openConn();
            var           dict   = new Dictionary <string, object>();

            dict["activestatus"] = CustomModel.GetActiveStatus();
            dbConn.Close();

            //set parameter

            dict["redirectbyajax"] = redirectbyajax;
            ViewBag.entryid        = string.IsNullOrEmpty(entryid) ? "0" : entryid;
            ViewBag.entrykey       = string.IsNullOrEmpty(entrykey) ? "0" : entrykey;
            return(View("UserManagementForm", dict));
        }
        public ActionResult Index(string redirectbyajax, string entryid, string actiontype, string fa)
        {
            //fa: form another - default form popup
            IDbConnection dbConn = new OrmliteConnection().openConn();
            var           dict   = new Dictionary <string, object>();

            dict["activestatus"]   = CustomModel.GetActiveStatus();
            dict["listLoginType"]  = CustomModel.GetLoginTypeDDL();
            dict["listlanguage"]   = CustomModel.GetLanguage();
            dict["areasname"]      = "Admin";
            dict["redirectbyajax"] = string.IsNullOrEmpty(redirectbyajax) ? "0" : "1";
            dbConn.Close();

            //param cho form
            ViewBag.entryid    = string.IsNullOrEmpty(entryid) ? "0" : entryid;
            ViewBag.actiontype = string.IsNullOrEmpty(actiontype) ? "" : actiontype;
            ViewBag.fa         = string.IsNullOrEmpty(fa) ? "" : fa;
            return(View("UserManagementTree", dict));
        }
        public ActionResult GetByID(int entryid)
        {
            IDbConnection dbConn = new OrmliteConnection().openConn();

            try
            {
                var data      = AuthUser.GetById(entryid, null, false);
                var ref_Roles = CustomModel.GetActiveStatus();
                return(Json(new
                {
                    success = true,
                    data = data
                }));
            }
            catch (Exception e)
            {
                return(Json(new { success = false, message = e.Message }));
            }
            finally { dbConn.Close(); }
        }