Пример #1
0
        public ActionResult WorkgroupPopup()
        {
            WorkgroupParams             workgroupParams = KTUtils.GetObjectFromRequest <WorkgroupParams>(Request.QueryString);
            XmlNode                     node            = KTList.GetConfigNode("workgroupgAjax.xml", "WGSRCPEOPLE");
            string                      renderHTML      = string.Empty;
            List <KTResourceSimpleView> listNew         = new List <KTResourceSimpleView>();

            if (node != null)
            {
                IEnumerable <KTResource> list = resourceService.GetList2(workgroupParams);
                listNew    = GetNewList(list);
                renderHTML = KTList.GetDataList <KTResourceSimpleView>(node, 0, 0, listNew);
            }

            string renderHTMLSelected            = string.Empty;
            IEnumerable <KTResource>    listTar  = new AgendaService().GetResourceList(workgroupParams.WG_IDS.Split(','));
            List <KTResourceSimpleView> listNew2 = GetNewList(listTar);

            renderHTMLSelected = KTList.GetDataList <KTResourceSimpleView>(node, 0, 0, listNew2);

            //ViewBag.ListHTML = renderHTML;
            //ViewBag.ListHTMLSelected = renderHTMLSelected;
            ViewBag.resourceList = JsonConvert.SerializeObject(listNew2);
            ViewBag.selectedIds  = workgroupParams.WG_IDS;

            // 获取数据
            return(View());
        }
Пример #2
0
        public ActionResult DepartmentType(FormCollection form)
        {
            string code, desc;

            for (int i = 0; i < form.Keys.Count; i++)
            {
                string         key   = form.Keys[i];
                string         value = form[key];
                DepartmentType data  = null;
                if (key.StartsWith("CODE_", StringComparison.OrdinalIgnoreCase))
                {
                    string id = key.Substring("CODE_".Length);
                    code = form["CODE_" + id];
                    desc = form["DESC_" + id];
                    data = new DepartmentType {
                        id          = Convert.ToInt32(id),
                        stringValue = code,
                        description = desc,
                    };

                    departmentTypeService.Update(data);
                }
                else if (key.StartsWith("CODE", StringComparison.OrdinalIgnoreCase))
                {
                    code = form["CODE"];
                    desc = form["DESC"];
                    if (!string.IsNullOrEmpty(code) && !string.IsNullOrEmpty(desc))
                    {
                        departmentTypeService.Insert(new DepartmentType {
                            stringValue = code,
                            description = desc,
                        });
                    }
                }
                else
                {
                }
            }

            string  result = "<div class=\"paginatorNotFound hint\" style=\"display: block; \">暂无记录</div>";
            XmlNode node   = KTList.GetConfigNode("dataTableAjax.xml", "DepartmentType");

            if (node != null)
            {
                IEnumerable <DepartmentType> list = departmentTypeService.GetList("");
                result = KTList.GetDataList <DepartmentType>(node, 0, 0, list);
            }

            ViewBag.ListHTML = result;

            return(View());
        }
Пример #3
0
        public ActionResult TaskType()
        {
            // 获取数据
            string  result = "<div class=\"paginatorNotFound hint\" style=\"display: block; \">暂无记录</div>";
            XmlNode node   = KTList.GetConfigNode("dataTableAjax.xml", "TASKTYPE");

            if (node != null)
            {
                IEnumerable <Metadata> list = service.GetList("", TypeEnum.TaskType.ToString(), null);
                result = KTList.GetDataList <Metadata>(node, 0, 0, list);
            }

            ViewBag.ListHTML = result;

            return(View());
        }
Пример #4
0
        public ActionResult IssueStatus()
        {
            // 获取数据
            string  result = "<div class=\"paginatorNotFound hint\" style=\"display: block; \">暂无记录</div>";
            XmlNode node   = KTList.GetConfigNode("dataTableAjax.xml", "IssueStatus");

            if (node != null)
            {
                List <IssueStatusExt> list = GetList();
                result = KTList.GetDataList <IssueStatusExt>(node, 0, 0, list);
            }

            ViewBag.ListHTML = result;

            return(View());
        }
Пример #5
0
        public ActionResult DepartmentType()
        {
            // 获取数据
            string  result = "<div class=\"paginatorNotFound hint\" style=\"display: block; \">暂无记录</div>";
            XmlNode node   = KTList.GetConfigNode("dataTableAjax.xml", "DepartmentType");

            if (node != null)
            {
                IEnumerable <DepartmentType> list = departmentTypeService.GetList("");
                result = KTList.GetDataList <DepartmentType>(node, 0, 0, list);
            }

            ViewBag.ListHTML = result;

            return(View());
        }
Пример #6
0
        public HttpResponseMessage PartSmartCombo([FromBody] SmartComboParams prm)
        {
            string  returnstr = "<div class=\"paginatorNotFound hint\" style=\"display: block; \">暂无记录</div>";
            XmlNode node      = KTList.GetConfigNode("partSmartCombo.xml", prm.id);

            if (node != null)
            {
                switch (prm.id.ToUpper())
                {
                case "PARENT_ID":
                    IEnumerable <ComboData> parentidlist = service.GetParentIDList(
                        this.ResourceInfo.area.ToString(),
                        this.UserID.ToString(),
                        prm.filter);
                    returnstr = KTList.GetDataList <ComboData>(node, 0, 0, parentidlist);
                    break;

                case "MANAGER":
                    IEnumerable <ComboData> managelist = service.GetManageList(
                        this.ResourceInfo.area.ToString(),
                        this.UserID.ToString(),
                        prm.filter);
                    returnstr = KTList.GetDataList <ComboData>(node, 0, 0, managelist);
                    break;

                case "TYPEID":
                    IEnumerable <Metadata> typeidlist = new MetadataService().GetList(
                        "",
                        TypeEnum.EventType.ToString(),
                        prm.filter,
                        null);
                    returnstr = KTList.GetDataList <Metadata>(node, 0, 0, typeidlist);
                    break;

                default:
                    break;
                }
            }

            return(new HttpResponseMessage()
            {
                Content = new StringContent(returnstr, Encoding.UTF8, "text/html"),
            });
        }
        // GET: app/DeleteCheck
        public ContentResult CheckHTML(string cm, string del_prev_id, int objid, string iscallback)
        {
            //{DEL_PREV_ID=OBJ_DEL&OBJID=13&CM=DELETEPREVIEW&ISCALLBACK=yes&_=1606801918899}
            string result = string.Empty;

            if (cm.ToLower() == "deletepreview")
            {
                // 获取关联关系
                XmlNode node = KTList.GetConfigNode("deletecheck.xml", "deletepreview");
                if (node != null)
                {
                    string htmlTemplate = node.SelectSingleNode("data").InnerText;
                    var    data         = new { id = objid, checkresult = "check result" };
                    result = KTList.GetContentByReplace <object>(htmlTemplate, data);
                }
            }

            return(Content(result, "text/html", Encoding.UTF8));
        }
Пример #8
0
        public ActionResult TaskType(FormCollection form)
        {
            /*
             * CODE_9: GJ
             * DESC_9: 公司项目
             * AREA_9: 5819
             * CODE: QJ
             * DESC: 区级项目
             * AREA: 5819
             */
            string code, desc, areai;

            for (int i = 0; i < form.Keys.Count; i++)
            {
                string key   = form.Keys[i];
                string value = form[key];
                if (key.StartsWith("CODE_", StringComparison.OrdinalIgnoreCase))
                {
                    string id = key.Substring("CODE_".Length);
                    code  = form["CODE_" + id];
                    desc  = form["DESC_" + id];
                    areai = form["AREA_" + id];
                    service.Update(new Metadata {
                        id            = Convert.ToInt32(id),
                        discriminator = TypeEnum.TaskType.ToString(),
                        description   = desc,
                        stringValue   = code,
                        areai         = (areai == null ? 0 : Convert.ToInt32(areai)),
                        areas         = (areai == null ? 0 : Convert.ToInt32(areai)),
                    });;
                }
                else if (key.StartsWith("CODE", StringComparison.OrdinalIgnoreCase))
                {
                    code  = form["CODE"];
                    desc  = form["DESC"];
                    areai = form["AREA"];
                    if (!string.IsNullOrEmpty(code) && !string.IsNullOrEmpty(desc))
                    {
                        service.Insert(new Metadata {
                            discriminator = TypeEnum.TaskType.ToString(),
                            description   = desc,
                            stringValue   = code,
                            areai         = (areai == null ? 0 : Convert.ToInt32(areai)),
                            areas         = (areai == null ? 0 : Convert.ToInt32(areai)),
                        });
                    }
                }
                else
                {
                }
            }

            string  result = "<div class=\"paginatorNotFound hint\" style=\"display: block; \">暂无记录</div>";
            XmlNode node   = KTList.GetConfigNode("dataTableAjax.xml", "TASKTYPE");

            if (node != null)
            {
                IEnumerable <Metadata> list = service.GetList("", TypeEnum.TaskType.ToString(), null);
                result = KTList.GetDataList <Metadata>(node, 0, 0, list);
            }

            ViewBag.ListHTML = result;

            return(View());
        }
Пример #9
0
        public ActionResult WorklogStatus(FormCollection form)
        {
            /*
             * CODE_9: GJ
             * DESC_9: 公司项目
             * AREA_9: 5819
             * CODE: QJ
             * DESC: 区级项目
             * AREA: 5819
             */
            string code, desc, color;
            int?   _areai    = null;
            int?   _intvalue = 0;

            for (int i = 0; i < form.Keys.Count; i++)
            {
                string   key   = form.Keys[i];
                string   value = form[key];
                Metadata data  = null;
                if (key.StartsWith("CODE_", StringComparison.OrdinalIgnoreCase))
                {
                    string id = key.Substring("CODE_".Length);
                    code  = form["CODE_" + id];
                    desc  = form["DESC_" + id];
                    color = form["COLOR_" + id];
                    if (!string.IsNullOrEmpty(form["AREA_" + id]))
                    {
                        _areai = Convert.ToInt32(form["AREA_" + id]);
                    }
                    if (!string.IsNullOrEmpty(form["CODE_" + id]))
                    {
                        _intvalue = Convert.ToInt32(form["CODE_" + id]);
                    }
                    data = new Metadata {
                        id            = Convert.ToInt32(id),
                        discriminator = TypeEnum.WLSTS.ToString(),
                        description   = desc,
                        intValue      = _intvalue,
                        areai         = _areai,
                        color         = color
                    };

                    service.Update(data);
                }
                else if (key.StartsWith("CODE", StringComparison.OrdinalIgnoreCase))
                {
                    code  = form["CODE"];
                    desc  = form["DESC"];
                    color = form["COLOR"];
                    if (!string.IsNullOrEmpty(form["AREA"]))
                    {
                        _areai = Convert.ToInt32(form["AREA"]);
                    }
                    if (!string.IsNullOrEmpty(form["CODE"]))
                    {
                        _intvalue = Convert.ToInt32(form["CODE"]);
                    }
                    if (!string.IsNullOrEmpty(code) && !string.IsNullOrEmpty(desc))
                    {
                        service.Insert(new Metadata {
                            discriminator = TypeEnum.WLSTS.ToString(),
                            description   = desc,
                            intValue      = _intvalue,
                            areai         = _areai,
                            color         = color
                        });
                    }
                }
                else
                {
                }
            }

            string  result = "<div class=\"paginatorNotFound hint\" style=\"display: block; \">暂无记录</div>";
            XmlNode node   = KTList.GetConfigNode("dataTableAjax.xml", "WorklogStatus");

            if (node != null)
            {
                IEnumerable <Metadata> list = service.GetList("", TypeEnum.WLSTS.ToString(), null);
                result = KTList.GetDataList <Metadata>(node, 0, 0, list);
            }

            ViewBag.ListHTML = result;

            return(View());
        }
Пример #10
0
        public ActionResult IssueStatus(FormCollection form)
        {
            /*
             * ORDE_14095: 1
             * DESC_14095: open
             * COLOR_14095: #3bbf67
             * AREA_14095: 5944
             * ASOP_14095: yes
             * ck_ASOP_14095: yes
             * ASCL_14095: no
             * ASKC_14095: no
             * ASKW_14095: no
             */
            string desc, color;
            int    orderby = 0;
            int?   _areax = 0;
            bool   asop = false, ascl = false, askc = false, askw = false;

            for (int i = 0; i < form.Keys.Count; i++)
            {
                string      key   = form.Keys[i];
                string      value = form[key];
                IssueStatus data  = null;
                if (key.StartsWith("ORDE_", StringComparison.OrdinalIgnoreCase))
                {
                    string id = key.Substring("ORDE_".Length);
                    color   = form["COLOR_" + id];
                    desc    = form["DESC_" + id];
                    orderby = Convert.ToInt32(form["ORDE_" + id]);
                    asop    = form["ASOP_" + id] == "yes" ? true : false;
                    ascl    = form["ASCL_" + id] == "yes" ? true : false;
                    askc    = form["ASKC_" + id] == "yes" ? true : false;
                    askw    = form["ASKW_" + id] == "yes" ? true : false;
                    if (!string.IsNullOrEmpty(form["AREA_" + id]))
                    {
                        _areax = Convert.ToInt32(form["AREA_" + id]);
                    }

                    data = new IssueStatus {
                        id              = Convert.ToInt32(id),
                        color           = color,
                        description     = desc,
                        askForComment   = askc,
                        askForWorklog   = askw,
                        behavesAsClosed = ascl,
                        behavesAsOpen   = asop,
                        orderBy         = orderby,
                        areax           = _areax
                    };

                    issueStatusService.Update(data);
                }
                else if (key.StartsWith("ORDE", StringComparison.OrdinalIgnoreCase))
                {
                    color   = form["COLOR"];
                    desc    = form["DESC"];
                    orderby = Convert.ToInt32(form["ORDE"]);
                    asop    = form["ASOP"] == "yes" ? true : false;
                    ascl    = form["ASCL"] == "yes" ? true : false;
                    askc    = form["ASKC"] == "yes" ? true : false;
                    askw    = form["ASKW"] == "yes" ? true : false;
                    if (!string.IsNullOrEmpty(form["AREA"]))
                    {
                        _areax = Convert.ToInt32(form["AREA"]);
                    }

                    data = new IssueStatus {
                        color           = color,
                        description     = desc,
                        askForComment   = askc,
                        askForWorklog   = askw,
                        behavesAsClosed = ascl,
                        behavesAsOpen   = asop,
                        orderBy         = orderby,
                        areax           = _areax
                    };

                    if (!string.IsNullOrEmpty(desc) && !string.IsNullOrEmpty(color))
                    {
                        issueStatusService.Insert(data);
                    }
                }
                else
                {
                }
            }

            string  result = "<div class=\"paginatorNotFound hint\" style=\"display: block; \">暂无记录</div>";
            XmlNode node   = KTList.GetConfigNode("dataTableAjax.xml", "IssueStatus");

            if (node != null)
            {
                List <IssueStatusExt> list = GetList();
                result = KTList.GetDataList <IssueStatusExt>(node, 0, 0, list);
            }

            ViewBag.ListHTML = result;

            return(View());
        }