Exemple #1
0
        public JsonResult Create(SecUserInstituteSave sec_user_institute)
        {
            bool   is_success = false;
            string msg        = @"";

            if (ModelState.IsValid)
            {
                this.GetLoginInfo();
                try {
                    if (sec_user_institute.IS_ACTIVE.HasValue)
                    {
                        //db.SEC_USER_INSTITUTE_INSERT(this.sess_USER_NO, this.sess_LOGON_NO, sec_user_institute.USER_NO, sec_user_institute.INSTITUTE_NO, sec_user_institute.IS_ACTIVE, sec_user_institute.ACTIVE_FROM, sec_user_institute.ACTIVE_TO, sec_user_institute.SL_NUM);
                        db.SEC_USER_INSTITUTE_SAVE(this.sess_USER_NO, this.sess_LOGON_NO, sec_user_institute.USER_NO, sec_user_institute.INSTITUTE_NO, sec_user_institute.IS_ACTIVE, sec_user_institute.ACTIVE_FROM, sec_user_institute.ACTIVE_TO, sec_user_institute.SL_NUM);
                    }

                    is_success = true;
                    msg        = "saved successfully.";
                } catch (Exception ex) {
                    is_success = false;
                    msg        = "May be already added.";
                }
            }

            var ressult = new { @is_success = is_success, @msg = msg };

            return(Json(ressult, JsonRequestBehavior.AllowGet));
        }