コード例 #1
0
 public static Com.DataPack.DataRsp <string> schsubsave(string arr)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
     else
     {
         string[] datas = arr.Split('#');
         if (datas[0] == "")
         {
             rsp.code = "tips";
             rsp.msg  = "没有相关学校数据";
         }
         else
         {
             try
             {
                 SchSystem.BLL.SchAppRoleSoure   srsBll   = new SchSystem.BLL.SchAppRoleSoure();
                 SchSystem.Model.SchAppRoleSoure srsModel = new SchSystem.Model.SchAppRoleSoure();
                 srsModel.SchId   = int.Parse(datas[0]);
                 srsModel.AppCode = datas[1];
                 if (srsBll.SchAppExists(int.Parse(datas[0])))
                 {
                     srsModel.LastRecTime = DateTime.Now;
                     srsModel.LastRecUser = Com.Session.uname;
                     srsBll.Update(srsModel);
                 }
                 else
                 {
                     srsModel.RecTime = DateTime.Now;
                     srsModel.RecUser = Com.Session.uname;
                     srsBll.Add(srsModel);
                 }
                 rsp.code = "success";
                 rsp.msg  = "修改成功!";
             }
             catch (Exception ex)
             {
                 rsp.code = "error";
                 rsp.msg  = ex.Message;
             }
         }
     }
     return(rsp);
 }
コード例 #2
0
 /// <summary>
 /// 资源模块
 /// </summary>
 /// <param name="resourcemodules"></param>
 /// <param name="schid"></param>
 public static void ResourcesModel(string resourcemodules, int schid)
 {
     if (resourcemodules != "")
     {
         SchSystem.BLL.SchAppRoleSoure   srsBll   = new SchSystem.BLL.SchAppRoleSoure();
         SchSystem.Model.SchAppRoleSoure srsModel = new SchSystem.Model.SchAppRoleSoure();
         srsModel.SchId   = schid;
         srsModel.AppCode = resourcemodules;
         if (srsBll.SchAppExists(schid))
         {
             srsModel.LastRecTime = DateTime.Now;
             srsModel.LastRecUser = Com.Session.userid;
             srsBll.Update(srsModel);
         }
         else
         {
             srsModel.RecTime = DateTime.Now;
             srsModel.RecUser = Com.Session.userid;
             srsBll.Add(srsModel);
         }
     }
 }