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

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

                //if (obj.PopulateDataSet("select 1 from Mstr_Customer where CustNo='" + bc.Entity.CustNo + "'").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("CustNoS"), jp.getValue("CustNameS"), jp.getValue("CustTypeS"), jp.getValue("CustStatusS"), ParseIntForString(jp.getValue("page")))));

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

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

                collection.Add(new JsonStringValue("CustNo", bc.Entity.CustNo));
                collection.Add(new JsonStringValue("CustName", bc.Entity.CustName));
                collection.Add(new JsonStringValue("CustShortName", bc.Entity.CustShortName));
                collection.Add(new JsonStringValue("CustType", bc.Entity.CustType));
                collection.Add(new JsonStringValue("Representative", bc.Entity.Representative));
                collection.Add(new JsonStringValue("BusinessScope", bc.Entity.BusinessScope));
                collection.Add(new JsonStringValue("CustLicenseNo", bc.Entity.CustLicenseNo));
                collection.Add(new JsonStringValue("RepIDCard", bc.Entity.RepIDCard));
                collection.Add(new JsonStringValue("CustContact", bc.Entity.CustContact));
                collection.Add(new JsonStringValue("CustTel", bc.Entity.CustTel));
                collection.Add(new JsonStringValue("CustContactMobile", bc.Entity.CustContactMobile));
                collection.Add(new JsonStringValue("CustEmail", bc.Entity.CustEmail));
                collection.Add(new JsonStringValue("CustBankTitle", bc.Entity.CustBankTitle));
                collection.Add(new JsonStringValue("CustBankAccount", bc.Entity.CustBankAccount));
                collection.Add(new JsonStringValue("CustBank", bc.Entity.CustBank));
                collection.Add(new JsonStringValue("IsExternal", (bc.Entity.IsExternal ? "1" : "0")));
            }
            catch
            { flag = "2"; }

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

            return(collection.ToString());
        }
示例#3
0
        private string createList(string CustNo, string CustName, string CustType, string CustStatus, 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='8%'>客户编号</th>");
            sb.Append("<th width='19%'>客户名称</th>");
            sb.Append("<th width='19%'>客户简称</th>");
            sb.Append("<th width='6%'>客户类别</th>");
            sb.Append("<th width='6%'>单位法人</th>");
            sb.Append("<th width='6%'>客户联系人</th>");
            sb.Append("<th width='8%'>固定电话</th>");
            sb.Append("<th width='9%'>联系人手机号码</th>");
            sb.Append("<th width='9%'>电子邮箱</th>");
            sb.Append("<th width='6%'>状态</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");

            int r = 1;

            sb.Append("<tbody>");
            Business.Base.BusinessCustomer bc = new project.Business.Base.BusinessCustomer();
            foreach (Entity.Base.EntityCustomer it in bc.GetListQuery(CustNo, CustName, CustType, CustStatus, page, pageSize))
            {
                sb.Append("<tr class=\"text-c\" id=\"" + it.CustNo + "\">");
                sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>");
                sb.Append("<td>" + it.CustNo + "</td>");
                sb.Append("<td>" + it.CustName + "</td>");
                sb.Append("<td>" + it.CustShortName + "</td>");
                sb.Append("<td>" + it.CustType + "</td>");
                sb.Append("<td>" + it.Representative + "</td>");
                sb.Append("<td>" + it.CustContact + "</td>");
                sb.Append("<td>" + it.CustTel + "</td>");
                sb.Append("<td>" + it.CustContactMobile + "</td>");
                sb.Append("<td>" + it.CustEmail + "</td>");
                sb.Append("<td class=\"td-status\"><span class=\"label " + (it.CustStatus == "1" ? "label-success" : "") + " radius\">" + it.CustStatusName + "</span></td>");
                sb.Append("</tr>");
                r++;
            }
            sb.Append("</tbody>");
            sb.Append("</table>");

            sb.Append(Paginat(bc.GetListCount(CustNo, CustName, CustType, CustStatus), pageSize, page, 7));

            return(sb.ToString());
        }
示例#4
0
        private string submitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";
            string msg  = "等待同步!";

            try
            {
                Business.Base.BusinessCustomer bc = new project.Business.Base.BusinessCustomer();
                if (jp.getValue("tp") == "update")
                {
                    bc.load(jp.getValue("id"));
                    bc.Entity.CustName          = jp.getValue("CustName");
                    bc.Entity.CustShortName     = jp.getValue("CustShortName");
                    bc.Entity.CustType          = jp.getValue("CustType");
                    bc.Entity.Representative    = jp.getValue("Representative");
                    bc.Entity.BusinessScope     = jp.getValue("BusinessScope");
                    bc.Entity.CustLicenseNo     = jp.getValue("CustLicenseNo");
                    bc.Entity.RepIDCard         = jp.getValue("RepIDCard");
                    bc.Entity.CustContact       = jp.getValue("CustContact");
                    bc.Entity.CustTel           = jp.getValue("CustTel");
                    bc.Entity.CustContactMobile = jp.getValue("CustContactMobile");
                    bc.Entity.CustEmail         = jp.getValue("CustEmail");
                    bc.Entity.CustBankTitle     = jp.getValue("CustBankTitle");
                    bc.Entity.CustBankAccount   = jp.getValue("CustBankAccount");
                    bc.Entity.CustBank          = jp.getValue("CustBank");
                    bc.Entity.IsExternal        = (jp.getValue("IsExternal") == "1");
                    if (!bc.DataOpration("update", user.Entity.UserName, out msg))
                    {
                        flag = "2";
                    }
                    #region odk
                    //int r = bc.Save("update");
                    //if (r <= 0)
                    //    flag = "2";
                    //else
                    //{
                    //    try
                    //    {
                    //        //bc.ButlerSync("update", user.Entity.UserName);//管家
                    //        //bc.WOSync("update", user.Entity.UserName);//工单
                    //        //bc.CustomerSystemSync("update");//客户
                    //        ////同步艾众管家
                    //        //ButlerSrv.AppService service = new ButlerSrv.AppService();
                    //        //service.SetCustomer(bc.Entity.CustNo, bc.Entity.CustName, bc.Entity.CustShortName, bc.Entity.CustType, bc.Entity.Representative,
                    //        //    bc.Entity.BusinessScope, bc.Entity.CustLicenseNo, bc.Entity.RepIDCard, bc.Entity.CustContact, bc.Entity.CustTel,
                    //        //    bc.Entity.CustContactMobile, bc.Entity.CustEmail, bc.Entity.CustBankTitle, bc.Entity.CustBankAccount, bc.Entity.CustBank, bc.Entity.IsExternal,
                    //        //    user.Entity.UserName, "update", "5218E3ED752A49D4");
                    //        ////同步工单
                    //        //WOService.WebService service1 = new WOService.WebService();
                    //        //service1.Url = wopath;
                    //        //service1.SetCustomer(bc.Entity.CustNo, bc.Entity.CustName, bc.Entity.CustShortName, bc.Entity.CustType, bc.Entity.Representative,
                    //        //    bc.Entity.BusinessScope, bc.Entity.CustLicenseNo, bc.Entity.RepIDCard, bc.Entity.CustContact, bc.Entity.CustTel,
                    //        //    bc.Entity.CustContactMobile, bc.Entity.CustEmail, bc.Entity.CustBankTitle, bc.Entity.CustBankAccount, bc.Entity.CustBank, bc.Entity.IsExternal,
                    //        //    user.Entity.UserName, "update", "5218E3ED752A49D4");
                    //        ////同步客户大数据

                    //    }
                    //    catch (Exception ex)
                    //    {
                    //        Console.WriteLine(ex.ToString());
                    //    }
                    //}
                    #endregion
                }
                else
                {
                    Data      obj = new Data();
                    DataTable dt  = obj.PopulateDataSet("select cnt=COUNT(*) from Mstr_Customer where CustNo='" + jp.getValue("CustNo") + "'").Tables[0];
                    if (int.Parse(dt.Rows[0]["cnt"].ToString()) > 0)
                    {
                        flag = "3";
                    }
                    else
                    {
                        bc.Entity.CustNo            = jp.getValue("CustNo");
                        bc.Entity.CustName          = jp.getValue("CustName");
                        bc.Entity.CustShortName     = jp.getValue("CustShortName");
                        bc.Entity.CustType          = jp.getValue("CustType");
                        bc.Entity.Representative    = jp.getValue("Representative");
                        bc.Entity.BusinessScope     = jp.getValue("BusinessScope");
                        bc.Entity.CustLicenseNo     = jp.getValue("CustLicenseNo");
                        bc.Entity.RepIDCard         = jp.getValue("RepIDCard");
                        bc.Entity.CustContact       = jp.getValue("CustContact");
                        bc.Entity.CustTel           = jp.getValue("CustTel");
                        bc.Entity.CustContactMobile = jp.getValue("CustContactMobile");
                        bc.Entity.CustEmail         = jp.getValue("CustEmail");
                        bc.Entity.CustBankTitle     = jp.getValue("CustBankTitle");
                        bc.Entity.CustBankAccount   = jp.getValue("CustBankAccount");
                        bc.Entity.CustBank          = jp.getValue("CustBank");
                        bc.Entity.IsExternal        = (jp.getValue("IsExternal") == "1");
                        bc.Entity.CustStatus        = "3";
                        bc.Entity.CustCreator       = user.Entity.UserName;
                        bc.Entity.CustCreateDate    = GetDate();
                        if (!bc.DataOpration("insert", user.Entity.UserName, out msg))
                        {
                            flag = "2";
                        }
                        #region odl
                        //int r = bc.Save("insert");
                        //if (r <= 0)
                        //    flag = "2";
                        //else
                        //{
                        //    try
                        //    {
                        //        //bc.ButlerSync("insert", user.Entity.UserName);//管家
                        //        //bc.WOSync("insert", user.Entity.UserName);//工单
                        //        //bc.CustomerSystemSync("insert");//客户
                        //        ////同步艾众管家
                        //        //ButlerSrv.AppService service = new ButlerSrv.AppService();
                        //        //service.SetCustomer(bc.Entity.CustNo, bc.Entity.CustName, bc.Entity.CustShortName, bc.Entity.CustType, bc.Entity.Representative,
                        //        //    bc.Entity.BusinessScope, bc.Entity.CustLicenseNo, bc.Entity.RepIDCard, bc.Entity.CustContact, bc.Entity.CustTel,
                        //        //    bc.Entity.CustContactMobile, bc.Entity.CustEmail, bc.Entity.CustBankTitle, bc.Entity.CustBankAccount, bc.Entity.CustBank, bc.Entity.IsExternal,
                        //        //    user.Entity.UserName, "insert", "5218E3ED752A49D4");

                        //        //WOService.WebService service1 = new WOService.WebService();
                        //        //service1.Url = wopath;
                        //        //service1.SetCustomer(bc.Entity.CustNo, bc.Entity.CustName, bc.Entity.CustShortName, bc.Entity.CustType, bc.Entity.Representative,
                        //        //    bc.Entity.BusinessScope, bc.Entity.CustLicenseNo, bc.Entity.RepIDCard, bc.Entity.CustContact, bc.Entity.CustTel,
                        //        //    bc.Entity.CustContactMobile, bc.Entity.CustEmail, bc.Entity.CustBankTitle, bc.Entity.CustBankAccount, bc.Entity.CustBank, bc.Entity.IsExternal,
                        //        //    user.Entity.UserName, "insert", "5218E3ED752A49D4");
                        //    }
                        //    catch { }
                        //}
                        #endregion
                    }
                }
            }
            catch (Exception ex) { flag = "2"; msg = ex.ToString(); }

            collection.Add(new JsonStringValue("type", "submit"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("msg", msg));
            if (flag == "1")
            {
                collection.Add(new JsonStringValue("liststr", createList(jp.getValue("CustNoS"), jp.getValue("CustNameS"), jp.getValue("CustTypeS"), jp.getValue("CustStatusS"), ParseIntForString(jp.getValue("page")))));
            }

            return(collection.ToString());
        }
示例#5
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());
        }
示例#6
0
        private string submitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessCustomer bc = new project.Business.Base.BusinessCustomer();
                if (jp.getValue("tp") == "update")
                {
                    bc.load(jp.getValue("id"));
                    bc.Entity.CustName          = jp.getValue("CustName");
                    bc.Entity.CustShortName     = jp.getValue("CustShortName");
                    bc.Entity.CustType          = jp.getValue("CustType");
                    bc.Entity.Representative    = jp.getValue("Representative");
                    bc.Entity.BusinessScope     = jp.getValue("BusinessScope");
                    bc.Entity.CustLicenseNo     = jp.getValue("CustLicenseNo");
                    bc.Entity.RepIDCard         = jp.getValue("RepIDCard");
                    bc.Entity.CustContact       = jp.getValue("CustContact");
                    bc.Entity.CustTel           = jp.getValue("CustTel");
                    bc.Entity.CustContactMobile = jp.getValue("CustContactMobile");
                    bc.Entity.CustEmail         = jp.getValue("CustEmail");
                    bc.Entity.CustBankTitle     = jp.getValue("CustBankTitle");
                    bc.Entity.CustBankAccount   = jp.getValue("CustBankAccount");
                    bc.Entity.CustBank          = jp.getValue("CustBank");
                    bc.Entity.IsExternal        = (jp.getValue("IsExternal") == "1");

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

                    if (r <= 0)
                    {
                        flag = "2";
                    }
                    else
                    {
                        try
                        {
                            //同步艾众管家
                            ButlerSrv.AppService service = new ButlerSrv.AppService();
                            service.SetCustomer(bc.Entity.CustNo, bc.Entity.CustName, bc.Entity.CustShortName, bc.Entity.CustType, bc.Entity.Representative,
                                                bc.Entity.BusinessScope, bc.Entity.CustLicenseNo, bc.Entity.RepIDCard, bc.Entity.CustContact, bc.Entity.CustTel,
                                                bc.Entity.CustContactMobile, bc.Entity.CustEmail, bc.Entity.CustBankTitle, bc.Entity.CustBankAccount, bc.Entity.CustBank, bc.Entity.IsExternal,
                                                user.Entity.UserName, "update", "5218E3ED752A49D4");

                            WOService.WebService service1 = new WOService.WebService();
                            service1.Url = wopath;
                            service1.SetCustomer(bc.Entity.CustNo, bc.Entity.CustName, bc.Entity.CustShortName, bc.Entity.CustType, bc.Entity.Representative,
                                                 bc.Entity.BusinessScope, bc.Entity.CustLicenseNo, bc.Entity.RepIDCard, bc.Entity.CustContact, bc.Entity.CustTel,
                                                 bc.Entity.CustContactMobile, bc.Entity.CustEmail, bc.Entity.CustBankTitle, bc.Entity.CustBankAccount, bc.Entity.CustBank, bc.Entity.IsExternal,
                                                 user.Entity.UserName, "update", "5218E3ED752A49D4");
                        }
                        catch { }
                    }
                }
                else
                {
                    Data      obj = new Data();
                    DataTable dt  = obj.PopulateDataSet("select cnt=COUNT(*) from Mstr_Customer where CustNo='" + jp.getValue("CustNo") + "'").Tables[0];
                    if (int.Parse(dt.Rows[0]["cnt"].ToString()) > 0)
                    {
                        flag = "3";
                    }
                    else
                    {
                        bc.Entity.CustNo            = jp.getValue("CustNo");
                        bc.Entity.CustName          = jp.getValue("CustName");
                        bc.Entity.CustShortName     = jp.getValue("CustShortName");
                        bc.Entity.CustType          = jp.getValue("CustType");
                        bc.Entity.Representative    = jp.getValue("Representative");
                        bc.Entity.BusinessScope     = jp.getValue("BusinessScope");
                        bc.Entity.CustLicenseNo     = jp.getValue("CustLicenseNo");
                        bc.Entity.RepIDCard         = jp.getValue("RepIDCard");
                        bc.Entity.CustContact       = jp.getValue("CustContact");
                        bc.Entity.CustTel           = jp.getValue("CustTel");
                        bc.Entity.CustContactMobile = jp.getValue("CustContactMobile");
                        bc.Entity.CustEmail         = jp.getValue("CustEmail");
                        bc.Entity.CustBankTitle     = jp.getValue("CustBankTitle");
                        bc.Entity.CustBankAccount   = jp.getValue("CustBankAccount");
                        bc.Entity.CustBank          = jp.getValue("CustBank");
                        bc.Entity.IsExternal        = (jp.getValue("IsExternal") == "1");

                        bc.Entity.CustStatus     = "3";
                        bc.Entity.CustCreator    = user.Entity.UserName;
                        bc.Entity.CustCreateDate = GetDate();

                        int r = bc.Save("insert");
                        if (r <= 0)
                        {
                            flag = "2";
                        }
                        else
                        {
                            try
                            {
                                //同步艾众管家
                                ButlerSrv.AppService service = new ButlerSrv.AppService();
                                service.SetCustomer(bc.Entity.CustNo, bc.Entity.CustName, bc.Entity.CustShortName, bc.Entity.CustType, bc.Entity.Representative,
                                                    bc.Entity.BusinessScope, bc.Entity.CustLicenseNo, bc.Entity.RepIDCard, bc.Entity.CustContact, bc.Entity.CustTel,
                                                    bc.Entity.CustContactMobile, bc.Entity.CustEmail, bc.Entity.CustBankTitle, bc.Entity.CustBankAccount, bc.Entity.CustBank, bc.Entity.IsExternal,
                                                    user.Entity.UserName, "insert", "5218E3ED752A49D4");

                                WOService.WebService service1 = new WOService.WebService();
                                service1.Url = wopath;
                                service1.SetCustomer(bc.Entity.CustNo, bc.Entity.CustName, bc.Entity.CustShortName, bc.Entity.CustType, bc.Entity.Representative,
                                                     bc.Entity.BusinessScope, bc.Entity.CustLicenseNo, bc.Entity.RepIDCard, bc.Entity.CustContact, bc.Entity.CustTel,
                                                     bc.Entity.CustContactMobile, bc.Entity.CustEmail, bc.Entity.CustBankTitle, bc.Entity.CustBankAccount, bc.Entity.CustBank, bc.Entity.IsExternal,
                                                     user.Entity.UserName, "insert", "5218E3ED752A49D4");
                            }
                            catch { }
                        }
                    }
                }
            }
            catch { flag = "2"; }


            collection.Add(new JsonStringValue("type", "submit"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("CustNoS"), jp.getValue("CustNameS"), jp.getValue("CustTypeS"), jp.getValue("CustStatusS"), ParseIntForString(jp.getValue("page")))));

            return(collection.ToString());
        }