Пример #1
0
        public int AddRulesetting(string rulesettings)
        {
            var list           = JsonConvert.DeserializeObject <List <Rulesettings> >(rulesettings);
            var addrulesetting = HttpClientApi.PostAsync <List <Rulesettings>, int>(list, "http://localhost:12345/api/RuleSetting/AddRulesettings");

            return(addrulesetting);
        }
Пример #2
0
        /// <summary>
        /// 添加配置方法
        /// </summary>
        /// <param name="approvalConfiguration"></param>
        /// <returns></returns>
        public JsonResult AddApprovalConfiguration(ApprovalConfiguration approvalConfiguration)
        {
            var listApprovalConfiguration = new List <ApprovalConfiguration>();
            //查询活动表所有的活动Id
            var listRoleUser = HttpClientApi.GetAsync <List <ApprovalConfiguration> >(HttpHelper.Url + "Activity/GetActivityId");
            //linq进行筛选是否配置
            var firstOrDefault = listRoleUser.Count(p => p.ActivityId.Equals(approvalConfiguration.ActivityId) && p.IsEnable == 0);

            //若配置则返回0
            if (firstOrDefault > 0)
            {
                return(Json(new { result = 0 }, new JsonSerializerSettings()));
            }
            //拿出级别的Id
            var level = approvalConfiguration.UserLevelId;

            if (level != 0)
            {
                //获取所有的活动级别
                var listUserLevel = HttpClientApi.GetAsync <List <UserLevel> >(HttpHelper.Url + "Activity/GetListUserLevel");
                var allLevels     = listUserLevel.Where(p => p.Id <= level).ToList();
                foreach (var userLevel in allLevels)
                {
                    var configuration = new ApprovalConfiguration()
                    {
                        ActivityId  = approvalConfiguration.ActivityId,
                        CreateTime  = DateTime.Now,
                        DownId      = 0,
                        Start       = "未审批",
                        RoleId      = userLevel.RoleId,
                        UserLevelId = level,
                        UserId      = userLevel.UserId,
                        IsEnable    = 0
                    };
                    listApprovalConfiguration.Add(configuration);
                }
                var results = HttpClientApi.PostAsync <List <ApprovalConfiguration>, int>(listApprovalConfiguration, HttpHelper.Url + "Activity/AddApprovalConfiguration");
                return(Json(new { results }, new JsonSerializerSettings()));
            }
            //没有则添加一个状态
            approvalConfiguration.Start = "未审批";
            //进行一个时间的赋值
            approvalConfiguration.CreateTime = DateTime.Now;
            approvalConfiguration.IsEnable   = 0;
            listApprovalConfiguration.Add(approvalConfiguration);
            var result = HttpClientApi.PostAsync <List <ApprovalConfiguration>, int>(listApprovalConfiguration, HttpHelper.Url + "Activity/AddApprovalConfiguration");

            return(Json(new { result }, new JsonSerializerSettings()));
        }
Пример #3
0
        public ActionResult Add(Professionalgroup model)
        {
            var i = HttpClientApi.PostAsync <Professionalgroup, int>(model, HttpHelper.Url + "Group/Add");

            return(Redirect("/Group/Index"));
        }
Пример #4
0
        public int Add(SolitaireSet model)
        {
            var i = HttpClientApi.PostAsync <SolitaireSet, int>(model, HttpHelper.Url + "Solitaire/Add");

            return(i);
        }
Пример #5
0
        /// <summary>
        /// 添加方法
        /// </summary>
        /// <returns></returns>
        public int AddHierarchie(Hierarchy hierarchy)
        {
            var addhierarchie = HttpClientApi.PostAsync <Hierarchy, int>(hierarchy, "http://localhost:12345/api/Hierarchy/AddHierarchy");

            return(addhierarchie);
        }
        /// <summary>
        /// 添加方法
        /// </summary>
        /// <returns></returns>
        public int AddPosition(Position position)
        {
            var addposition = HttpClientApi.PostAsync <Position, int>(position, "http://localhost:12345/api/Position/AddPosition");

            return(addposition);
        }
Пример #7
0
        /// <summary>
        /// 编辑状态
        /// </summary>
        /// <returns></returns>
        public int IsanbleUpdate(Permission permission)
        {
            var isanbleupdate = HttpClientApi.PostAsync <Permission, int>(permission, "http://localhost:12345/api/Role/UpdateIsable");

            return(isanbleupdate);
        }
        public ActionResult Add(Clinicuser model)
        {
            var i = HttpClientApi.PostAsync <Clinicuser, int>(model, HttpHelper.Url + "Clinical/Add");

            return(Redirect("/Clinical/Index"));
        }
Пример #9
0
        public int AddRole(Role roles, string ids)
        {
            var addrole = HttpClientApi.PostAsync <Role, int>(roles, "http://localhost:12345/api/Role/AddRoles?ids=" + ids);

            return(addrole);
        }
Пример #10
0
        public int Updaterole(Role roles, string ids)
        {
            var updaterole = HttpClientApi.PostAsync <Role, int>(roles, "http://localhost:12345/api/Role/UpdateRoles?ids=" + ids);

            return(updaterole);
        }
        public int PermissionUpdates(Permission permission)
        {
            var result = HttpClientApi.PostAsync <Permission, int>(permission, "http://localhost:12345/api/Permission/UpdatePermmission");

            return(result);
        }
        /// <summary>
        /// 权限编辑状态
        /// </summary>
        /// <returns></returns>
        public int IsanbleUpdate(Permission permission)
        {
            var result = HttpClientApi.PostAsync <Permission, int>(permission, "http://localhost:12345/api/Permission/UpdateIsable");

            return(result);
        }
Пример #13
0
        public int AddAreaAction(Area area)
        {
            var result = HttpClientApi.PostAsync <Area, int>(area, HttpHelper.Url + " Areas/AddArea");

            return(result);
        }
Пример #14
0
        public ActionResult Add(Administrative model)
        {
            var i = HttpClientApi.PostAsync <Administrative, int>(model, HttpHelper.Url + "Department/Add");

            return(Redirect("/Department/Index"));
        }
        public int OopUserUpdates(Ooperationuser ooperationuser)
        {
            var result = HttpClientApi.PostAsync <Ooperationuser, int>(ooperationuser, "http://localhost:12345/api/Ooperationuser/UpdateOoperationUser");

            return(result);
        }