Esempio n. 1
0
        private string createList()
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder("");

            sb.Append("<table class=\"table table-border table-bordered table-hover table-bg\" id=\"tablelist\">");
            sb.Append("<thead>");
            sb.Append("<tr class=\"text-c\">");
            sb.Append("<th width=\"30\">序号</th>");
            sb.Append("<th width='100'>部门编号</th>");
            sb.Append("<th width='150'>部门名称</th>");
            sb.Append("<th width='150'>负责人</th>");
            sb.Append("<th width='300'>备注</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");

            int r = 1;

            sb.Append("<tbody>");
            Business.Sys.BusinessDept bc = new Business.Sys.BusinessDept();
            foreach (Entity.Sys.EntityDept it in bc.GetDeptListQuery(string.Empty, string.Empty, user.Entity.AccID, "null"))
            {
                sb.Append("<tr class=\"text-c\" id=\"" + it.DeptNo + "\">");
                sb.Append("<td align='center'>" + r.ToString() + "</td>");
                sb.Append("<td>" + it.DeptNo + "</td>");
                sb.Append("<td style='text-align:left'>" + it.DeptName + "</td>");
                sb.Append("<td>" + it.ManagerName + "</td>");
                sb.Append("<td>" + it.Remark + "</td>");
                sb.Append("</tr>");
                r++;

                foreach (Entity.Sys.EntityDept it1 in bc.GetDeptListQuery(string.Empty, string.Empty, user.Entity.AccID, it.DeptNo))
                {
                    sb.Append("<tr class=\"text-c\" id=\"" + it1.DeptNo + "\">");
                    sb.Append("<td align='center'>" + r.ToString() + "</td>");
                    sb.Append("<td>" + it1.DeptNo + "</td>");
                    sb.Append("<td style='text-align:left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + it1.DeptName + "</td>");
                    sb.Append("<td>" + it1.ManagerName + "</td>");
                    sb.Append("<td>" + it1.Remark + "</td>");
                    sb.Append("</tr>");
                    r++;

                    foreach (Entity.Sys.EntityDept it2 in bc.GetDeptListQuery(string.Empty, string.Empty, user.Entity.AccID, it1.DeptNo))
                    {
                        sb.Append("<tr class=\"text-c\" id=\"" + it2.DeptNo + "\">");
                        sb.Append("<td align='center'>" + r.ToString() + "</td>");
                        sb.Append("<td>" + it2.DeptNo + "</td>");
                        sb.Append("<td style='text-align:left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + it2.DeptName + "</td>");
                        sb.Append("<td>" + it2.ManagerName + "</td>");
                        sb.Append("<td>" + it2.Remark + "</td>");
                        sb.Append("</tr>");
                        r++;
                    }
                }
            }
            sb.Append("</tbody>");
            sb.Append("</table>");
            return(sb.ToString());
        }
Esempio n. 2
0
        private string allodeptaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag   = "1";
            string result = "";;

            try
            {
                Business.Sys.BusinessDept bc = new Business.Sys.BusinessDept();
                bc.load(jp.getValue("DeptNo"), user.Entity.AccID);
                collection.Add(new JsonStringValue("AlloUser", bc.Entity.Manager));
                collection.Add(new JsonStringValue("AlloUserName", bc.Entity.ManagerName));
            }
            catch
            { flag = "2"; }

            collection.Add(new JsonStringValue("type", "allodept"));
            collection.Add(new JsonStringValue("flag", flag));

            result = collection.ToString();

            return(result);
        }
Esempio n. 3
0
        private string getDeptUseraction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag   = "1";
            string result = "";;

            try
            {
                DataTable dt = obj.ExecuteDataSet("select a.*,b.DeptName from Base_AutoAllocation a left join (select * from Sys_Dept where AccID='" + user.Entity.AccID + "') b on a.DeptNo=b.DeptNo " +
                                                  "where a.AccID='" + user.Entity.AccID + "' and a.OrderType='" + jp.getValue("OrderType") + "' and  a.RegionNo='" + jp.getValue("RegionNo") + "'").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    collection.Add(new JsonStringValue("DeptNo", dt.Rows[0]["DeptNo"].ToString()));
                    collection.Add(new JsonStringValue("DeptName", dt.Rows[0]["DeptName"].ToString()));
                    collection.Add(new JsonStringValue("UserNo", dt.Rows[0]["UserNo"].ToString()));
                    collection.Add(new JsonStringValue("UserName", dt.Rows[0]["UserName"].ToString()));

                    Business.Sys.BusinessDept bc = new Business.Sys.BusinessDept();
                    bc.load(dt.Rows[0]["DeptNo"].ToString(), user.Entity.AccID);
                    collection.Add(new JsonStringValue("AlloUser", bc.Entity.Manager));
                    collection.Add(new JsonStringValue("AlloUserName", bc.Entity.ManagerName));
                }
                else
                {
                    flag = "3";
                }
            }
            catch
            { flag = "2"; }

            collection.Add(new JsonStringValue("type", "getDeptUser"));
            collection.Add(new JsonStringValue("flag", flag));

            result = collection.ToString();

            return(result);
        }