Ejemplo n.º 1
0
        public dynamic Update_Permission([FromBody] Newtonsoft.Json.Linq.JObject param)
        {
            dynamic result = null;

            try
            {
                dynamic dd            = param;
                int     permission_id = dd.permission_id;

                string permission_name = dd.permission_name;


                dynamic        main       = _repositoryWrapper.Permission_Repository.GetPermissionbyid(permission_id);
                tbl_permission permission = main as tbl_permission;

                permission.permission_id   = permission_id;
                permission.permission_name = permission_name;

                _repositoryWrapper.Permission_Repository.Update(permission);
                result = new { Status = 1, Message = "Update Successfully", data = new { } };
            }
            catch (Exception ex)
            {
                result = new { Status = 0, Message = "Update Fail", data = new { } };
                Console.WriteLine(ex.Message);
            }
            return(result);
        }
Ejemplo n.º 2
0
        public dynamic Save_Permission([FromBody] Newtonsoft.Json.Linq.JObject param)
        {
            // dynamic dd = param;
            // int id = dd.id;
            dynamic result = null;

            try
            {
                dynamic dd            = param;
                int     permission_id = dd.permission_id;

                string permission_name = dd.permission_name;


                tbl_permission permission = new tbl_permission();

                permission.permission_id   = permission_id;
                permission.permission_name = permission_name;

                _repositoryWrapper.Permission_Repository.Create(permission);
                result = new { Status = 1, Message = "Save Successfully", data = new { } };
            }
            catch (Exception ex)
            {
                result = new { Status = 0, Message = "Save Fail", data = new { } };
                Console.WriteLine(ex.Message);
            }
            return(result);
        }