Ejemplo n.º 1
0
        public static string ServBusEditSave(List <string> arr)
        {
            string ret = "";

            if (Com.Session.userid == null)
            {
                ret = "expire";
            }
            else
            {
                SchSystem.BLL.ServBusThd   servbusbll   = new SchSystem.BLL.ServBusThd();
                SchSystem.Model.ServBusThd servbusmodel = new SchSystem.Model.ServBusThd();
                foreach (string str in arr)
                {
                    string[] strarr = str.Split('#');
                    if (strarr[0] == "BusId")
                    {
                        servbusmodel.BusId = Convert.ToInt32(strarr[1]);
                    }
                    if (strarr[0] == "ThdName")
                    {
                        servbusmodel.ThdName = strarr[1];
                    }
                    if (strarr[0] == "ServiceId")
                    {
                        servbusmodel.ServiceId = strarr[1];
                    }
                    if (strarr[0] == "CnName")
                    {
                        servbusmodel.CnName = strarr[1];
                    }
                    if (strarr[0] == "FeeCode")
                    {
                        servbusmodel.FeeCode = strarr[1];
                    }
                    if (strarr[0] == "BusMonth")
                    {
                        servbusmodel.BusMonth = Convert.ToInt32(strarr[1]);
                    }
                    if (strarr[0] == "BusNote")
                    {
                        servbusmodel.BusNote = strarr[1];
                    }
                    if (strarr[0] == "BusArea")
                    {
                        servbusmodel.BusArea = strarr[1];
                    }
                    if (strarr[0] == "BusUtype")
                    {
                        servbusmodel.BusUtype = Convert.ToInt32(strarr[1]);
                    }
                    if (strarr[0] == "Mbusid")
                    {
                        servbusmodel.Mbusid = Convert.ToInt32(strarr[1]);
                    }
                    if (strarr[0] == "ThdMonth")
                    {
                        servbusmodel.ThdMonth = Convert.ToInt32(strarr[1]);
                    }
                    if (strarr[0] == "Note")
                    {
                        servbusmodel.Note = strarr[1];
                    }
                }
                try
                {
                    if (servbusbll.Update(servbusmodel))
                    {
                        ret = "success";
                    }
                }
                catch (Exception ex)
                {
                    ret = ex.Message;
                }
            }
            return(ret);
        }
Ejemplo n.º 2
0
 public static Com.DataPack.DataRsp <string> ServBusEditSave(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 currentCnName = ""; string currentCode = "";
         try
         {
             SchSystem.BLL.ServBusThd   servbusbll   = new SchSystem.BLL.ServBusThd();
             SchSystem.Model.ServBusThd servbusmodel = new SchSystem.Model.ServBusThd();
             foreach (string str in arr)
             {
                 string[] strarr = str.Split('#');
                 if (strarr[0] == "BusId")
                 {
                     servbusmodel.BusId = Convert.ToInt32(strarr[1]);
                 }
                 else if (strarr[0] == "ThdName")
                 {
                     servbusmodel.ThdName = strarr[1].Trim();
                 }
                 else if (strarr[0] == "ServiceId")
                 {
                     servbusmodel.ServiceId = strarr[1].Trim();
                 }
                 else if (strarr[0] == "CnName")
                 {
                     servbusmodel.CnName = strarr[1].Trim();
                 }
                 else if (strarr[0] == "FeeCode")
                 {
                     servbusmodel.FeeCode = strarr[1].Trim();
                 }
                 else if (strarr[0] == "BusMonth")
                 {
                     servbusmodel.BusMonth = Convert.ToInt32(strarr[1]);
                 }
                 else if (strarr[0] == "BusNote")
                 {
                     servbusmodel.BusNote = strarr[1].Trim();
                 }
                 else if (strarr[0] == "BusArea")
                 {
                     servbusmodel.BusArea = strarr[1].Trim();
                 }
                 else if (strarr[0] == "BusUtype")
                 {
                     servbusmodel.BusUtype = Convert.ToInt32(strarr[1]);
                 }
                 else if (strarr[0] == "Mbusid")
                 {
                     servbusmodel.Mbusid = Convert.ToInt32(strarr[1]);
                 }
                 else if (strarr[0] == "ThdMonth")
                 {
                     servbusmodel.ThdMonth = Convert.ToInt32(strarr[1]);
                 }
                 else if (strarr[0] == "Note")
                 {
                     servbusmodel.Note = strarr[1].Trim();
                 }
                 else if (strarr[0] == "currentCnName")
                 {
                     currentCnName = strarr[1].Trim();
                 }
                 else if (strarr[0] == "currentCode")
                 {
                     currentCode = strarr[1].Trim();
                 }
             }
             DataTable cnnamedt = servbusbll.ExistsCnNameUpdate(servbusmodel.CnName, 0, currentCnName).Tables[0];
             DataTable codedt   = servbusbll.ExistsCodeUpdate(servbusmodel.ServiceId, 0, currentCode).Tables[0];
             if (servbusmodel.ThdName == "" || servbusmodel.CnName == "")
             {
                 rsp.code = "error";
                 rsp.msg  = "操作失败!不允许输入空格";
             }
             else if (cnnamedt.Rows.Count > 0)
             {
                 rsp.code = "nameRepeat";
                 rsp.msg  = "套餐名称不允许重复";
             }
             else if (codedt.Rows.Count > 0)
             {
                 rsp.code = "codeRepeat";
                 rsp.msg  = "套餐代码不允许重复";
             }
             else
             {
                 if (servbusbll.Update(servbusmodel))
                 {
                     rsp.code = "success";
                     rsp.msg  = "操作成功";
                 }
                 else
                 {
                     rsp.code = "error";
                     rsp.msg  = "操作失败";
                 }
             }
         }
         catch (Exception ex)
         {
             rsp.code = "excepError";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }