Exemple #1
0
        private string deleteaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessOrderType bc = new project.Business.Base.BusinessOrderType();
                bc.load(jp.getValue("id"), user.Entity.AccID);
                if (obj.ExecuteDataSet("select 1 from WO_WorkOrder where OrderType='" + bc.Entity.OrderTypeNo + "' and AccID='" + user.Entity.AccID + "'").Tables[0].Rows.Count > 0)
                {
                    flag = "3";
                }
                else
                {
                    int r = bc.delete();
                    if (r <= 0)
                    {
                        flag = "2";
                    }
                }
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "delete"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList()));

            return(collection.ToString());
        }
Exemple #2
0
        private string createList(string OrderTypeName)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder("");

            sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">");
            sb.Append("<thead>");
            sb.Append("<tr class=\"text-c\">");
            sb.Append("<th width=\"5%\">序号</th>");
            sb.Append("<th width='35%'>订单类型编号</th>");
            sb.Append("<th width='60%'>订单类型名称</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");

            int r = 1;

            sb.Append("<tbody>");
            Business.Base.BusinessOrderType bc = new project.Business.Base.BusinessOrderType();
            foreach (Entity.Base.EntityOrderType it in bc.GetListQuery(string.Empty, OrderTypeName))
            {
                sb.Append("<tr class=\"text-c\" id=\"" + it.OrderTypeNo + "\">");
                sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>");
                sb.Append("<td style=\"text-align:left;\">" + it.OrderTypeNo + "</td>");
                sb.Append("<td style=\"text-align:left;\">" + it.OrderTypeName + "</td>");
                sb.Append("</tr>");
                r++;
            }
            sb.Append("</tbody>");
            sb.Append("</table>");

            return(sb.ToString());
        }
Exemple #3
0
        private string updateaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag   = "1";
            string result = "";;

            try
            {
                Business.Base.BusinessOrderType bc = new project.Business.Base.BusinessOrderType();
                bc.load(jp.getValue("id"), user.Entity.AccID);

                collection.Add(new JsonStringValue("OrderTypeNo", bc.Entity.OrderTypeNo));
                collection.Add(new JsonStringValue("OrderTypeName", bc.Entity.OrderTypeName));
                collection.Add(new JsonStringValue("FlowNo", bc.Entity.FlowNo));
            }
            catch
            { flag = "2"; }

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

            result = collection.ToString();

            return(result);
        }
Exemple #4
0
        private string deleteaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessOrderType bc = new project.Business.Base.BusinessOrderType();
                bc.load(jp.getValue("id"));

                //if (obj.PopulateDataSet("select 1 from Mstr_Billboard where OrderType='" + bc.Entity.OrderTypeNo + "'").Tables[0].Rows.Count > 0)
                //{
                //    flag = "3";
                //}
                //else
                //{
                int r = bc.delete();
                if (r <= 0)
                {
                    flag = "2";
                }
                //}
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "delete"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("OrderTypeNameS"))));

            return(collection.ToString());
        }
Exemple #5
0
        private string submitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessOrderType bc = new project.Business.Base.BusinessOrderType();
                if (jp.getValue("tp") == "update")
                {
                    bc.load(jp.getValue("id"), user.Entity.AccID);
                    bc.Entity.OrderTypeName = jp.getValue("OrderTypeName");
                    bc.Entity.FlowNo        = jp.getValue("FlowNo");
                    int r = bc.Save("update");
                    if (r <= 0)
                    {
                        flag = "2";
                    }
                }
                else
                {
                    Data      obj = new Data();
                    DataTable dt  = obj.ExecuteDataSet("select 1 from Base_Order_Type where OrderTypeNo=N'" + jp.getValue("OrderTypeNo") + "' and AccID='" + user.Entity.AccID + "'").Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        flag = "3";
                    }
                    else
                    {
                        bc.Entity.OrderTypeNo   = jp.getValue("OrderTypeNo");
                        bc.Entity.OrderTypeName = jp.getValue("OrderTypeName");
                        bc.Entity.FlowNo        = jp.getValue("FlowNo");
                        bc.Entity.AccID         = user.Entity.AccID;
                        int r = bc.Save("insert");
                        if (r <= 0)
                        {
                            flag = "2";
                        }
                    }
                }
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "submit"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList()));

            return(collection.ToString());
        }
Exemple #6
0
        private string submitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessOrderType bc = new project.Business.Base.BusinessOrderType();
                if (jp.getValue("tp") == "update")
                {
                    bc.load(jp.getValue("id"));
                    bc.Entity.OrderTypeName = jp.getValue("OrderTypeName");
                    int r = bc.Save("update");

                    if (r <= 0)
                    {
                        flag = "2";
                    }
                }
                else
                {
                    Data      obj = new Data();
                    DataTable dt  = obj.PopulateDataSet("select cnt=COUNT(*) from Mstr_OrderType where OrderTypeNo='" + jp.getValue("OrderTypeNo") + "'").Tables[0];
                    if (int.Parse(dt.Rows[0]["cnt"].ToString()) > 0)
                    {
                        flag = "3";
                    }
                    else
                    {
                        bc.Entity.OrderTypeNo   = jp.getValue("OrderTypeNo");
                        bc.Entity.OrderTypeName = jp.getValue("OrderTypeName");

                        int r = bc.Save("insert");
                        if (r <= 0)
                        {
                            flag = "2";
                        }
                    }
                }
            }
            catch { flag = "2"; }


            collection.Add(new JsonStringValue("type", "submit"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("OrderTypeNameS"))));

            return(collection.ToString());
        }
Exemple #7
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            try
            {
                HttpCookie hc = getCookie("1");
                if (hc != null)
                {
                    string str = hc.Value.Replace("%3D", "=");
                    userid = Encrypt.DecryptDES(str, "1");
                    user.load(userid);
                    CheckRight(user.Entity, "order/WorkOrderWarning.aspx");

                    if (!Page.IsCallback)
                    {
                        orderType  = "<select class=\"input-text required size-S\" id=\"OrderType\" style=\"width:120px\" data-valid=\"\" data-error=\"\">";
                        orderType += "<option value=\"\" selected>请选择工单类型</option>";
                        Business.Base.BusinessOrderType type = new project.Business.Base.BusinessOrderType();
                        foreach (Entity.Base.EntityOrderType it in type.GetOrderTypeListQuery(string.Empty, string.Empty, string.Empty, user.Entity.AccID))
                        {
                            orderType += "<option value='" + it.OrderTypeNo + "'>" + it.OrderTypeName + "</option>";
                        }
                        orderType += "</select>";

                        list = createList(string.Empty, string.Empty, string.Empty, string.Empty, GetDate().ToString("yyyy-MM-dd"), GetDate().ToString("yyyy-MM-dd"));
                    }
                }
                else
                {
                    GotoErrorPage();
                }
            }
            catch
            {
                GotoErrorPage();
            }
        }
Exemple #8
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            try
            {
                HttpCookie hc = getCookie("1");
                if (hc != null)
                {
                    string str = hc.Value.Replace("%3D", "=");
                    userid = Encrypt.DecryptDES(str, "1");
                    user.load(userid);

                    if (!Page.IsCallback)
                    {
                        CheckRight(user.Entity, "Order/WorkOrder.aspx");

                        list = createList(string.Empty, string.Empty, GetDate().AddDays(-GetDate().Day + 1).ToString("yyyy-MM-dd"), GetDate().ToString("yyyy-MM-dd"),
                                          string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, "", "", 1);

                        orderType  = "<select class=\"input-text required\" id=\"OrderType\" data-valid=\"isNonEmpty\" data-error=\"请选择工单类型\">";
                        orderType += "<option value=\"\" selected>请选择工单类型</option>";

                        orderTypeS  = "<select class=\"input-text required\" id=\"OrderTypeS\" style=\"width:100px\">";
                        orderTypeS += "<option value=\"\" selected>全部</option>";
                        Business.Base.BusinessOrderType type = new project.Business.Base.BusinessOrderType();
                        foreach (Entity.Base.EntityOrderType it in type.GetOrderTypeListQuery(string.Empty, string.Empty, string.Empty, user.Entity.AccID))
                        {
                            orderType  += "<option value='" + it.OrderTypeNo + "'>" + it.OrderTypeName + "</option>";
                            orderTypeS += "<option value='" + it.OrderTypeNo + "'>" + it.OrderTypeName + "</option>";
                        }
                        orderType  += "</select>";
                        orderTypeS += "</select>";

                        alloDept  = "<select class=\"input-text required size-S\" id=\"AlloDeptS\" style=\"width:100px\" data-valid=\"isNonEmpty\" data-error=\"请选择\">";
                        alloDept += "<option value=\"\" selected>请选择</option>";
                        Business.Sys.BusinessDept allodt = new project.Business.Sys.BusinessDept();
                        foreach (Entity.Sys.EntityDept it in allodt.GetDeptListQuery(string.Empty, string.Empty, user.Entity.AccID, string.Empty))
                        {
                            alloDept += "<option value='" + it.DeptNo + "'>" + it.DeptName + "</option>";
                        }
                        alloDept += "</select>";

                        alloUser  = "******"input-text required size-S\" id=\"AlloUserS\" style=\"width:100px\" data-valid=\"isNonEmpty\" data-error=\"请选择\">";
                        alloUser += "<option value=\"\" selected>请选择</option>";
                        Business.Sys.BusinessUserInfo allous = new project.Business.Sys.BusinessUserInfo();
                        foreach (Entity.Sys.EntityUserInfo it in allous.GetUserInfoListQuery(string.Empty, user.Entity.AccID, string.Empty, string.Empty))
                        {
                            alloUser += "<option value='" + it.UserNo + "'>" + it.UserName + "</option>";
                        }
                        alloUser += "</select>";

                        region  = "<select class=\"input-text required size-S\" id=\"RegionS\" style=\"width:80px\" data-valid=\"isNonEmpty\" data-error=\"请选择\">";
                        region += "<option value=\"\" selected>请选择</option>";
                        Business.Base.BusinessRegion reg = new project.Business.Base.BusinessRegion();
                        foreach (Entity.Base.EntityRegion it in reg.GetRegionListQuery(string.Empty, string.Empty, user.Entity.AccID, string.Empty))
                        {
                            region += "<option value='" + it.RegionNo + "'>" + it.RegionName + "</option>";
                        }
                        region += "</select>";

                        status  = "<select class=\"input-text required size-S\" id=\"StatusS\" style=\"width:80px\" data-valid=\"\" data-error=\"\">";
                        status += "<option value=\"\" selected>请选择</option>";
                        Business.Base.BusinessStatus st = new project.Business.Base.BusinessStatus();
                        foreach (Entity.Base.EntityStatus it in st.GetStatusListQuery(string.Empty, string.Empty, user.Entity.AccID))
                        {
                            status += "<option value='" + it.StatusNo + "'>" + it.StatusName + "</option>";
                        }
                        status += "</select>";
                    }
                }
                else
                {
                    GotoErrorPage();
                }
            }
            catch
            {
                GotoErrorPage();
            }
        }
Exemple #9
0
        private string createList(string Month, string ARDate, string EndDate, string OrderType)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder("");
            sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">");
            sb.Append("<thead>");
            sb.Append("<tr class=\"text-c\">");
            sb.Append("<td width='5%'><input type=\"checkbox\" class=\"input-text size-MINI\" id=\"checkall\" /></td>");
            sb.Append("<th width='5%'>序号</th>");
            sb.Append("<th width='11%'>订单编号</th>");
            sb.Append("<th width='11%'>合同编号</th>");
            sb.Append("<th width='17%'>费用项目</th>");
            sb.Append("<th width='17%'>资源编号</th>");
            sb.Append("<th width='12%'>未收款金额</th>");
            sb.Append("<th width='10%'>天数</th>");
            sb.Append("<th width='12%'>金额</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");


            string OrderTypes = "";

            if (user.Entity.UserType.ToUpper() == "ADMIN")
            {
                Business.Base.BusinessOrderType bc1 = new project.Business.Base.BusinessOrderType();
                foreach (Entity.Base.EntityOrderType it in bc1.GetListQuery(string.Empty, string.Empty))
                {
                    OrderTypes += it.OrderTypeNo + ",";
                }
            }
            else
            {
                string sqlstr1 = "select a.OrderType,b.OrderTypeName from Sys_UserOrderTypeRight a left join Mstr_OrderType b on a.OrderType=b.OrderTypeNo " +
                                 "where a.UserType='" + user.Entity.UserType + "'";
                DataTable dt1 = obj.PopulateDataSet(sqlstr1).Tables[0];
                foreach (DataRow dr in dt1.Rows)
                {
                    OrderTypes += dr["OrderType"].ToString() + ",";
                }
            }
            if (OrderTypes == "")
            {
                OrderTypes = "''";
            }
            if (OrderType == "")
            {
                OrderType = "%";
            }

            int r = 1;

            sb.Append("<tbody id=\"tbody\">");
            DataTable dt = GetUnLateFeeOrder_Proc(Month, ARDate, EndDate, OrderType, OrderTypes);

            foreach (DataRow dr in dt.Rows)
            {
                sb.Append("<tr class=\"text-c\">");
                sb.Append("<td><input type=\"checkbox\" class=\"input-text size-MINI\" value=\"" + dr["RowPointer"].ToString() + "\" name=\"chk\" /></td>");
                sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>");
                sb.Append("<td>" + dr["OrderNo"].ToString() + "</td>");
                sb.Append("<td>" + dr["ODContractNo"].ToString() + "</td>");
                sb.Append("<td>" + dr["SRVName"].ToString() + "</td>");
                sb.Append("<td>" + dr["ResourceNo"].ToString() + "</td>");
                sb.Append("<td>" + ParseDecimalForString(dr["UnPaidAmount"].ToString()).ToString("0.##") + "</td>");
                sb.Append("<td>" + dr["LateDays"].ToString() + "</td>");
                sb.Append("<td>" + ParseDecimalForString(dr["LateAmount"].ToString()).ToString("0.##") + "</td>");
                sb.Append("</tr>");
                r++;
            }
            sb.Append("</tbody>");
            sb.Append("</table>");

            return(sb.ToString());
        }
        protected override void Page_Load(object sender, EventArgs e)
        {
            try
            {
                HttpCookie hc = getCookie("1");
                if (hc != null)
                {
                    string str = hc.Value.Replace("%3D", "=");
                    userid = Encrypt.DecryptDES(str, "1");
                    user.load(userid);
                    CheckRight(user.Entity, "pm/Base/AutoAllocation.aspx");

                    if (!Page.IsCallback)
                    {
                        list = createList(string.Empty, string.Empty);

                        orderType   = "<select class=\"input-text required size-S\" id=\"OrderType\" data-valid=\"isNonEmpty\" data-error=\"请选择\">";
                        orderTypeS  = "<select class=\"input-text size-S\" id=\"OrderTypeS\" style=\"width:120px;\">";
                        orderType  += "<option value=\"\" selected></option>";
                        orderTypeS += "<option value=\"\" selected>全部</option>";
                        Business.Base.BusinessOrderType type = new project.Business.Base.BusinessOrderType();
                        foreach (Entity.Base.EntityOrderType it in type.GetOrderTypeListQuery(string.Empty, string.Empty, string.Empty, user.Entity.AccID))
                        {
                            orderType  += "<option value='" + it.OrderTypeNo + "'>" + it.OrderTypeName + "</option>";
                            orderTypeS += "<option value='" + it.OrderTypeNo + "'>" + it.OrderTypeName + "</option>";
                        }
                        orderType  += "</select>";
                        orderTypeS += "</select>";

                        region   = "<select class=\"input-text required size-S\" id=\"RegionNo\" data-valid=\"isNonEmpty\" data-error=\"请选择\">";
                        regionS  = "<select class=\"input-text size-S\" id=\"RegionNoS\" style=\"width:120px;\">";
                        region  += "<option value=\"\" selected></option>";
                        regionS += "<option value=\"\" selected>全部</option>";
                        Business.Base.BusinessRegion reg = new project.Business.Base.BusinessRegion();
                        foreach (Entity.Base.EntityRegion it in reg.GetRegionListQuery(string.Empty, string.Empty, user.Entity.AccID, string.Empty))
                        {
                            region  += "<option value='" + it.RegionNo + "'>" + it.RegionName + "</option>";
                            regionS += "<option value='" + it.RegionNo + "'>" + it.RegionName + "</option>";
                        }
                        region  += "</select>";
                        regionS += "</select>";

                        dept  = "<select class=\"input-text required size-S\" id=\"DeptNo\" data-valid=\"isNonEmpty\" data-error=\"请选择\">";
                        dept += "<option value=\"\" selected></option>";
                        Business.Sys.BusinessDept allodt = new project.Business.Sys.BusinessDept();
                        foreach (Entity.Sys.EntityDept it in allodt.GetDeptListQuery(string.Empty, string.Empty, user.Entity.AccID, string.Empty))
                        {
                            dept += "<option value='" + it.DeptNo + "'>" + it.DeptName + "</option>";
                        }
                        dept += "</select>";
                    }
                }
                else
                {
                    GotoErrorPage();
                }
            }
            catch
            {
                GotoErrorPage();
            }
        }