public static Com.DataPack.DataRsp <string> UserOrderSave(List <string> arr)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "你现在登录已过期,请重新登录!";
     }
     else
     {
         try
         {
             SchSystem.BLL.ServUserFor   ssBll   = new SchSystem.BLL.ServUserFor();
             SchSystem.Model.ServUserFor ssModel = new SchSystem.Model.ServUserFor();
             ssModel.FromType = "客服修改";
             foreach (string str in arr)
             {
                 string[] strarr = str.Split('#');
                 if (strarr[0] == "autoid")
                 {
                     ssModel.AutoId = int.Parse(strarr[1]);
                 }
                 if (strarr[0] == "Stat")
                 {
                     ssModel.ServStat = int.Parse(strarr[1]);
                 }
                 if (strarr[0] == "Note")
                 {
                     ssModel.DoNote = strarr[1];
                 }
             }
             //bool resbool = ssBll.Exists(ssModel.SysCode);
             //if (!resbool)
             //{
             bool result = ssBll.Update(ssModel);
             if (result)
             {
                 rsp.code = "success";
                 rsp.msg  = "操作成功";
             }
             else
             {
                 rsp.code = "error";
                 rsp.msg  = "操作失败";
             }
             //}
             //else
             //{
             //    rsp.code = "PlatCodeRepeat";
             //    rsp.msg = "平台代码不允许重复";
             //}
         }
         catch (Exception ex)
         {
             rsp.code = "ExcepError";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
 public static Com.DataPack.DataRsp <string> UserOrderRenSave(List <string> arr)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "你现在登录已过期,请重新登录!";
     }
     else
     {
         SchSystem.BLL.ServUserFor sufBll = new SchSystem.BLL.ServUserFor();
         string autoid = "";
         string servm  = "";
         string feem   = "";
         string donote = "";
         foreach (string str in arr)
         {
             string[] strarr = str.Split('#');
             if (strarr[0] == "autoid")
             {
                 autoid = strarr[1];
             }
             else if (strarr[0] == "ordertimelen")
             {
                 servm = strarr[1];
             }
             else if (strarr[0] == "payamountren")
             {
                 feem = strarr[1];
             }
             else if (strarr[0] == "note")
             {
                 donote = strarr[1];
             }
         }
         SchSystem.Model.ServUserFor sufModel = sufBll.GetModel(int.Parse(autoid));
         try
         {
             int result = sufBll.ProcAdd(sufModel.UserName, Com.Session.userid, "客服续订", sufModel.ServiceId, int.Parse(servm), int.Parse(feem), donote);
             //bool result = sufBll.UpdateRenewals(sufModel);
             if (result > 0)
             {
                 rsp.code = "success";
                 rsp.msg  = "操作成功";
             }
             else
             {
                 rsp.code = "error";
                 rsp.msg  = "操作失败";
             }
         }
         catch (Exception ex)
         {
             rsp.code = "excepError";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //獲取GET參數
            dotype = Request.Params["dotype"].ToString();
            string AutoId = Request.Params["id"].ToString();

            //獲取登錄者的真實姓名
            uname = Com.Session.uname;
            #region 查詢當前AutoId的數據記錄
            SchSystem.BLL.ServUserFor    sufBll    = new SchSystem.BLL.ServUserFor();
            SchSystem.Model.ServUserForV sufvModel = new SchSystem.Model.ServUserForV();
            string ServiceId = "";
            if (!string.IsNullOrEmpty(AutoId) && !string.IsNullOrEmpty(dotype))
            {
                sufvModel        = sufBll.GetModelV("AutoId,UserName,UTname,CnName,FromType,RecUser,ServiceId,ServStat,ServMonth,FeeM,RecTime,EndTime,EditTime,DoNote,Uareano,BusMonth,FeeCode", int.Parse(AutoId));
                ServiceId        = sufvModel.ServiceId;
                servUserForModel = Newtonsoft.Json.JsonConvert.SerializeObject(sufvModel);
            }
            #endregion
            #region 獲取資費套餐下拉列表
            SchSystem.BLL.ServBus sbBll     = new SchSystem.BLL.ServBus();
            DataTable             servbusdt = sbBll.GetList("'0' pId,ServiceId id,FeeCode,CnName name,'false' checked,BusMonth,'true' chkDisabled", "").Tables[0];
            if (servbusdt.Rows.Count > 0)
            {
                for (int i = 0; i < servbusdt.Rows.Count; i++)
                {
                    if (servbusdt.Rows[i]["id"].ToString() == ServiceId)
                    {
                        servbusdt.Rows[i]["checked"] = true;
                    }
                }
            }
            servbustree = Newtonsoft.Json.JsonConvert.SerializeObject(servbusdt);
            #endregion

            #region 獲取省市區
            //获取省份
            StringBuilder areaProvince = new StringBuilder();
            string        sareacode    = "";
            areaProvince.Append(Com.Public.GetDrpArea("0", "", ref sareacode, false, "0"));
            province = areaProvince.ToString();
            //获取城市
            StringBuilder areaCity      = new StringBuilder();
            string        sareacitycode = "";
            areaCity.Append(Com.Public.GetDrpArea("1", sareacode, ref sareacitycode, false, "0"));
            city = areaCity.ToString();
            #endregion
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //獲取GET參數
            dotype = Request.Params["dotype"].ToString();
            string AutoId = Request.Params["id"].ToString();

            //獲取登錄者的真實姓名
            uname = Com.Session.uname;
            #region 查詢當前AutoId的數據記錄
            SchSystem.BLL.ServUserFor    sufBll    = new SchSystem.BLL.ServUserFor();
            SchSystem.Model.ServUserForV sufvModel = new SchSystem.Model.ServUserForV();
            string ServiceId = "";
            if (!string.IsNullOrEmpty(AutoId) && !string.IsNullOrEmpty(dotype))
            {
                sufvModel        = sufBll.GetModelV("AutoId,UserName,UTname,FromType,CnName,RecUser,ServiceId,ServStat,ServMonth,FeeM,RecTime,EndTime,EditTime,DoNote,Uareano,BusMonth,FeeCode", int.Parse(AutoId));
                ServiceId        = sufvModel.ServiceId;
                servUserForModel = Newtonsoft.Json.JsonConvert.SerializeObject(sufvModel);
            }
            #endregion
        }
        public static Com.DataPack.DataRsp <string> page(List <string> arr)
        {
            //变量声明区域
            Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
            if (Com.Session.userid == null)
            {
                rsp.code = "expire";
                rsp.msg  = "你现在登录已过期,请重新登录!";
            }
            else
            {
                string PageIndex = ""; string PageSize = "";
                string txtAccount = "", txtUserTname = "", txtProvince = "", txtCity = "", txtUserType = "", txtAdditional = "", txtPackage = "", txtStat = "";
                string txtSource = "", txtStartTime01 = "", txtStartTime02 = "", txtEndTime01 = "", txtEndTime02 = "";
                //分解前台传递过来的参数并给变量赋值
                foreach (string str in arr)
                {
                    string[] strarr = str.Split('#');
                    if (strarr[0] == "PageIndex")
                    {
                        PageIndex = strarr[1];
                    }
                    else if (strarr[0] == "PageSize")
                    {
                        PageSize = strarr[1];
                    }
                    else if (strarr[0] == "txtAccount")
                    {
                        txtAccount = strarr[1];
                    }
                    else if (strarr[0] == "txtUserTname")
                    {
                        txtUserTname = strarr[1];
                    }
                    else if (strarr[0] == "txtProvince")
                    {
                        txtProvince = strarr[1];
                    }
                    else if (strarr[0] == "txtCity")
                    {
                        txtCity = strarr[1];
                    }
                    else if (strarr[0] == "txtUserType")
                    {
                        txtUserType = strarr[1];
                    }
                    else if (strarr[0] == "txtAdditional")
                    {
                        txtAdditional = strarr[1];
                    }
                    else if (strarr[0] == "txtPackage")
                    {
                        txtPackage = strarr[1];
                    }
                    else if (strarr[0] == "txtStat")
                    {
                        txtStat = strarr[1];
                    }
                    else if (strarr[0] == "txtStartTime01")
                    {
                        txtStartTime01 = strarr[1];
                    }
                    else if (strarr[0] == "txtStartTime02")
                    {
                        txtStartTime02 = strarr[1];
                    }
                    else if (strarr[0] == "txtEndTime01")
                    {
                        txtEndTime01 = strarr[1];
                    }
                    else if (strarr[0] == "txtEndTime02")
                    {
                        txtEndTime02 = strarr[1];
                    }
                    else if (strarr[0] == "txtSource")
                    {
                        txtSource = strarr[1];
                    }
                }
                //实例化对象
                SchSystem.BLL.ServUserFor sufBll = new SchSystem.BLL.ServUserFor();
                //声明SQL拼接变量
                StringBuilder strwhere           = new StringBuilder();
                //条件SQL拼接
                strwhere.Append("1=1");
                if (!string.IsNullOrEmpty(txtAccount))
                {
                    strwhere.Append(" and UserName='******'");
                }
                if (!string.IsNullOrEmpty(txtUserTname))
                {
                    strwhere.Append(" and UTname='" + txtUserTname + "'");
                }
                if (!string.IsNullOrEmpty(txtProvince))
                {
                    strwhere.Append(" and left(Uareano,2)='" + Com.Public.SqlEncStr(txtProvince.Substring(0, 2)) + "'");
                }
                if (!string.IsNullOrEmpty(txtCity))
                {
                    strwhere.Append(" and left(Uareano,4)='" + Com.Public.SqlEncStr(txtCity.Substring(0, 4)) + "'");
                }
                if (!string.IsNullOrEmpty(txtStat))
                {
                    strwhere.Append(" and ServStat='" + txtStat + "'");
                }
                if (!string.IsNullOrEmpty(txtStartTime01) && !string.IsNullOrEmpty(txtStartTime02))
                {
                    strwhere.Append(" and RecTime between '" + DateTime.Parse(txtStartTime01) + "' and '" + DateTime.Parse(txtStartTime02) + "'");
                }
                if (!string.IsNullOrEmpty(txtSource))
                {
                    strwhere.Append(" and FromType='" + txtSource + "'");
                }
                if (!string.IsNullOrEmpty(txtEndTime01) && !string.IsNullOrEmpty(txtEndTime02))
                {
                    strwhere.Append(" and EndTime between '" + DateTime.Parse(txtEndTime01) + "' and '" + DateTime.Parse(txtEndTime02) + "'");
                }
                if (!string.IsNullOrEmpty(txtPackage))
                {
                    strwhere.Append(" and ServiceId='" + txtPackage + "'");
                }

                Com.Public.PageModelResp pages = new Com.Public.PageModelResp();
                pages.PageIndex = int.Parse(PageIndex);
                pages.PageSize  = int.Parse(PageSize);
                int rowc = 0;
                int pc   = 0;
                try
                {
                    string    dbcols = "AutoId,UserName,UTname,Uareano,FromType,RecUser,CnName,FeeM,ServMonth,RecTime,EndTime,EditTime,ServStat,DoNote";
                    DataTable dt     = sufBll.GetListColsV(dbcols, strwhere.ToString(), "AutoId", "DESC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        dt.Columns.Add("Province");
                        dt.Columns.Add("City");
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            if (dt.Rows[i]["Uareano"].ToString() != "")
                            {
                                dt.Rows[i]["Province"] = Com.Public.GetSSQ("0", dt.Rows[i]["Uareano"].ToString());
                                dt.Rows[i]["City"]     = Com.Public.GetSSQ("1", dt.Rows[i]["Uareano"].ToString());
                            }
                            else
                            {
                                dt.Rows[i]["Province"] = "";
                                dt.Rows[i]["City"]     = "";
                            }
                        }
                    }
                    pages.PageCount = pc;
                    pages.RowCount  = rowc;
                    if (dt.Rows.Count > 0)
                    {
                        pages.list = dt;
                    }
                    rsp.RspData = Newtonsoft.Json.JsonConvert.SerializeObject(pages);
                }
                catch (Exception ex)
                {
                    rsp.code = "excepError";
                    rsp.msg  = ex.Message;
                }
            }
            return(rsp);
        }
        public static string page(List <string> arr)
        {
            //变量声明区域
            string ret = "";

            if (Com.Session.userid == null)
            {
                ret = "expire";
            }
            else
            {
                string PageIndex = ""; string PageSize = "";
                string txtAccount = "", txtUserTname = "", txtProvince = "", txtCity = "", txtUserType = "", txtAdditional = "", txtPackage = "", txtStat = "";
                string txtSource = "", txtStartTime01 = "", txtStartTime02 = "", txtEndTime01 = "", txtEndTime02 = "", ordercols = "AutoId", orderby = "ASC";

                //分解前台传递过来的参数并给变量赋值
                foreach (string str in arr)
                {
                    string[] strarr = str.Split('#');
                    if (strarr[0] == "PageIndex")
                    {
                        PageIndex = strarr[1];
                    }
                    else if (strarr[0] == "PageSize")
                    {
                        PageSize = strarr[1];
                    }
                    else if (strarr[0] == "txtAccount")
                    {
                        txtAccount = strarr[1];
                    }
                    else if (strarr[0] == "txtUserTname")
                    {
                        txtUserTname = strarr[1];
                    }
                    else if (strarr[0] == "txtProvince")
                    {
                        txtProvince = strarr[1];
                    }
                    else if (strarr[0] == "txtCity")
                    {
                        txtCity = strarr[1];
                    }
                    else if (strarr[0] == "txtUserType")
                    {
                        txtUserType = strarr[1];
                    }
                    else if (strarr[0] == "txtAdditional")
                    {
                        txtAdditional = strarr[1];
                    }
                    else if (strarr[0] == "txtPackage")
                    {
                        txtPackage = strarr[1];
                    }
                    else if (strarr[0] == "txtStat")
                    {
                        txtStat = strarr[1];
                    }
                    else if (strarr[0] == "txtStartTime01")
                    {
                        txtStartTime01 = strarr[1];
                    }
                    else if (strarr[0] == "txtStartTime02")
                    {
                        txtStartTime02 = strarr[1];
                    }
                    else if (strarr[0] == "txtEndTime01")
                    {
                        txtEndTime01 = strarr[1];
                    }
                    else if (strarr[0] == "txtEndTime02")
                    {
                        txtEndTime02 = strarr[1];
                    }
                    else if (strarr[0] == "txtSource")
                    {
                        txtSource = strarr[1];
                    }
                    else if (strarr[0] == "ordercols")
                    {
                        ordercols = strarr[1];
                    }
                    else if (strarr[0] == "orderby")
                    {
                        orderby = strarr[1];
                    }
                }
                if (ordercols == "")
                {
                    ordercols = "AutoId";
                }
                if (orderby == "")
                {
                    orderby = "asc";
                }
                //实例化对象
                SchSystem.BLL.ServUserFor sufBll = new SchSystem.BLL.ServUserFor();
                //声明SQL拼接变量
                StringBuilder strwhere           = new StringBuilder();
                //条件SQL拼接
                strwhere.Append("1=1");
                if (!string.IsNullOrEmpty(txtAccount))
                {
                    strwhere.Append(" and UserName='******'");
                }
                if (!string.IsNullOrEmpty(txtUserTname))
                {
                    strwhere.Append(" and UTname='" + txtUserTname + "'");
                }
                if (!string.IsNullOrEmpty(txtProvince))
                {
                    strwhere.Append(" and left(Uareano,2)='" + Com.Public.SqlEncStr(txtProvince.Substring(0, 2)) + "'");
                }
                if (!string.IsNullOrEmpty(txtCity))
                {
                    strwhere.Append(" and left(Uareano,4)='" + Com.Public.SqlEncStr(txtCity.Substring(0, 4)) + "'");
                }
                if (!string.IsNullOrEmpty(txtStat))
                {
                    strwhere.Append(" and ServStat='" + txtStat + "'");
                }
                if (!string.IsNullOrEmpty(txtStartTime01) && !string.IsNullOrEmpty(txtStartTime02))
                {
                    strwhere.Append(" and RecTime between '" + DateTime.Parse(txtStartTime01) + "' and '" + DateTime.Parse(txtStartTime02) + "'");
                }
                if (!string.IsNullOrEmpty(txtSource))
                {
                    strwhere.Append(" and FromType='" + txtSource + "'");
                }
                if (!string.IsNullOrEmpty(txtEndTime01) && !string.IsNullOrEmpty(txtEndTime02))
                {
                    strwhere.Append(" and EndTime between '" + DateTime.Parse(txtEndTime01) + "' and '" + DateTime.Parse(txtEndTime02) + "'");
                }
                if (!string.IsNullOrEmpty(txtPackage))
                {
                    strwhere.Append(" and ServiceId='" + txtPackage + "'");
                }

                int       rowc    = 0;
                int       pc      = 0;
                string    errcode = "";
                DataTable dt      = new DataTable();
                try
                {
                    string dbcols = "AutoId,UserName,UTname,Uareano,FromType,RecUser,CnName,FeeM,ServMonth,RecTime,EndTime,EditTime,ServStat,DoNote";
                    dt = sufBll.GetListColsV(dbcols, strwhere.ToString(), ordercols, orderby, int.Parse(PageIndex), int.Parse(PageSize), ref rowc, ref pc).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        dt.Columns.Add("Province");
                        dt.Columns.Add("City");
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            if (dt.Rows[i]["Uareano"].ToString() != "")
                            {
                                dt.Rows[i]["Province"] = Com.Public.GetSSQ("0", dt.Rows[i]["Uareano"].ToString());
                                dt.Rows[i]["City"]     = Com.Public.GetSSQ("1", dt.Rows[i]["Uareano"].ToString());
                            }
                            else
                            {
                                dt.Rows[i]["Province"] = "";
                                dt.Rows[i]["City"]     = "";
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    errcode = ex.Message;
                }
                data dtobj = new data();
                dtobj.total   = rowc;
                dtobj.rows    = dt;
                dtobj.errcode = errcode;
                ret           = Newtonsoft.Json.JsonConvert.SerializeObject(dtobj);
            }
            return(ret);
        }
 public static Com.DataPack.DataRsp <string> UserOrderAddSave(List <string> arr)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "你现在登录已过期,请重新登录!";
     }
     else
     {
         string orderpackagestr = "";
         try
         {
             SchSystem.BLL.ServUserFor   sufBll   = new SchSystem.BLL.ServUserFor();
             SchSystem.Model.ServUserFor sufModel = new SchSystem.Model.ServUserFor();
             foreach (string str in arr)
             {
                 string[] strarr = str.Split('#');
                 if (strarr[0] == "account")
                 {
                     sufModel.UserName = strarr[1];
                 }
                 else if (strarr[0] == "additional")
                 {
                     sufModel.RecUser = strarr[1];
                 }
                 else if (strarr[0] == "usersource")
                 {
                     sufModel.FromType = strarr[1];
                 }
                 else if (strarr[0] == "tagsorderpackage")
                 {
                     sufModel.ServiceId = strarr[1];
                 }
                 else if (strarr[0] == "orderlength")
                 {
                     sufModel.ServMonth = int.Parse(strarr[1]);
                 }
                 else if (strarr[0] == "payamount")
                 {
                     sufModel.FeeM = int.Parse(strarr[1]);
                 }
                 else if (strarr[0] == "note")
                 {
                     sufModel.DoNote = strarr[1];
                 }
                 else if (strarr[0] == "orderpackagestr")
                 {
                     orderpackagestr = strarr[1];
                 }
             }
             bool Exists = sufBll.Exists(sufModel.UserName, sufModel.ServiceId);
             if (Exists)
             {
                 rsp.code = "success";
                 rsp.msg  = "该套餐已存在,请到续费处续费";
             }
             else
             {
                 int result = sufBll.ProcAdd(sufModel.UserName, sufModel.RecUser, sufModel.FromType, sufModel.ServiceId, sufModel.ServMonth, sufModel.FeeM, sufModel.DoNote);
                 if (result > 0)
                 {
                     SchSystem.BLL.ServUserForExt   sufeBll   = new SchSystem.BLL.ServUserForExt();
                     SchSystem.Model.ServUserForExt sufeModel = new SchSystem.Model.ServUserForExt();
                     if (!string.IsNullOrEmpty(orderpackagestr))
                     {
                         string[] orderpackagearr    = orderpackagestr.Split('$');
                         int      orderpackagearrLen = orderpackagearr.Length;
                         for (int i = 0; i < orderpackagearrLen; i++)//遍歷實體(記錄)
                         {
                             string[] ordpackarr    = orderpackagearr[i].Split('|');
                             int      ordpackarrlen = ordpackarr.Length;
                             sufeModel.UserForId = result;        //遍歷屬性(字段):對應的訂購ID
                             sufeModel.Fcode     = ordpackarr[0]; //遍歷屬性(字段):功能碼
                             sufeModel.NapeCode  = ordpackarr[1]; //遍歷屬性(字段):下拉列表代碼
                             sufeModel.NapeCodes = ordpackarr[2]; //遍歷屬性(字段):對應的下拉列表代碼串
                             if ((sufeModel.NapeCodes).ToString() != "null")
                             {
                                 sufeBll.Add(sufeModel);
                             }
                         }
                     }
                     rsp.code = "success";
                     rsp.msg  = "添加成功";
                 }
                 else
                 {
                     rsp.code = "error";
                     rsp.msg  = "操作失败";
                 }
             }
         }
         catch (Exception ex)
         {
             rsp.code = "excepError";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }