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

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

                if (obj.PopulateDataSet("select 1 from Op_ContractBBRentalDetail where BBNo='" + bc.Entity.BBNo + "'").Tables[0].Rows.Count > 0)
                {
                    flag = "3";
                }
                else
                {
                    if (bc.Entity.BBStatus == "use")
                    {
                        flag = "4";
                    }
                    else
                    {
                        int r = bc.delete();
                        if (r <= 0)
                        {
                            flag = "2";
                        }
                        else
                        {
                            #region  步到资源系统

                            string syncResult = string.Empty;
                            try
                            {
                                ResourceService.ResourceService srv = new ResourceService.ResourceService();
                                srv.Url    = ConfigurationManager.AppSettings["ResourceServiceUrl"].ToString();
                                syncResult = srv.DeleteResource(bc.Entity.BBNo);
                            }
                            catch (Exception ex)
                            {
                                syncResult = ex.ToString();
                            }
                            collection.Add(new JsonStringValue("sync", syncResult));

                            #endregion
                        }
                    }
                }
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "delete"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("BBNoS"), jp.getValue("BBNameS"), jp.getValue("BBAddrS"), jp.getValue("BBStatusS"),
                                                                     jp.getValue("BBTypeS"), jp.getValue("BBSPNoS"), ParseIntForString(jp.getValue("page")))));
            return(collection.ToString());
        }
Beispiel #2
0
        private string validaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessBillboard bc = new project.Business.Base.BusinessBillboard();
                bc.load(jp.getValue("id"));
                bc.Entity.BBISEnable = !bc.Entity.BBISEnable;

                int r = bc.valid();
                if (r <= 0)
                {
                    flag = "2";
                }
                else
                {
                    #region  步到资源系统

                    string syncResult = string.Empty;
                    try
                    {
                        ResourceService.ResourceService srv = new ResourceService.ResourceService();
                        srv.Url    = ConfigurationManager.AppSettings["ResourceServiceUrl"].ToString();
                        syncResult = srv.AddOrUpdateBillboard(JsonConvert.SerializeObject(bc.Entity));
                    }
                    catch (Exception ex)
                    {
                        syncResult = ex.ToString();
                    }
                    collection.Add(new JsonStringValue("sync", syncResult));

                    #endregion
                }
                if (bc.Entity.BBISEnable)
                {
                    collection.Add(new JsonStringValue("stat", "<span class=\"label radius\">禁用</span>"));
                }
                else
                {
                    collection.Add(new JsonStringValue("stat", "<span class=\"label label-success radius\">正常</span>"));
                }

                collection.Add(new JsonStringValue("id", jp.getValue("id")));
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "valid"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("BBNoS"), jp.getValue("BBNameS"), jp.getValue("BBAddrS"), jp.getValue("BBStatusS"),
                                                                     jp.getValue("BBTypeS"), jp.getValue("BBSPNoS"), ParseIntForString(jp.getValue("page"))))); return(collection.ToString());
        }
Beispiel #3
0
        private string createList(string BBNo, string BBName, string BBAddr, string BBStatus, string BBType, string BBSPNo, 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=\"4%\">序号</th>");
            sb.Append("<th width='10%'>广告位编号</th>");
            sb.Append("<th width='14%'>广告位名称</th>");
            sb.Append("<th width='10%'>所在园区</th>");
            sb.Append("<th width='20%'>所在位置</th>");
            sb.Append("<th width='9%'>广告位类别</th>");
            sb.Append("<th width='10%'>服务商</th>");
            sb.Append("<th width='9%'>规格</th>");
            sb.Append("<th width='7%'>状态</th>");
            sb.Append("<th width='7%'>是否禁用</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");

            int r = 1;

            sb.Append("<tbody>");
            Business.Base.BusinessBillboard bc = new project.Business.Base.BusinessBillboard();
            foreach (Entity.Base.EntityBillboard it in bc.GetListQuery(BBNo, BBName, BBAddr, BBStatus, BBType, BBSPNo, page, pageSize))
            {
                sb.Append("<tr class=\"text-c\" id=\"" + it.BBNo + "\">");
                sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>");
                sb.Append("<td>" + it.BBNo + "</td>");
                sb.Append("<td>" + it.BBName + "</td>");
                sb.Append("<td>" + it.BBSPName + "</td>");
                sb.Append("<td>" + it.BBAddr + "</td>");
                sb.Append("<td>" + it.BBTypeName + "</td>");
                sb.Append("<td>" + it.BBSPName + "</td>");
                sb.Append("<td>" + it.BBSize + "</td>");
                sb.Append("<td class=\"td-status\"><span class=\"label " + (it.BBStatus == "use" ? "label-success" : "") + " radius\">" + it.BBStatusName + "</span></td>");
                sb.Append("<td class=\"td-status\"><span class=\"label " + (it.BBISEnable == false ? "label-success" : "") + " radius\">" + (it.BBISEnable == false ? "正常" : "已禁用") + "</span></td>");
                sb.Append("</tr>");
                r++;
            }
            sb.Append("</tbody>");
            sb.Append("</table>");

            sb.Append(Paginat(bc.GetListCount(BBNo, BBName, BBAddr, BBStatus, BBType, BBSPNo), pageSize, page, 7));

            return(sb.ToString());
        }
Beispiel #4
0
        private string deleteaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

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

                if (obj.PopulateDataSet("select 1 from Op_ContractBBRentalDetail where BBNo='" + bc.Entity.BBNo + "'").Tables[0].Rows.Count > 0)
                {
                    flag = "3";
                }
                else
                {
                    if (bc.Entity.BBStatus == "use")
                    {
                        flag = "4";
                    }
                    else
                    {
                        int r = bc.delete();
                        if (r <= 0)
                        {
                            flag = "2";
                        }
                        else
                        {
                            collection.Add(new JsonStringValue("ZYSync", bc.SyncResource("del")));
                        }
                    }
                }
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "delete"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("BBNoS"), jp.getValue("BBNameS"), jp.getValue("BBAddrS"), jp.getValue("BBStatusS"),
                                                                     jp.getValue("BBTypeS"), jp.getValue("BBSPNoS"), ParseIntForString(jp.getValue("page")))));
            return(collection.ToString());
        }
Beispiel #5
0
        private string updateaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

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

                collection.Add(new JsonStringValue("BBNo", bc.Entity.BBNo));
                collection.Add(new JsonStringValue("BBName", bc.Entity.BBName));
                collection.Add(new JsonStringValue("BBSPNo", bc.Entity.BBSPNo));
                collection.Add(new JsonStringValue("BBLOCNo", bc.Entity.BBLOCNo));
                collection.Add(new JsonStringValue("BBAddr", bc.Entity.BBAddr));
                collection.Add(new JsonStringValue("BBSize", bc.Entity.BBSize));
                collection.Add(new JsonStringValue("BBType", bc.Entity.BBType));
                collection.Add(new JsonStringValue("BBINPriceDay", bc.Entity.BBINPriceDay.ToString("0.####")));
                collection.Add(new JsonStringValue("BBOUTPriceDay", bc.Entity.BBOUTPriceDay.ToString("0.####")));
                collection.Add(new JsonStringValue("BBINPriceMonth", bc.Entity.BBINPriceMonth.ToString("0.####")));
                collection.Add(new JsonStringValue("BBOUTPriceMonth", bc.Entity.BBOUTPriceMonth.ToString("0.####")));
                collection.Add(new JsonStringValue("BBINPriceQuarter", bc.Entity.BBINPriceQuarter.ToString("0.####")));
                collection.Add(new JsonStringValue("BBOUTPriceQuarter", bc.Entity.BBOUTPriceQuarter.ToString("0.####")));
                collection.Add(new JsonStringValue("BBINPriceYear", bc.Entity.BBINPriceYear.ToString("0.####")));
                collection.Add(new JsonStringValue("BBOUTPriceYear", bc.Entity.BBOUTPriceYear.ToString("0.####")));
                collection.Add(new JsonStringValue("BBDeposit", bc.Entity.BBDeposit.ToString("0.####")));
                collection.Add(new JsonStringValue("BBImage", bc.Entity.BBImage));
                collection.Add(new JsonStringValue("IsStatistics", (bc.Entity.IsStatistics ? "true" : "false")));
            }
            catch
            { flag = "2"; }

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

            try
            {
                Business.Base.BusinessBillboard bc = new project.Business.Base.BusinessBillboard();
                if (jp.getValue("tp") == "update")
                {
                    bc.load(jp.getValue("id"));
                    bc.Entity.BBName            = jp.getValue("BBName");
                    bc.Entity.BBSPNo            = jp.getValue("BBSPNo");
                    bc.Entity.BBLOCNo           = jp.getValue("BBLOCNo");
                    bc.Entity.BBAddr            = jp.getValue("BBAddr");
                    bc.Entity.BBSize            = jp.getValue("BBSize");
                    bc.Entity.BBType            = jp.getValue("BBType");
                    bc.Entity.BBINPriceDay      = ParseDecimalForString(jp.getValue("BBINPriceDay"));
                    bc.Entity.BBOUTPriceDay     = ParseDecimalForString(jp.getValue("BBOUTPriceDay"));
                    bc.Entity.BBINPriceMonth    = ParseDecimalForString(jp.getValue("BBINPriceMonth"));
                    bc.Entity.BBOUTPriceMonth   = ParseDecimalForString(jp.getValue("BBOUTPriceMonth"));
                    bc.Entity.BBINPriceQuarter  = ParseDecimalForString(jp.getValue("BBINPriceQuarter"));
                    bc.Entity.BBOUTPriceQuarter = ParseDecimalForString(jp.getValue("BBOUTPriceQuarter"));
                    bc.Entity.BBINPriceYear     = ParseDecimalForString(jp.getValue("BBINPriceYear"));
                    bc.Entity.BBOUTPriceYear    = ParseDecimalForString(jp.getValue("BBOUTPriceYear"));
                    bc.Entity.BBDeposit         = ParseDecimalForString(jp.getValue("BBDeposit"));
                    bc.Entity.BBImage           = jp.getValue("BBImage");
                    bc.Entity.IsStatistics      = bool.Parse(jp.getValue("IsStatistics"));

                    int r = bc.Save("update");

                    if (r <= 0)
                    {
                        flag = "2";
                    }
                    else
                    {
                        collection.Add(new JsonStringValue("ZYSync", bc.SyncResource("au")));
                    }
                }
                else
                {
                    Data      obj = new Data();
                    DataTable dt  = obj.PopulateDataSet("select cnt=COUNT(*) from Mstr_Billboard where BBNo='" + jp.getValue("BBNo") + "'").Tables[0];
                    if (int.Parse(dt.Rows[0]["cnt"].ToString()) > 0)
                    {
                        flag = "3";
                    }
                    else
                    {
                        bc.Entity.BBNo              = jp.getValue("BBNo");
                        bc.Entity.BBName            = jp.getValue("BBName");
                        bc.Entity.BBSPNo            = jp.getValue("BBSPNo");
                        bc.Entity.BBLOCNo           = jp.getValue("BBLOCNo");
                        bc.Entity.BBAddr            = jp.getValue("BBAddr");
                        bc.Entity.BBSize            = jp.getValue("BBSize");
                        bc.Entity.BBType            = jp.getValue("BBType");
                        bc.Entity.BBINPriceDay      = ParseDecimalForString(jp.getValue("BBINPriceDay"));
                        bc.Entity.BBOUTPriceDay     = ParseDecimalForString(jp.getValue("BBOUTPriceDay"));
                        bc.Entity.BBINPriceMonth    = ParseDecimalForString(jp.getValue("BBINPriceMonth"));
                        bc.Entity.BBOUTPriceMonth   = ParseDecimalForString(jp.getValue("BBOUTPriceMonth"));
                        bc.Entity.BBINPriceQuarter  = ParseDecimalForString(jp.getValue("BBINPriceQuarter"));
                        bc.Entity.BBOUTPriceQuarter = ParseDecimalForString(jp.getValue("BBOUTPriceQuarter"));
                        bc.Entity.BBINPriceYear     = ParseDecimalForString(jp.getValue("BBINPriceYear"));
                        bc.Entity.BBOUTPriceYear    = ParseDecimalForString(jp.getValue("BBOUTPriceYear"));
                        bc.Entity.BBDeposit         = ParseDecimalForString(jp.getValue("BBDeposit"));
                        bc.Entity.BBImage           = jp.getValue("BBImage");
                        bc.Entity.IsStatistics      = bool.Parse(jp.getValue("IsStatistics"));

                        bc.Entity.BBCreator    = user.Entity.UserName;
                        bc.Entity.BBCreateDate = GetDate();

                        int r = bc.Save("insert");
                        if (r <= 0)
                        {
                            flag = "2";
                        }
                        else
                        {
                            collection.Add(new JsonStringValue("ZYSync", bc.SyncResource("au")));
                        }
                    }
                }
            }
            catch { flag = "2"; }


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

            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("BBNoS"), jp.getValue("BBNameS"), jp.getValue("BBAddrS"), jp.getValue("BBStatusS"),
                                                                     jp.getValue("BBTypeS"), jp.getValue("BBSPNoS"), ParseIntForString(jp.getValue("page"))))); return(collection.ToString());
        }
Beispiel #7
0
        private string createList(string Name, int page)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder("");
            try
            {
                if (Request.QueryString["type"] == "user")
                {
                    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='35%'>用户编号</th>");
                    sb.Append("<th width='65%'>用户名称</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");

                    sb.Append("<tbody>");
                    Business.Sys.BusinessUserInfo pt = new project.Business.Sys.BusinessUserInfo();
                    foreach (Entity.Sys.EntityUserInfo it in pt.GetUserInfoListQuery(string.Empty, Name, page, 15))
                    {
                        sb.Append("<tr class=\"text-c\" id='" + it.UserNo + "' onclick='submit(\"" + it.UserNo + "\")'>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.UserNo + "<input type='hidden' id='it" + it.UserNo + "' value='" + it.UserName + "' /></td>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.UserName + "</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("</tbody>");
                    sb.Append("</table>");
                    sb.Append(Paginat(pt.GetUserInfoListCount(string.Empty, Name), 15, page, 5));
                }
                else if (Request.QueryString["type"] == "SRVType")
                {
                    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='35%'>服务类型编号</th>");
                    sb.Append("<th width='65%'>服务类型名称</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");

                    sb.Append("<tbody>");
                    Business.Base.BusinessServiceType pt = new project.Business.Base.BusinessServiceType();
                    foreach (Entity.Base.EntityServiceType it in pt.GetListQuery(string.Empty, Name, "null", string.Empty, true, page, 15))
                    {
                        sb.Append("<tr class=\"text-c\" id='" + it.SRVTypeNo + "' onclick='submit(\"" + it.SRVTypeNo + "\")'>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.SRVTypeNo + "<input type='hidden' id='it" + it.SRVTypeNo + "' value='" + it.SRVTypeName + "' /></td>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.SRVTypeName + "</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("</tbody>");
                    sb.Append("</table>");
                    sb.Append(Paginat(pt.GetListCount(string.Empty, Name, "null", string.Empty, true), 15, page, 5));
                }
                else if (Request.QueryString["type"] == "LOC")
                {
                    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='35%'>编号</th>");
                    sb.Append("<th width='65%'>名称</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");

                    sb.Append("<tbody>");
                    Business.Base.BusinessLocation pt = new project.Business.Base.BusinessLocation();
                    foreach (Entity.Base.EntityLocation it in pt.GetListQuery(string.Empty, Name, string.Empty, page, 15))
                    {
                        string spacestr = "";
                        int    row      = 1;
                        while (row <= it.LOCLevel)
                        {
                            spacestr += "&nbsp;&nbsp;&nbsp;&nbsp;";
                            row++;
                        }

                        sb.Append("<tr class=\"text-c\" id='" + it.LOCNo + "' onclick='submit(\"" + it.LOCNo + "\")'>");
                        sb.Append("<td style=\"white-space: nowrap;text-align:left;\">" + it.LOCNo + "<input type='hidden' id='it" + it.LOCNo + "' value='" + it.LOCName + "' /></td>");
                        sb.Append("<td style=\"white-space: nowrap;text-align:left;\">" + spacestr + it.LOCName + "</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("</tbody>");
                    sb.Append("</table>");
                    sb.Append(Paginat(pt.GetListCount(string.Empty, Name, string.Empty), 15, page, 5));
                }
                else if (Request.QueryString["type"] == "Cust")
                {
                    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='35%'>客户编号</th>");
                    sb.Append("<th width='65%'>客户名称</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");

                    sb.Append("<tbody>");
                    Business.Base.BusinessCustomer pt = new project.Business.Base.BusinessCustomer();
                    foreach (Entity.Base.EntityCustomer it in pt.GetListQuery(string.Empty, Name, string.Empty, string.Empty, page, 15))
                    {
                        sb.Append("<tr class=\"text-c\" id='" + it.CustNo + "' onclick='submit(\"" + it.CustNo + "\")'>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.CustNo + "<input type='hidden' id='it" + it.CustNo + "' value='" + it.CustName + "' /></td>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.CustName + "</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("</tbody>");
                    sb.Append("</table>");
                    sb.Append(Paginat(pt.GetListCount(string.Empty, Name, string.Empty, string.Empty), 15, page, 5));
                }
                else if (Request.QueryString["type"] == "Billboard")
                {
                    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='20%'>广告位编号</th>");
                    sb.Append("<th width='25%'>广告位名称</th>");
                    sb.Append("<th width='40%'>位置</th>");
                    sb.Append("<th width='15%'>广告位类型</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");

                    sb.Append("<tbody>");
                    Business.Base.BusinessBillboard pt = new project.Business.Base.BusinessBillboard();
                    foreach (Entity.Base.EntityBillboard it in pt.GetListQuery(string.Empty, Name, string.Empty, string.Empty, string.Empty, string.Empty, page, 15))
                    {
                        sb.Append("<tr class=\"text-c\" id='" + it.BBNo + "' onclick='submit(\"" + it.BBNo + "\")'>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.BBNo + "<input type='hidden' id='it" + it.BBNo + "' value='" + it.BBName + "' /></td>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.BBName + "</td>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.BBAddr + "</td>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.BBTypeName + "</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("</tbody>");
                    sb.Append("</table>");
                    sb.Append(Paginat(pt.GetListCount(string.Empty, Name, string.Empty, string.Empty, string.Empty, string.Empty), 15, page, 5));
                }
            }
            catch { }
            return(sb.ToString());
        }
Beispiel #8
0
        private string submitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessBillboard bc = new project.Business.Base.BusinessBillboard();
                if (jp.getValue("tp") == "update")
                {
                    bc.load(jp.getValue("id"));
                    bc.Entity.BBName            = jp.getValue("BBName");
                    bc.Entity.BBSPNo            = jp.getValue("BBSPNo");
                    bc.Entity.BBLOCNo           = jp.getValue("BBLOCNo");
                    bc.Entity.BBAddr            = jp.getValue("BBAddr");
                    bc.Entity.BBSize            = jp.getValue("BBSize");
                    bc.Entity.BBType            = jp.getValue("BBType");
                    bc.Entity.BBINPriceDay      = ParseDecimalForString(jp.getValue("BBINPriceDay"));
                    bc.Entity.BBOUTPriceDay     = ParseDecimalForString(jp.getValue("BBOUTPriceDay"));
                    bc.Entity.BBINPriceMonth    = ParseDecimalForString(jp.getValue("BBINPriceMonth"));
                    bc.Entity.BBOUTPriceMonth   = ParseDecimalForString(jp.getValue("BBOUTPriceMonth"));
                    bc.Entity.BBINPriceQuarter  = ParseDecimalForString(jp.getValue("BBINPriceQuarter"));
                    bc.Entity.BBOUTPriceQuarter = ParseDecimalForString(jp.getValue("BBOUTPriceQuarter"));
                    bc.Entity.BBINPriceYear     = ParseDecimalForString(jp.getValue("BBINPriceYear"));
                    bc.Entity.BBOUTPriceYear    = ParseDecimalForString(jp.getValue("BBOUTPriceYear"));
                    bc.Entity.BBDeposit         = ParseDecimalForString(jp.getValue("BBDeposit"));
                    bc.Entity.BBImage           = jp.getValue("BBImage");
                    bc.Entity.IsStatistics      = bool.Parse(jp.getValue("IsStatistics"));

                    int r = bc.Save("update");

                    if (r <= 0)
                    {
                        flag = "2";
                    }
                    else
                    {
                        #region  步到资源系统

                        string syncResult = string.Empty;
                        try
                        {
                            ResourceService.ResourceService srv = new ResourceService.ResourceService();
                            srv.Url    = ConfigurationManager.AppSettings["ResourceServiceUrl"].ToString();
                            syncResult = srv.AddOrUpdateBillboard(JsonConvert.SerializeObject(bc.Entity));
                        }
                        catch (Exception ex)
                        {
                            syncResult = ex.ToString();
                        }
                        collection.Add(new JsonStringValue("sync", syncResult));

                        #endregion
                    }
                }
                else
                {
                    Data      obj = new Data();
                    DataTable dt  = obj.PopulateDataSet("select cnt=COUNT(*) from Mstr_Billboard where BBNo='" + jp.getValue("BBNo") + "'").Tables[0];
                    if (int.Parse(dt.Rows[0]["cnt"].ToString()) > 0)
                    {
                        flag = "3";
                    }
                    else
                    {
                        bc.Entity.BBNo              = jp.getValue("BBNo");
                        bc.Entity.BBName            = jp.getValue("BBName");
                        bc.Entity.BBSPNo            = jp.getValue("BBSPNo");
                        bc.Entity.BBLOCNo           = jp.getValue("BBLOCNo");
                        bc.Entity.BBAddr            = jp.getValue("BBAddr");
                        bc.Entity.BBSize            = jp.getValue("BBSize");
                        bc.Entity.BBType            = jp.getValue("BBType");
                        bc.Entity.BBINPriceDay      = ParseDecimalForString(jp.getValue("BBINPriceDay"));
                        bc.Entity.BBOUTPriceDay     = ParseDecimalForString(jp.getValue("BBOUTPriceDay"));
                        bc.Entity.BBINPriceMonth    = ParseDecimalForString(jp.getValue("BBINPriceMonth"));
                        bc.Entity.BBOUTPriceMonth   = ParseDecimalForString(jp.getValue("BBOUTPriceMonth"));
                        bc.Entity.BBINPriceQuarter  = ParseDecimalForString(jp.getValue("BBINPriceQuarter"));
                        bc.Entity.BBOUTPriceQuarter = ParseDecimalForString(jp.getValue("BBOUTPriceQuarter"));
                        bc.Entity.BBINPriceYear     = ParseDecimalForString(jp.getValue("BBINPriceYear"));
                        bc.Entity.BBOUTPriceYear    = ParseDecimalForString(jp.getValue("BBOUTPriceYear"));
                        bc.Entity.BBDeposit         = ParseDecimalForString(jp.getValue("BBDeposit"));
                        bc.Entity.BBImage           = jp.getValue("BBImage");
                        bc.Entity.IsStatistics      = bool.Parse(jp.getValue("IsStatistics"));

                        bc.Entity.BBCreator    = user.Entity.UserName;
                        bc.Entity.BBCreateDate = GetDate();

                        int r = bc.Save("insert");
                        if (r <= 0)
                        {
                            flag = "2";
                        }
                        else
                        {
                            #region  步到资源系统

                            string syncResult = string.Empty;
                            try
                            {
                                ResourceService.ResourceService srv = new ResourceService.ResourceService();
                                srv.Url    = ConfigurationManager.AppSettings["ResourceServiceUrl"].ToString();
                                syncResult = srv.AddOrUpdateBillboard(JsonConvert.SerializeObject(bc.Entity));
                            }
                            catch (Exception ex)
                            {
                                syncResult = ex.ToString();
                            }
                            collection.Add(new JsonStringValue("sync", syncResult));

                            #endregion
                        }
                    }
                }
            }
            catch { flag = "2"; }


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

            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("BBNoS"), jp.getValue("BBNameS"), jp.getValue("BBAddrS"), jp.getValue("BBStatusS"),
                                                                     jp.getValue("BBTypeS"), jp.getValue("BBSPNoS"), ParseIntForString(jp.getValue("page"))))); return(collection.ToString());
        }