Exemple #1
0
        private string GetListHTML(int userID)
        {
            IDocumentService service = new DocumentService();
            int         pageIndex    = 0;
            int         pageSize     = 10;
            int         count        = 0;
            XmlDocument doc          = new XmlDocument();

            doc.Load(AppDomain.CurrentDomain.BaseDirectory + "/xml/dataTableAjax.xml");
            XmlNode node    = null;
            string  xmlPath = "/nodes/node[@id=\"DOCLST\"]";
            string  result  = "<div class=\"paginatorNotFound hint\" style=\"display: block; \">暂无记录</div>";

            node = doc.SelectSingleNode(xmlPath);
            if (node != null)
            {
                IEnumerable <DocumentExt> list = service.GetList(userID, pageIndex, pageSize, ref count);
                if (list.Count() > 0)
                {
                    result = KTList.GetDataList <DocumentExt>(node, pageIndex, pageSize, list);
                }
            }

            return(result);
        }
Exemple #2
0
        public HttpResponseMessage MessageList(bool isInPage = false)
        {
            int totalCount             = 0;
            int pageindex              = 0;
            int pagesize               = 10;
            IEnumerable <Message> list = messageService.GetList(this.UserID, 0, 10, ref totalCount);
            string returnstr           = "{\"ok\":true,\"events\":[]}";

            XmlDocument doc = new XmlDocument();

            doc.Load(AppDomain.CurrentDomain.BaseDirectory + "/xml/message.xml");
            XmlNode node    = null;
            string  xmlPath = "/nodes/node[@id=\"{0}\"]";

            if (isInPage)
            {
                node = doc.SelectSingleNode(string.Format(xmlPath, "messagelist_page"));
            }
            else
            {
                node = doc.SelectSingleNode(string.Format(xmlPath, "messagelist"));
            }

            returnstr = KTList.GetDataList <Message>(node, pageindex, pagesize, list);

            if (string.IsNullOrWhiteSpace(returnstr))
            {
                returnstr = "{\"ok\":true,\"events\":[]}";
            }

            return(new HttpResponseMessage()
            {
                Content = new StringContent(returnstr, Encoding.UTF8, "application/json"),
            });
        }
Exemple #3
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());
        }
Exemple #4
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());
        }
        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());
        }
        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());
        }
Exemple #7
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());
        }
Exemple #8
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"),
            });
        }
        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());
        }
        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());
        }
        public HttpResponseMessage DataTableAjax(string cm, string data_tbl_id, int?_fp_pg_n = 0, int?_fp_pg_s = 10, string name_surname = "")
        {
            string      returnstr = "{\"ok\":true,\"events\":[]}";
            XmlDocument doc       = new XmlDocument();

            doc.Load(AppDomain.CurrentDomain.BaseDirectory + "/xml/dataTableAjax.xml");
            XmlNode node    = null;
            string  xmlPath = "/nodes/node[@id=\"{0}\"]";

            string nodeid     = data_tbl_id;
            int    totalCount = 0;
            int    pageindex  = _fp_pg_n ?? 1;

            if (pageindex <= 0)
            {
                pageindex = 1;
            }
            int    pagesize = _fp_pg_s ?? 10;
            string filter   = name_surname;

            if (cm.ToLower() == "fn")
            {
                node = doc.SelectSingleNode(string.Format(xmlPath, nodeid));

                switch (nodeid)
                {
                case "ISSUEFILTER":
                    if (node != null)
                    {
                        IEnumerable <IssueExt> list = issueService.GetList(this.UserID, pageindex, pagesize, ref totalCount);
                        returnstr = KTList.GetDataList <IssueExt>(node, pageindex, pagesize, list, totalCount);
                    }
                    break;

                case "RESLST":
                    if (node != null)
                    {
                        IEnumerable <KTResource> list = resourceService.GetList(this.ResourceInfo.area ?? 0, filter, pageindex, pagesize, ref totalCount);
                        if (list != null && list.Count() > 0)
                        {
                            List <KTResourceExt> resourceExt = GetNewList(list);
                            returnstr = KTList.GetDataList <KTResourceExt>(node, pageindex, pagesize, resourceExt, totalCount);
                        }
                    }
                    break;

                case "TSKLST":
                    if (node != null)
                    {
                        IEnumerable <KTTask> list = taskService.GetList(this.UserID, pageindex, pagesize, ref totalCount);
                        returnstr = KTList.GetDataList <KTTask>(node, pageindex, pagesize, list);
                    }
                    break;

                case "GETTASKISS":
                    returnstr = "";
                    break;

                default:
                    returnstr = "{\"ok\":true,\"events\":[]}";
                    break;
                }
            }
            return(new HttpResponseMessage()
            {
                Content = new StringContent(returnstr, Encoding.UTF8, "text/html"),
            });
        }
        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());
        }