예제 #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 table-sort\" id=\"tablelist\">");
            sb.Append("<thead>");
            sb.Append("<tr class=\"text-c\">");
            sb.Append("<th width=\"10%\">序号</th>");
            sb.Append("<th width='45%'>费用科目</th>");
            sb.Append("<th width='45%'>对应违约金科目</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");

            int r = 1;

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

            return(sb.ToString());
        }
예제 #2
0
        private string updateaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessLateFee bc = new project.Business.Base.BusinessLateFee();
                bc.load(jp.getValue("id"));
                collection.Add(new JsonStringValue("SPNo", bc.Entity.SPNo));
                collection.Add(new JsonStringValue("SRVNo", bc.Entity.SRVNo));
                collection.Add(new JsonStringValue("LateFeeSRVNo", bc.Entity.LateFeeSRVNo));
                StringBuilder sb = new StringBuilder("SELECT SRVNo,SRVName FROM Mstr_Service WHERE SRVStatus=1 ");
                sb.AppendFormat("AND SRVSPNo='{0}' ", bc.Entity.SPNo);
                string fee     = JsonConvert.SerializeObject(obj.PopulateDataSet(sb.ToString() + "AND SRVTypeNo1!='FWLB-007'").Tables[0]);
                string lateFee = JsonConvert.SerializeObject(obj.PopulateDataSet(sb.ToString() + "AND SRVTypeNo1='FWLB-007'").Tables[0]);
                collection.Add(new JsonStringValue("FeeList", fee));
                collection.Add(new JsonStringValue("LateFeeList", lateFee));
            }
            catch
            { flag = "2"; }

            collection.Add(new JsonStringValue("type", "update"));
            collection.Add(new JsonStringValue("flag", flag));
            return(collection.ToString());
        }
예제 #3
0
        private string createList(string SPNo, string SRVNo, string SRVName, string LateSRVName, int page)
        {
            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=\"10%\">序号</th>");
            sb.Append("<th width='20%'>服务商</th>");
            sb.Append("<th width='30%'>费用科目</th>");
            sb.Append("<th width='30%'>对应违约金科目</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");

            int r = 1;

            sb.Append("<tbody>");
            Business.Base.BusinessLateFee bc = new project.Business.Base.BusinessLateFee();
            foreach (Entity.Base.EntityLateFee it in bc.GetListQuery(SPNo, SRVNo, SRVName, LateSRVName, page, pageSize))
            {
                sb.Append("<tr class=\"text-c\" id=\"" + it.RowPointer + "\">");
                sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>");
                sb.Append("<td style=\"text-align:left;\">" + it.SPShortName + "</td>");
                sb.Append("<td style=\"text-align:left;\">" + it.SRVName + "</td>");
                sb.Append("<td style=\"text-align:left;\">" + it.LateFeeSRVName + "</td>");
                sb.Append("</tr>");
                r++;
            }
            sb.Append("</tbody>");
            sb.Append("</table>");
            sb.Append(Paginat(bc.GetListCount(SPNo, SRVNo, SRVName, LateSRVName), pageSize, page, 7));
            return(sb.ToString());
        }
예제 #4
0
        private string submitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessLateFee bc = new project.Business.Base.BusinessLateFee();
                if (jp.getValue("tp") == "update")
                {
                    bc.load(jp.getValue("id"));
                    bc.Entity.SPNo         = jp.getValue("SPNo");
                    bc.Entity.SRVNo        = jp.getValue("SRVNo");
                    bc.Entity.LateFeeSRVNo = jp.getValue("LateFeeSRVNo");
                    bc.Entity.UpdateUser   = user.Entity.UserName;
                    bc.Entity.UpdateDate   = GetDate();
                    int r = bc.Save();

                    if (r <= 0)
                    {
                        flag = "2";
                    }
                }
                else
                {
                    Data      obj = new Data();
                    DataTable dt  = obj.PopulateDataSet("select cnt=COUNT(*) from Mstr_LateFee where SRVNo='" + jp.getValue("SRVNo") + "'").Tables[0];
                    if (int.Parse(dt.Rows[0]["cnt"].ToString()) > 0)
                    {
                        flag = "3";
                    }
                    else
                    {
                        bc.Entity.SPNo         = jp.getValue("SPNo");
                        bc.Entity.SRVNo        = jp.getValue("SRVNo");
                        bc.Entity.LateFeeSRVNo = jp.getValue("LateFeeSRVNo");
                        bc.Entity.CreateUser   = user.Entity.UserName;
                        bc.Entity.CreateDate   = GetDate();
                        bc.Entity.UpdateUser   = user.Entity.UserName;
                        bc.Entity.UpdateDate   = GetDate();
                        int r = bc.Save();
                        if (r <= 0)
                        {
                            flag = "2";
                        }
                    }
                }
            }
            catch { flag = "2"; }


            collection.Add(new JsonStringValue("type", "submit"));
            collection.Add(new JsonStringValue("flag", flag));
            return(collection.ToString());
        }
예제 #5
0
        private string updateaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

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

                collection.Add(new JsonStringValue("SRVNo", bc.Entity.SRVNo));
                collection.Add(new JsonStringValue("LateFeeSRVNo", bc.Entity.LateFeeSRVNo));
            }
            catch
            { flag = "2"; }

            collection.Add(new JsonStringValue("type", "update"));
            collection.Add(new JsonStringValue("flag", flag));
            return(collection.ToString());
        }
예제 #6
0
        private string deleteaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessLateFee bc = new project.Business.Base.BusinessLateFee();
                bc.load(jp.getValue("id"));
                int r = bc.delete();
                if (r <= 0)
                {
                    flag = "2";
                }
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "delete"));
            collection.Add(new JsonStringValue("flag", flag));
            return(collection.ToString());
        }