Exemplo n.º 1
0
        private void FillData(CorporationInfo entity)
        {
            entity.Trackmove    = cbxTrackmove.Checked ? 1 : 0;
            entity.Movecheck    = cbxMovecheck.Checked ? 1 : 0;
            entity.Forcedoffday = DataConvert.SafeInt(txtForcedoffday.Value);

            List <string> offcustomerlevels = new List <string>();

            foreach (ListItem item in cblOffcustomerlevel.Items)
            {
                if (item.Selected)
                {
                    offcustomerlevels.Add(item.Value);
                }
            }
            entity.Offcustomerlevel = string.Join(",", offcustomerlevels);

            entity.Voluntaryoffday = DataConvert.SafeInt(txtVoluntaryoffday.Value);
            entity.Offcheck        = cbxOffcheck.Checked ? 1 : 0;
            entity.Forcedoutday    = DataConvert.SafeInt(txtForcedoutday.Value);

            List <string> forcedoutdaylevels = new List <string>();

            foreach (ListItem item in cblForcedoutdaylevel.Items)
            {
                if (item.Selected)
                {
                    forcedoutdaylevels.Add(item.Value);
                }
            }
            entity.Forcedoutdaylevel = string.Join(",", forcedoutdaylevels);

            entity.Voluntaryoutday = DataConvert.SafeInt(txtVoluntaryoutday.Value);
            entity.Outcheck        = cbxOutcheck.Checked ? 1 : 0;
        }
Exemplo n.º 2
0
        private void BindControler()
        {
            ddlCorporation.DataSource     = Corporations.Instance.GetList(true);
            ddlCorporation.DataTextField  = "Name";
            ddlCorporation.DataValueField = "ID";
            ddlCorporation.DataBind();

            if (GetInt("corpid") > 0)
            {
                SetSelectedByValue(ddlCorporation, GetString("corpid"));
            }

            List <AdminInfo> listuser = Admins.Instance.GetAllAdmins();

            listuser           = listuser.FindAll(l => l.CorporationID == CurrentCorporationID);
            listuser           = listuser.OrderBy(l => (int)l.UserRole).ThenBy(l => l.UserName).ToList();
            rptUser.DataSource = listuser;
            rptUser.DataBind();

            List <PowerGroupInfo> plist = PowerGroups.Instance.GetList(true);

            plist = plist.FindAll(l => l.CorporationID == CurrentCorporationID);
            rptGroup.DataSource = plist;
            rptGroup.DataBind();

            CorporationInfo corp = Corporations.Instance.GetModel(CurrentCorporationID, true);

            rptSeries.DataSource = Cars.Instance.GetCarSeriesListByBrandID(corp.BrandID);
            rptSeries.DataBind();

            rptInfoSource.DataSource = InfoSources.Instance.GetListByCorpid(CurrentCorporationID, true);
            rptInfoSource.DataBind();
        }
Exemplo n.º 3
0
    protected void btnSignet_Click(object sender, EventArgs e)
    {
        CorporationHelper corHelper = new CorporationHelper();

        if (corHelper.IsExistsSameCorp(txtCorpname.Text) && ddlRegion.Visible)
        {
            ScriptManager.RegisterStartupScript(btnSave, GetType(), "warning", "javascript:$.ligerDialog.warn('相同的单位名称已经存在,请重新填写!');", true);
        }
        else
        {
            CorporationInfo corInfo = new CorporationInfo(lblCorpId.Text);
            if (string.IsNullOrEmpty(CorporationID) && EditType == "E")
            {
                if (corHelper.IsExists(lblCorpId.Text))
                {
                    corInfo.CorpID = corHelper.GetCorporationID(ddlRegion.SelectedValue);
                }
                else
                {
                    corInfo.CorpID = lblCorpId.Text;
                }
            }

            corInfo.CorpName  = txtCorpname.Text;
            corInfo.AliasName = txtAliasName.Text;
            corInfo.FullName  = txtEnglishName.Text;
            corInfo.CorpClass = ddlType.SelectedValue;
            corInfo.CorpType  = ddlCategory.SelectedValue;

            corInfo.TaxNo      = txtTaxNo.Text.Trim();
            corInfo.BizNo      = ddlCerType.SelectedValue;
            corInfo.OtherNo    = lblQueryCode.Text;
            corInfo.PassWord   = lblUserCode.Text;
            corInfo.BossName   = txtBoss.Text;
            corInfo.BossIDCard = txtIDCard.Text;
            corInfo.Linker     = txtLinker.Text;
            corInfo.LinkWay    = txtLinkWay.Text;
            corInfo.PostCode   = txtPostCode.Text;
            corInfo.Memo       = txtMemo.Text;
            corInfo.Address    = txtAddress.Text;
            corInfo.AreaID     = ddlArea.SelectedValue;
            corInfo.CreateDate = DateTime.Now;
            corInfo.Status     = "A";
            corInfo.AccountNo  = txtOrgnization.Text;
            corInfo.Creator    = SysContext.CurrentUserName;
            corInfo.Region     = ddlRegion.SelectedValue;
            if (ddlRegion.Visible)
            {
                corInfo.RegionName = ddlRegion.SelectedItem.Text;
            }

            corHelper.UpdateCorporation(corInfo);
            Session["SignetList"]  = null;
            Session["Corporation"] = null;
            ScriptManager.RegisterStartupScript(btnSave, GetType(), "warning", "javascript:AddSignetDialog('" + corInfo.CorpID + "');", true);
        }
    }
Exemplo n.º 4
0
        private void FillData(CorporationInfo entity)
        {
            entity.BrandID    = DataConvert.SafeInt(ddlCarBrand.SelectedValue);
            entity.ProvinceID = DataConvert.SafeInt(ddlProvince.SelectedValue);
            entity.CityID     = DataConvert.SafeInt(ddlCity.SelectedValue);
            entity.DistrictID = DataConvert.SafeInt(ddlDistrict.SelectedValue);

            entity.IsProcess = DataConvert.SafeInt(rblIsProcess.SelectedValue);
        }
Exemplo n.º 5
0
        private void LoadData()
        {
            int id = GetInt("id");

            if (id > 0)
            {
                CurrentCorporation = Corporations.Instance.GetModel(id, true);

                txtName.Value = CurrentCorporation.Name;
            }
        }
Exemplo n.º 6
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CorporationInfo entity = CurrentCorporation;

            FillData(entity);

            Corporations.Instance.Update(entity);

            Corporations.Instance.ReloadCorporationListCache();

            WriteSuccessMessage("系统提示", "数据保存成功", CurrentUrl);
        }
Exemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         string pass = "******";
         if (Session["CorporationId"] != null)
         {
             CorporationInfo corp = new CorporationInfo(Session["CorporationId"].ToString());
             pass = corp.PassWord;
         }
         //UserInfoHelper.IsValidCorporation(CorporationID, pass);
         InitialControls();
     }
 }
Exemplo n.º 8
0
        protected void ddlCorporation_SelectedIndexChanged(object sender, EventArgs e)
        {
            int             corpid   = DataConvert.SafeInt(ddlCorporation.SelectedValue);
            CorporationInfo corpinfo = Corporations.Instance.GetModel(corpid, true);

            if (corpinfo.ProvinceID >= 0)
            {
                SetSelectedByValue(ddlCarBrand, corpinfo.BrandID.ToString());

                SetSelectedByValue(ddlProvince, corpinfo.ProvinceID.ToString());
                ddlProvince_SelectedIndexChanged(null, null);
                SetSelectedByValue(ddlCity, corpinfo.CityID.ToString());
                ddlCity_SelectedIndexChanged(null, null);
                SetSelectedByValue(ddlDistrict, corpinfo.DistrictID.ToString());

                SetSelectedByValue(rblIsProcess, corpinfo.IsProcess.ToString());
            }
        }
Exemplo n.º 9
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CorporationInfo entity = new CorporationInfo();
            int             id     = GetInt("id");

            if (id > 0)
            {
                entity = Corporations.Instance.GetModel(id, true);
            }
            FillData(entity);

            if (id > 0)
            {
                Corporations.Instance.Update(entity);
            }
            else
            {
                Corporations.Instance.Add(entity);
            }

            Corporations.Instance.ReloadCorporationListCache();
            Response.Redirect("corporationmg.aspx");
        }
Exemplo n.º 10
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CorporationInfo entity = new CorporationInfo();

            if (Corporation != null)
            {
                entity = Corporation;
            }
            else
            {
                entity = Corporations.Instance.GetModel(DataConvert.SafeInt(ddlCorporation.SelectedValue), true);
            }
            FillData(entity);

            Corporations.Instance.Update(entity);
            Corporations.Instance.ReloadCorporationListCache();
            if (Corporation != null)
            {
                Corporation = entity;
            }

            WriteMessage("/message.aspx", "系统提示", "数据保存成功!", "", "/common/basesetting.aspx");
        }
Exemplo n.º 11
0
        private void LoadData()
        {
            corpid = Corporation == null ? 0 : Corporation.ID;
            if (Admin.Administrator)
            {
                corpid = DataConvert.SafeInt(ddlCorporation.SelectedValue);
            }
            CorporationInfo corpinfo = Corporations.Instance.GetModel(corpid, true);

            if (corpinfo != null)
            {
                List <CustomerInfo> list = Customers.Instance.GetCustomerListByCorporation(corpinfo.ID, true);
                list = list.FindAll(l => l.LurkStatus == 0);
                list = list.FindAll(l => l.CheckStatus == 0);
                if (!Admin.Administrator && Admin.UserRole != UserRoleType.系统管理员)
                {
                    if (CurrentPowerGroup != null && !string.IsNullOrEmpty(CurrentPowerGroup.CanviewGroupIds))
                    {
                        string[] powers = CurrentPowerGroup.CanviewGroupIds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        list = list.FindAll(l => l.OwnerID == AdminID || powers.Contains(l.OwnerPowerGroupID.ToString()));
                    }
                    else
                    {
                        list = list.FindAll(l => l.OwnerID == AdminID);
                    }
                }

                List <CustomerInfo> listVoluntary = new List <CustomerInfo>();
                //主动转出
                if (corpinfo.Trackmove == 1)
                {
                    listVoluntary.AddRange(list.FindAll(l => l.CustomerStatus == (int)CustomerStatus.导入_集客));
                }
                if (corpinfo.Voluntaryoffday > 0)
                {
                    listVoluntary.AddRange(list.FindAll(l => l.CustomerStatus == (int)CustomerStatus.清洗_邀约 && DateTime.Today.Subtract(DataConvert.SafeDate(l.PostTime)).TotalDays >= (corpinfo.Voluntaryoffday - 1)));
                }
                if (corpinfo.Voluntaryoutday > 0)
                {
                    listVoluntary.AddRange(list.FindAll(l => l.CustomerStatus == (int)CustomerStatus.追踪_促成 && DateTime.Today.Subtract(DataConvert.SafeDate(l.PostTime)).TotalDays >= (corpinfo.Voluntaryoutday - 1)));
                }
                VoluntaryNum = listVoluntary.Count;

                List <CustomerInfo> listForced = new List <CustomerInfo>();
                //7天内强制转出
                if (corpinfo.Forcedoffday > 0)
                {
                    string[] offcustomerlevel = corpinfo.Offcustomerlevel.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    listForced.AddRange(list.FindAll(l => l.CustomerStatus == (int)CustomerStatus.清洗_邀约 && DateTime.Today.Subtract(DataConvert.SafeDate(l.PostTime)).TotalDays >= (corpinfo.Forcedoffday - 7) && !offcustomerlevel.Contains(l.LastCustomerLevelID.ToString())));
                }
                if (corpinfo.Forcedoutday > 0)
                {
                    string[] forcedoutdaylevel = corpinfo.Forcedoutdaylevel.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    listForced.AddRange(list.FindAll(l => l.CustomerStatus == (int)CustomerStatus.追踪_促成 && DateTime.Today.Subtract(DataConvert.SafeDate(l.PostTime)).TotalDays >= (corpinfo.Forcedoutday - 7) && !forcedoutdaylevel.Contains(l.LastCustomerLevelID.ToString())));
                }
                ForcedNum = listForced.Count;

                ConnecttimeoutNum    = list.FindAll(l => l.ConnectAlarm == "2").Count;
                ConnecttimeoutingNum = list.FindAll(l => l.ConnectAlarm == "1").Count;
            }
        }
Exemplo n.º 12
0
 private void FillData(CorporationInfo entity)
 {
     entity.Name = txtName.Value;
 }
Exemplo n.º 13
0
        private void LoadData()
        {
            if (GetInt("json") == 1)
            {
                Regex  rtime          = new Regex(@"[- :]");
                float  starttimevalue = 0;
                float  endtimevalue   = 0;
                string starttime      = GetString("starttime");
                string endtime        = GetString("endtime");
                if (!string.IsNullOrEmpty(starttime))
                {
                    starttimevalue = DataConvert.SafeFloat(DataConvert.SafeDate(starttime).ToString("yyyyMMddHHmm"));
                }
                if (!string.IsNullOrEmpty(endtime))
                {
                    endtimevalue = DataConvert.SafeFloat(DataConvert.SafeDate(endtime).AddDays(1).ToString("yyyyMMddHHmm"));
                }
                string result = "{\"0\":false,\"unit\":\"%\"}";
                if (GetString("active") == "track" || string.IsNullOrEmpty(GetString("active")))
                {
                    #region 线索新增量

                    string           uids     = GetString("uid[]");
                    string           groupids = GetString("groupid[]");
                    List <AdminInfo> listuser = Admins.Instance.GetAllAdmins();
                    listuser = listuser.FindAll(l => l.CorporationID == CurrentCorporationID);
                    List <CustomerInfo> list = Customers.Instance.GetCustomerListByCorporation(CurrentCorporationID, true);
                    list = list.FindAll(l => listuser.Exists(u => u.ID == l.CreateUserID) && DataConvert.SafeFloat(rtime.Replace(l.CreateTime, string.Empty)) >= starttimevalue && DataConvert.SafeFloat(rtime.Replace(l.CreateTime, string.Empty)) <= endtimevalue);
                    if (!string.IsNullOrEmpty(uids))
                    {
                        string[] uid = uids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        list = list.FindAll(l => uid.Contains(l.CreateUserID.ToString()));
                    }
                    if (list.Count > 0)
                    {
                        string total = string.Empty;
                        string user  = string.Empty;
                        if (!string.IsNullOrEmpty(uids))
                        {
                            string[] uid = uids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                            foreach (AdminInfo admin in listuser.FindAll(l => uid.Contains(l.ID.ToString())))
                            {
                                total += (string.IsNullOrEmpty(total) ? string.Empty : ",") + list.FindAll(l => l.CreateUserID == admin.ID).Count.ToString();
                                user  += (string.IsNullOrEmpty(user) ? string.Empty : ",") + string.Format("\"{0}\"", admin.RealnameAndGroupname);
                            }
                        }
                        else if (!string.IsNullOrEmpty(groupids))
                        {
                            foreach (string groupid in groupids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                            {
                                foreach (AdminInfo admin in listuser.FindAll(l => l.PowerGroupID.ToString() == groupid))
                                {
                                    total += (string.IsNullOrEmpty(total) ? string.Empty : ",") + list.FindAll(l => l.CreateUserID == admin.ID).Count.ToString();
                                    user  += (string.IsNullOrEmpty(user) ? string.Empty : ",") + string.Format("\"{0}\"", admin.RealnameAndGroupname);
                                }
                            }
                        }
                        else
                        {
                            foreach (AdminInfo admin in listuser)
                            {
                                total += (string.IsNullOrEmpty(total) ? string.Empty : ",") + list.FindAll(l => l.CreateUserID == admin.ID).Count.ToString();
                                user  += (string.IsNullOrEmpty(user) ? string.Empty : ",") + string.Format("\"{0}\"", admin.RealnameAndGroupname);
                            }
                        }


                        result = "{\"starttime\":\"" + starttime
                                 + "\",\"endtime\":\"" + endtime
                                 + "\",\"heji\":" + list.Count
                                 + ",\"total\":[" + total
                                 + "],\"user\":[" + user
                                 + "],\"unit\":\"%\"}";
                    }

                    Response.Clear();
                    Response.Write(result);
                    Response.End();

                    #endregion
                }
                else if (GetString("active") == "brandseries")
                {
                    #region 线索拟购车系

                    string series            = GetString("series[]");
                    List <CustomerInfo> list = Customers.Instance.GetCustomerListByCorporation(CurrentCorporationID, true);
                    list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.CreateTime, string.Empty)) >= starttimevalue && DataConvert.SafeFloat(rtime.Replace(l.CreateTime, string.Empty)) <= endtimevalue);
                    if (!string.IsNullOrEmpty(series))
                    {
                        string[] serie = series.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        list = list.FindAll(l => series.Contains(l.IbuyCarSeriesID.ToString()));
                    }
                    if (list.Count > 0)
                    {
                        CorporationInfo      corp  = Corporations.Instance.GetModel(CurrentCorporationID, true);
                        List <CarSeriesInfo> slist = Cars.Instance.GetCarSeriesListByBrandID(corp.BrandID, true);

                        string total     = string.Empty;
                        string seriesstr = string.Empty;
                        if (!string.IsNullOrEmpty(series))
                        {
                            string[] serie = series.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                            foreach (CarSeriesInfo sinfo in slist.FindAll(s => serie.Contains(s.ID.ToString())))
                            {
                                total     += (string.IsNullOrEmpty(total) ? string.Empty : ",") + list.FindAll(l => l.IbuyCarSeriesID == sinfo.ID).Count.ToString();
                                seriesstr += (string.IsNullOrEmpty(seriesstr) ? string.Empty : ",") + string.Format("\"{0}\"", sinfo.Name);
                            }
                        }
                        else
                        {
                            foreach (CarSeriesInfo sinfo in slist)
                            {
                                total     += (string.IsNullOrEmpty(total) ? string.Empty : ",") + list.FindAll(l => l.IbuyCarSeriesID == sinfo.ID).Count.ToString();
                                seriesstr += (string.IsNullOrEmpty(seriesstr) ? string.Empty : ",") + string.Format("\"{0}\"", sinfo.Name);
                            }
                        }

                        result = "{\"starttime\":\"" + starttime
                                 + "\",\"endtime\":\"" + endtime
                                 + "\",\"heji\":" + list.Count
                                 + ",\"total\":[" + total
                                 + "],\"series\":[" + seriesstr
                                 + "],\"unit\":\"%\"}";
                    }

                    Response.Clear();
                    Response.Write(result);
                    Response.End();

                    #endregion
                }
                else if (GetString("active") == "purge")
                {
                    #region 意向客户新增量

                    string           uids     = GetString("uid[]");
                    string           groupids = GetString("groupid[]");
                    List <AdminInfo> listuser = Admins.Instance.GetAllAdmins();
                    listuser = listuser.FindAll(l => l.CorporationID == CurrentCorporationID);
                    List <CustomerInfo> list = Customers.Instance.GetCustomerListByCorporation(CurrentCorporationID, true);
                    list = list.FindAll(l => listuser.Exists(u => u.ID == l.CreateUserID) && l.CustomerStatus >= (int)CustomerStatus.清洗_邀约 && DataConvert.SafeFloat(rtime.Replace(l.CreateTime, string.Empty)) >= starttimevalue && DataConvert.SafeFloat(rtime.Replace(l.CreateTime, string.Empty)) <= endtimevalue);
                    if (!string.IsNullOrEmpty(uids))
                    {
                        string[] uid = uids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        list = list.FindAll(l => uid.Contains(l.CreateUserID.ToString()));
                    }
                    if (list.Count > 0)
                    {
                        string total = string.Empty;
                        string user  = string.Empty;
                        if (!string.IsNullOrEmpty(uids))
                        {
                            string[] uid = uids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                            foreach (AdminInfo admin in listuser.FindAll(l => uid.Contains(l.ID.ToString())))
                            {
                                total += (string.IsNullOrEmpty(total) ? string.Empty : ",") + list.FindAll(l => l.CreateUserID == admin.ID).Count.ToString();
                                user  += (string.IsNullOrEmpty(user) ? string.Empty : ",") + string.Format("\"{0}\"", admin.RealnameAndGroupname);
                            }
                        }
                        else if (!string.IsNullOrEmpty(groupids))
                        {
                            foreach (string groupid in groupids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                            {
                                foreach (AdminInfo admin in listuser.FindAll(l => l.PowerGroupID.ToString() == groupid))
                                {
                                    total += (string.IsNullOrEmpty(total) ? string.Empty : ",") + list.FindAll(l => l.CreateUserID == admin.ID).Count.ToString();
                                    user  += (string.IsNullOrEmpty(user) ? string.Empty : ",") + string.Format("\"{0}\"", admin.RealnameAndGroupname);
                                }
                            }
                        }
                        else
                        {
                            foreach (AdminInfo admin in listuser)
                            {
                                total += (string.IsNullOrEmpty(total) ? string.Empty : ",") + list.FindAll(l => l.CreateUserID == admin.ID).Count.ToString();
                                user  += (string.IsNullOrEmpty(user) ? string.Empty : ",") + string.Format("\"{0}\"", admin.RealnameAndGroupname);
                            }
                        }

                        result = "{\"starttime\":\"" + starttime
                                 + "\",\"endtime\":\"" + endtime
                                 + "\",\"heji\":" + list.Count
                                 + ",\"total\":[" + total
                                 + "],\"user\":[" + user
                                 + "],\"unit\":\"%\"}";
                    }

                    Response.Clear();
                    Response.Write(result);
                    Response.End();

                    #endregion
                }
                else if (GetString("active") == "infosource")
                {
                    #region 线索信息来源

                    string infosources       = GetString("infosource[]");
                    List <CustomerInfo> list = Customers.Instance.GetCustomerListByCorporation(CurrentCorporationID, true);
                    list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.CreateTime, string.Empty)) >= starttimevalue && DataConvert.SafeFloat(rtime.Replace(l.CreateTime, string.Empty)) <= endtimevalue);
                    if (!string.IsNullOrEmpty(infosources))
                    {
                        string[] infosource = infosources.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        list = list.FindAll(l => infosource.Contains(l.InfoSourceID.ToString()));
                    }
                    if (list.Count > 0)
                    {
                        List <InfoSourceInfo> islist = InfoSources.Instance.GetListByCorpid(CurrentCorporationID, true);

                        string total      = string.Empty;
                        string infosource = string.Empty;
                        if (!string.IsNullOrEmpty(infosources))
                        {
                            string[] infosourcelist = infosources.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                            foreach (InfoSourceInfo sinfo in islist.FindAll(s => infosourcelist.Contains(s.ID.ToString())))
                            {
                                total      += (string.IsNullOrEmpty(total) ? string.Empty : ",") + list.FindAll(l => l.InfoSourceID == sinfo.ID).Count.ToString();
                                infosource += (string.IsNullOrEmpty(infosource) ? string.Empty : ",") + string.Format("\"{0}\"", sinfo.Name);
                            }
                        }
                        else
                        {
                            foreach (InfoSourceInfo sinfo in islist)
                            {
                                total      += (string.IsNullOrEmpty(total) ? string.Empty : ",") + list.FindAll(l => l.InfoSourceID == sinfo.ID).Count.ToString();
                                infosource += (string.IsNullOrEmpty(infosource) ? string.Empty : ",") + string.Format("\"{0}\"", sinfo.Name);
                            }
                        }

                        result = "{\"starttime\":\"" + starttime
                                 + "\",\"endtime\":\"" + endtime
                                 + "\",\"heji\":" + list.Count
                                 + ",\"total\":[" + total
                                 + "],\"infosource\":[" + infosource
                                 + "],\"unit\":\"%\"}";
                    }

                    Response.Clear();
                    Response.Write(result);
                    Response.End();

                    #endregion
                }
            }
        }
Exemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int    corpid = GetInt("corpid", 0);
                string action = GetString("action");

                if (action == "userlist")
                {
                    List <AdminInfo> list = Admins.Instance.GetAllAdmins();
                    list = list.FindAll(l => l.CorporationID == corpid);
                    if (!Admin.Administrator && Admin.UserRole != UserRoleType.系统管理员)
                    {
                        if (CurrentPowerGroup != null && !string.IsNullOrEmpty(CurrentPowerGroup.CanviewGroupIds))
                        {
                            string[] powers = CurrentPowerGroup.CanviewGroupIds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                            list = list.FindAll(l => l.ID == AdminID || powers.Contains(l.PowerGroupID.ToString()));
                        }
                        else
                        {
                            list = list.FindAll(l => l.ID == AdminID);
                        }
                    }

                    list = list.OrderBy(l => (int)l.UserRole).ThenBy(l => l.UserName).ToList();

                    Response.Write(Serializer.SerializeJson(list));
                }
                else if (action == "connectway")
                {
                    List <ConnectWayInfo> list = ConnectWays.Instance.GetListByCorpid(corpid, true);
                    list = list.OrderBy(l => l.Sort).ToList();

                    Response.Write(Serializer.SerializeJson(list));
                }
                else if (action == "customerlevel")
                {
                    List <CustomerLevelInfo> list = CustomerLevels.Instance.GetListByCorpid(corpid, true);
                    list = list.OrderBy(l => l.Sort).ToList();

                    Response.Write(Serializer.SerializeJson(list));
                }
                else if (action == "series" || action == "iseries")
                {
                    CorporationInfo corporation = Corporations.Instance.GetModel(corpid);
                    if (corporation != null)
                    {
                        List <CarSeriesInfo> list = Cars.Instance.GetCarSeriesListByBrandID(corporation.BrandID);
                        list = list.OrderBy(l => l.Name).ToList();

                        Response.Write(Serializer.SerializeJson(list));
                    }
                }
                else if (action == "infotype")
                {
                    List <InfoTypeInfo> list = InfoTypes.Instance.GetListByCorpid(corpid);
                    list = list.OrderBy(l => l.Sort).ToList();

                    Response.Write(Serializer.SerializeJson(list));
                }
                else if (action == "infosource")
                {
                    List <InfoSourceInfo> list = InfoSources.Instance.GetListByCorpid(corpid);
                    list = list.OrderBy(l => l.Sort).ToList();

                    Response.Write(Serializer.SerializeJson(list));
                }
                else if (action == "giveupcause")
                {
                    List <GiveupCauseInfo> list = GiveupCauses.Instance.GetListByCorpid(corpid);
                    list = list.OrderBy(l => l.Sort).ToList();

                    Response.Write(Serializer.SerializeJson(list));
                }
                else if (action == "paymentway")
                {
                    List <PaymentWayInfo> list = PaymentWays.Instance.GetListByCorpid(corpid);
                    list = list.OrderBy(l => l.Sort).ToList();

                    Response.Write(Serializer.SerializeJson(list));
                }
                else if (action == "ibuytime")
                {
                    List <IbuytimeInfo> list = Ibuytimes.Instance.GetListByCorpid(corpid);
                    list = list.OrderBy(l => l.Sort).ToList();

                    Response.Write(Serializer.SerializeJson(list));
                }
                else if (action == "tracktag")
                {
                    List <TracktagInfo> list = Tracktags.Instance.GetListByCorpid(corpid);
                    list = list.OrderBy(l => l.Sort).ToList();

                    Response.Write(Serializer.SerializeJson(list));
                }
                else if (action == "followalarm")
                {
                    Response.Write("[{\"id\":\"0\",\"name\":\"正常\"},{\"id\":\"1\",\"name\":\"正常(24小时内超时)\"},{\"id\":\"2\",\"name\":\"追踪超时\"}]");
                }
                else if (action == "arrive")
                {
                    Response.Write("[{\"id\":\"0\",\"name\":\"未到店\"},{\"id\":\"1\",\"name\":\"已到店\"}]");
                }
                else if (action == "state")
                {
                    string datalist = GetString("datalist");
                    if (datalist == "list")
                    {
                        Response.Write("[{\"id\":\"" + (int)CustomerStatus.导入_集客 + "\",\"name\":\"导入|集客\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.清洗_邀约 + "\",\"name\":\"清洗|邀约\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.到店_洽谈 + "\",\"name\":\"到店|洽谈\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.追踪_促成 + "\",\"name\":\"追踪|促成\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.预订_成交 + "\",\"name\":\"预订|成交\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.提车_回访 + "\",\"name\":\"提车|回访\"}"
                                       + "]");
                    }
                    else if (datalist == "potential")
                    {
                        Response.Write("[{\"id\":\"" + (int)CustomerStatus.潜客_转出 + "\",\"name\":\"转出\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.潜客_战败 + "\",\"name\":\"战败\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.其他潜客 + "\",\"name\":\"其他潜客\"}"
                                       + "]");
                    }
                    else
                    {
                        Response.Write("[{\"id\":\"" + (int)CustomerStatus.导入_集客 + "\",\"name\":\"导入|集客\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.清洗_邀约 + "\",\"name\":\"清洗|邀约\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.到店_洽谈 + "\",\"name\":\"到店|洽谈\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.追踪_促成 + "\",\"name\":\"追踪|促成\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.预订_成交 + "\",\"name\":\"预订|成交\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.提车_回访 + "\",\"name\":\"提车|回访\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.潜客_转出 + "\",\"name\":\"转出\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.潜客_战败 + "\",\"name\":\"战败\"}"
                                       + ",{\"id\":\"" + (int)CustomerStatus.其他潜客 + "\",\"name\":\"其他潜客\"}"
                                       + "]");
                    }
                }
                else if (action == "archivemove")
                {
                    Response.Write("[{\"id\":\"1\",\"name\":\"可主动转出\"},{\"id\":\"2\",\"name\":\"7日内系统将强制转出\"}]");
                }
            }
        }
Exemplo n.º 15
0
    protected void InitialControls()
    {
        SignetBaseInfoManager manager = new SignetBaseInfoManager();

        ddlType.DataSource = null;    // manager.GetCorporationClass();
        ddlType.DataBind();
        ddlCategory.DataSource = manager.GetGeneralCode("CT");
        ddlCategory.DataBind();
        ddlArea.DataSource = null;    // manager.GetAllAreas();
        ddlArea.DataBind();
        CorporationHelper corHelper = new CorporationHelper();


        if (string.IsNullOrEmpty(CorporationID) && EditType == "E")
        {
            ddlRegion.Enabled = true;
            ddlRegion.Visible = true;

            string[] regDeptId = SysContext.CurrentAreaIDs.Replace("'", "").Split(',');
            if (regDeptId.Count() <= 0)
            {
                DataTable dt = manager.GetAllRegisters();
                ddlRegion.Items.Add(new ListItem(dt.Rows[0]["rd_reg_dept_name"].ToString(), dt.Rows[0]["rd_reg_dept_Id"].ToString()));
            }
            else
            {
                foreach (string regId in regDeptId)
                {
                    DataTable dt = manager.GetReisterArea(regId);
                    ddlRegion.Items.Add(new ListItem(dt.Rows[0]["rd_reg_dept_name"].ToString(), regId));
                }
            }
            lblCorpId.Text    = corHelper.GetCorporationID(ddlRegion.SelectedValue);
            lblUserCode.Text  = corHelper.CreateUserCode(6);
            lblQueryCode.Text = corHelper.CreateVerifyCode(6);
        }
        else
        {
            CorporationInfo corInfo = new CorporationInfo(CorporationID);
            ViewState["CorpId"]       = CorporationID;
            ddlRegion.Enabled         = false;
            ddlRegion.Visible         = false;
            lblCorpId.Text            = corInfo.CorpID;
            txtCorpname.Text          = corInfo.CorpName;
            txtAliasName.Text         = corInfo.AliasName;
            txtEnglishName.Text       = corInfo.FullName;
            ddlType.SelectedIndex     = ddlType.Items.IndexOf(ddlType.Items.FindByText(corInfo.CorpClassName));
            ddlCategory.SelectedIndex = ddlCategory.Items.IndexOf(ddlCategory.Items.FindByText(corInfo.CorpTypeName));
            lblQueryCode.Text         = corInfo.OtherNo;
            lblUserCode.Text          = corInfo.PassWord;
            txtBoss.Text        = corInfo.BossName;
            txtIDCard.Text      = corInfo.BossIDCard;
            txtLinker.Text      = corInfo.Linker;
            txtOrgnization.Text = corInfo.AccountNo;
            txtLinkWay.Text     = corInfo.LinkWay;
            txtPostCode.Text    = corInfo.PostCode;
            txtMemo.Text        = corInfo.Memo;
            //txtBizNo.Text = corInfo.BizNo;
            ddlCerType.SelectedIndex = ddlCerType.Items.IndexOf(ddlCerType.Items.FindByValue(corInfo.BizNo));
            txtTaxNo.Text            = corInfo.TaxNo;
            txtAddress.Text          = corInfo.Address;
            ddlArea.SelectedIndex    = ddlArea.Items.IndexOf(ddlArea.Items.FindByText(corInfo.AreaName));

            if (EditType == "E")
            {
                btnSave.Visible = true;
            }
            else
            {
                btnSave.Visible = false;
            }
        }

        string isShowArea = ConfigurationManager.AppSettings["IsShowArea"];

        if (isShowArea.Equals("0"))
        {
            tdAreaTitle.Visible = false;
            ddlArea.Visible     = false;
        }
    }
Exemplo n.º 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int page   = GetInt("page", 1);
                int rows   = GetInt("rows", 100);
                int corpid = GetInt("corpid", 0);
                int corp   = GetInt("corp", 0);
                if (corp > 0)
                {
                    corpid = corp;
                }
                int    state      = GetInt("state", 0);
                int    issearch   = GetInt("issearch", 0);
                int    lurkstate  = GetInt("lurkstate", 0);
                int    checkstate = GetInt("checkstate", 0);
                string action     = GetString("action");
                string sort       = GetString("sort");
                string order      = GetString("order");

                string customername    = GetString("uname");
                string customerphone   = GetString("phone");
                string weixinaccount   = GetString("weixin");
                string ordernum        = GetString("ordernum");
                int    ibuyseriesid    = GetInt("series");
                int    customerlevelid = GetInt("customerlevel");
                int    infotypeid      = GetInt("infotype");
                int    infosourceid    = GetInt("infosource");
                int    connectwayid    = GetInt("connectway");
                int    giveupcauseid   = GetInt("giveupcause");
                int    paymentwayid    = GetInt("paymentway");
                int    ibuytime        = GetInt("ibuytime");
                int    tracktagid      = GetInt("tracktag");
                int    followalarm     = GetInt("followalarm");
                string isvisit         = GetString("arrive");
                int    sbuyseriesid    = GetInt("iseries");
                int    owneruid        = GetInt("owneruid");
                int    mpuid           = GetInt("mpuid");
                int    dccuid          = GetInt("dccuid");
                int    exuid           = GetInt("exuid");
                int    dsuid           = GetInt("dsuid");
                int    archivemove     = GetInt("archivemove");
                string sotime          = GetString("sotime");
                string starttime       = GetString("starttime");
                string endtime         = GetString("endtime");

                List <CustomerInfo> list;
                if (Corporation != null && Corporation.ID != corpid)
                {
                    list = new List <CustomerInfo>();
                }
                else
                {
                    list = Customers.Instance.GetCustomerListByCorporation(corpid, true);
                    if (issearch == 0)
                    {
                        list = list.FindAll(l => l.LurkStatus == lurkstate);
                        list = list.FindAll(l => l.CheckStatus == checkstate);
                    }
                    if (!Admin.Administrator && Admin.UserRole != UserRoleType.系统管理员 && lurkstate == 0 && checkstate == 0)
                    {
                        if (CurrentPowerGroup != null && !string.IsNullOrEmpty(CurrentPowerGroup.CanviewGroupIds))
                        {
                            string[] powers = CurrentPowerGroup.CanviewGroupIds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                            list = list.FindAll(l => l.OwnerID == AdminID || powers.Contains(l.OwnerPowerGroupID.ToString()));
                        }
                        else
                        {
                            list = list.FindAll(l => l.OwnerID == AdminID);
                        }
                    }
                    if (state > 0)
                    {
                        list = list.FindAll(l => l.CustomerStatus == state);
                    }
                    if (!string.IsNullOrEmpty(action))
                    {
                        if (action == "intent")
                        {
                            list = list.FindAll(l => l.CustomerStatusSource == (int)CustomerStatus.追踪_促成);
                        }
                        else if (action == "potential")
                        {
                            list = list.FindAll(l => l.CustomerStatusSource == (int)CustomerStatus.清洗_邀约 || l.CustomerStatusSource == (int)CustomerStatus.导入_集客);
                        }
                    }
                    if (!string.IsNullOrEmpty(customername))
                    {
                        list = list.FindAll(l => l.Name.Contains(customername));
                    }
                    if (!string.IsNullOrEmpty(customerphone))
                    {
                        list = list.FindAll(l => l.Phone.Contains(customerphone));
                    }
                    if (!string.IsNullOrEmpty(weixinaccount))
                    {
                        list = list.FindAll(l => l.WeixinAccount.Contains(weixinaccount));
                    }
                    if (!string.IsNullOrEmpty(ordernum))
                    {
                        list = list.FindAll(l => l.OrderNumber.Contains(ordernum));
                    }
                    if (ibuyseriesid > 0)
                    {
                        list = list.FindAll(l => l.IbuyCarSeriesID == ibuyseriesid);
                    }
                    if (customerlevelid > 0)
                    {
                        list = list.FindAll(l => l.LastCustomerLevelID == customerlevelid);
                    }
                    if (infotypeid > 0)
                    {
                        list = list.FindAll(l => l.InfoTypeID == infotypeid);
                    }
                    if (infosourceid > 0)
                    {
                        list = list.FindAll(l => l.InfoSourceID == infosourceid);
                    }
                    if (connectwayid > 0)
                    {
                        list = list.FindAll(l => l.LastConnectwayID == connectwayid);
                    }
                    if (giveupcauseid > 0)
                    {
                        list = list.FindAll(l => l.GiveupCauseID == giveupcauseid);
                    }
                    if (paymentwayid > 0)
                    {
                        list = list.FindAll(l => l.PaymentWayID == paymentwayid);
                    }
                    if (ibuytime > 0)
                    {
                        list = list.FindAll(l => l.IbuyTimeID == ibuytime);
                    }
                    if (tracktagid > 0)
                    {
                        list = list.FindAll(l => l.TracktagID.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Contains(tracktagid.ToString()));
                    }
                    if (followalarm > 0)
                    {
                        list = list.FindAll(l => l.ConnectAlarm == followalarm.ToString());
                    }
                    if (!string.IsNullOrEmpty(isvisit))
                    {
                        list = list.FindAll(l => l.IsVisit.ToString() == isvisit);
                    }
                    if (sbuyseriesid > 0)
                    {
                        list = list.FindAll(l => l.SbuyCarSeriesID == sbuyseriesid);
                    }
                    if (owneruid > 0)
                    {
                        list = list.FindAll(l => l.OwnerID == owneruid);
                    }
                    if (mpuid > 0)
                    {
                        list = list.FindAll(l => l.MarketDirectorID == mpuid);
                    }
                    if (dccuid > 0)
                    {
                        list = list.FindAll(l => l.DCCDirectorID == dccuid);
                    }
                    if (exuid > 0)
                    {
                        list = list.FindAll(l => l.ExhibitionDirectorID == exuid);
                    }
                    if (dsuid > 0)
                    {
                        list = list.FindAll(l => l.DirectorID == dsuid);
                    }
                    if (!string.IsNullOrEmpty(sotime))
                    {
                        Regex rtime          = new Regex(@"[- :]");
                        float starttimevalue = 0;
                        float endtimevalue   = 0;
                        if (!string.IsNullOrEmpty(starttime))
                        {
                            starttimevalue = DataConvert.SafeFloat(DataConvert.SafeDate(starttime).ToString("yyyyMMddHHmm"));
                        }
                        if (!string.IsNullOrEmpty(endtime))
                        {
                            endtimevalue = DataConvert.SafeFloat(DataConvert.SafeDate(endtime).AddDays(1).ToString("yyyyMMddHHmm"));
                        }
                        switch (sotime)
                        {
                        case "posttime":
                            if (starttimevalue > 0)
                            {
                                list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.PostTime, string.Empty)) >= starttimevalue);
                            }
                            if (endtimevalue > 0)
                            {
                                list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.PostTime, string.Empty)) <= endtimevalue);
                            }
                            break;

                        case "invitetime":
                            if (starttimevalue > 0)
                            {
                                list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.ReservationTime, string.Empty)) >= starttimevalue);
                            }
                            if (endtimevalue > 0)
                            {
                                list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.ReservationTime, string.Empty)) <= endtimevalue);
                            }
                            break;

                        case "dateline":
                            if (starttimevalue > 0)
                            {
                                list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.CreateTime, string.Empty)) >= starttimevalue);
                            }
                            if (endtimevalue > 0)
                            {
                                list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.CreateTime, string.Empty)) <= endtimevalue);
                            }
                            break;

                        case "arrivetime":
                            if (starttimevalue > 0)
                            {
                                list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.VisitTime, string.Empty)) >= starttimevalue);
                            }
                            if (endtimevalue > 0)
                            {
                                list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.VisitTime, string.Empty)) <= endtimevalue);
                            }
                            break;

                        case "endtime":
                            if (starttimevalue > 0)
                            {
                                list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.PlaceOrderTime, string.Empty)) >= starttimevalue);
                            }
                            if (endtimevalue > 0)
                            {
                                list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.PlaceOrderTime, string.Empty)) <= endtimevalue);
                            }
                            break;

                        case "delivertime":
                            if (starttimevalue > 0)
                            {
                                list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.PicupcarTime, string.Empty)) >= starttimevalue);
                            }
                            if (endtimevalue > 0)
                            {
                                list = list.FindAll(l => DataConvert.SafeFloat(rtime.Replace(l.PicupcarTime, string.Empty)) <= endtimevalue);
                            }
                            break;

                        default:
                            break;
                        }
                    }
                    if (archivemove > 0)
                    {
                        if (state > 0 && state != (int)CustomerStatus.导入_集客 && state != (int)CustomerStatus.清洗_邀约 && state != (int)CustomerStatus.追踪_促成)
                        {
                            list = new List <CustomerInfo>();
                        }
                        else
                        {
                            List <CustomerInfo> listresult  = new List <CustomerInfo>();
                            CorporationInfo     corporation = Corporations.Instance.GetModel(corpid, true);
                            if (corporation != null)
                            {
                                if (archivemove == 1)//主动转出
                                {
                                    if (corporation.Trackmove == 1)
                                    {
                                        listresult.AddRange(list.FindAll(l => l.CustomerStatus == (int)CustomerStatus.导入_集客));
                                    }
                                    if (corporation.Voluntaryoffday > 0)
                                    {
                                        listresult.AddRange(list.FindAll(l => l.CustomerStatus == (int)CustomerStatus.清洗_邀约 && DateTime.Today.Subtract(DataConvert.SafeDate(l.PostTime)).TotalDays >= (corporation.Voluntaryoffday - 1)));
                                    }
                                    if (corporation.Voluntaryoutday > 0)
                                    {
                                        listresult.AddRange(list.FindAll(l => l.CustomerStatus == (int)CustomerStatus.追踪_促成 && DateTime.Today.Subtract(DataConvert.SafeDate(l.PostTime)).TotalDays >= (corporation.Voluntaryoutday - 1)));
                                    }
                                }
                                else //7天内强制转出
                                {
                                    if (corporation.Forcedoffday > 0)
                                    {
                                        string[] offcustomerlevel = corporation.Offcustomerlevel.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                                        listresult.AddRange(list.FindAll(l => l.CustomerStatus == (int)CustomerStatus.清洗_邀约 && DateTime.Today.Subtract(DataConvert.SafeDate(l.PostTime)).TotalDays >= (corporation.Forcedoffday - 1) && !offcustomerlevel.Contains(l.LastCustomerLevelID.ToString())));
                                    }
                                    if (corporation.Forcedoutday > 0)
                                    {
                                        string[] forcedoutdaylevel = corporation.Forcedoutdaylevel.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                                        listresult.AddRange(list.FindAll(l => l.CustomerStatus == (int)CustomerStatus.追踪_促成 && DateTime.Today.Subtract(DataConvert.SafeDate(l.PostTime)).TotalDays >= (corporation.Forcedoutday - 1) && !forcedoutdaylevel.Contains(l.LastCustomerLevelID.ToString())));
                                    }
                                }
                            }
                            list = listresult;
                        }
                    }
                }

                if (!string.IsNullOrEmpty(sort) && !string.IsNullOrEmpty(order))
                {
                    switch (sort)
                    {
                    case "posttime":
                        list = order == "asc" ? list.OrderBy(l => l.PostTime).ToList() : list.OrderByDescending(l => l.PostTime).ToList();
                        break;

                    case "infotype":
                        list = order == "asc" ? list.OrderBy(l => l.InfoType).ToList() : list.OrderByDescending(l => l.InfoType).ToList();
                        break;

                    case "infosource":
                        list = order == "asc" ? list.OrderBy(l => l.InfoSource).ToList() : list.OrderByDescending(l => l.InfoSource).ToList();
                        break;

                    case "sex":
                        list = order == "asc" ? list.OrderBy(l => l.CustomerSex).ToList() : list.OrderByDescending(l => l.CustomerSex).ToList();
                        break;

                    case "phonevest":
                        list = order == "asc" ? list.OrderBy(l => l.PhoneVest).ToList() : list.OrderByDescending(l => l.PhoneVest).ToList();
                        break;

                    case "owner":
                        list = order == "asc" ? list.OrderBy(l => l.Owner).ToList() : list.OrderByDescending(l => l.Owner).ToList();
                        break;

                    case "ibuycarbrand":
                        list = order == "asc" ? list.OrderBy(l => l.IbuyCarBrand).ToList() : list.OrderByDescending(l => l.IbuyCarBrand).ToList();
                        break;

                    case "ibuycarmodel":
                        list = order == "asc" ? list.OrderBy(l => l.IbuyCarModel).ToList() : list.OrderByDescending(l => l.IbuyCarModel).ToList();
                        break;

                    case "ibuytime":
                        list = order == "asc" ? list.OrderBy(l => l.IbuyTime).ToList() : list.OrderByDescending(l => l.IbuyTime).ToList();
                        break;

                    case "lastcustomerlevel":
                        list = order == "asc" ? list.OrderBy(l => l.LastCustomerLevel).ToList() : list.OrderByDescending(l => l.LastCustomerLevel).ToList();
                        break;

                    case "connectalarm":
                        list = order == "asc" ? list.OrderBy(l => l.ConnectAlarm).ToList() : list.OrderByDescending(l => l.ConnectAlarm).ToList();
                        break;

                    case "lastconnecttime":
                        list = order == "asc" ? list.OrderBy(l => l.LastConnectTime).ToList() : list.OrderByDescending(l => l.LastConnectTime).ToList();
                        break;

                    case "reservationtime":
                        list = order == "asc" ? list.OrderBy(l => l.ReservationTime).ToList() : list.OrderByDescending(l => l.ReservationTime).ToList();
                        break;

                    case "visittime":
                        list = order == "asc" ? list.OrderBy(l => l.VisitTime).ToList() : list.OrderByDescending(l => l.VisitTime).ToList();
                        break;

                    case "leavetime":
                        list = order == "asc" ? list.OrderBy(l => l.LeaveTime).ToList() : list.OrderByDescending(l => l.LeaveTime).ToList();
                        break;

                    case "isvisit":
                        list = order == "asc" ? list.OrderBy(l => l.IsVisit).ToList() : list.OrderByDescending(l => l.IsVisit).ToList();
                        break;

                    case "province":
                        list = order == "asc" ? list.OrderBy(l => l.Province).ToList() : list.OrderByDescending(l => l.Province).ToList();
                        break;

                    case "city":
                        list = order == "asc" ? list.OrderBy(l => l.City).ToList() : list.OrderByDescending(l => l.City).ToList();
                        break;

                    case "district":
                        list = order == "asc" ? list.OrderBy(l => l.District).ToList() : list.OrderByDescending(l => l.District).ToList();
                        break;

                    case "ordernumber":
                        list = order == "asc" ? list.OrderBy(l => l.OrderNumber).ToList() : list.OrderByDescending(l => l.OrderNumber).ToList();
                        break;

                    case "knockdownprice":
                        list = order == "asc" ? list.OrderBy(l => l.KnockdownPrice).ToList() : list.OrderByDescending(l => l.KnockdownPrice).ToList();
                        break;

                    case "placeordertime":
                        list = order == "asc" ? list.OrderBy(l => l.PlaceOrderTime).ToList() : list.OrderByDescending(l => l.PlaceOrderTime).ToList();
                        break;

                    case "createtime":
                        list = order == "asc" ? list.OrderBy(l => l.CreateTime).ToList() : list.OrderByDescending(l => l.CreateTime).ToList();
                        break;

                    case "showno":
                        list = order == "asc" ? list.OrderBy(l => l.ShowNo).ToList() : list.OrderByDescending(l => l.ShowNo).ToList();
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    list = list.OrderByDescending(l => l.PostTime).ToList();
                }

                int total   = list.Count;
                int maxpage = list.Count / rows + (list.Count % rows == 0 ? 0 : 1);

                list = list.Skip((page - 1) * rows).Take(rows).ToList <CustomerInfo>();

                Response.Write("{\"count\":" + list.Count + ",\"total\":" + total + ",\"maxpage\":" + maxpage + ",\"rows\":" + Serializer.SerializeJson(list) + "}");
            }
        }