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);
 }
 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);
 }