예제 #1
0
 public static Com.DataPack.DataRsp <string> isalone(string id, string isalone)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
     else
     {
         try
         {
             if (!Com.Public.isVa(id, ""))
             {
                 rsp.code = "error";
                 rsp.msg  = "无跨界权限";
             }
             else if (id == Com.Public.getKey("adminschid"))
             {
                 rsp.code = "error";
                 rsp.msg  = "此为系统学校,不允许操作";
             }
             else
             {
                 SchSystem.BLL.SchInfo   bll   = new SchSystem.BLL.SchInfo();
                 SchSystem.Model.SchInfo model = new SchSystem.Model.SchInfo();
                 model.SchId = int.Parse(id);
                 if (isalone == "&times;")//如果传值为×时,则需要修改为单独部署
                 {
                     model.IsAlone = 1;
                 }
                 else//如果传值为√时,则需要取消单独部署
                 {
                     model.IsAlone = 0;
                 }
                 model.AloneTime = DateTime.Now;
                 model.AloneUser = Com.Session.userid;
                 if (bll.UpdateAlone(model))
                 {
                     rsp.code = "success";
                     rsp.msg  = "操作成功";
                 }
                 else
                 {
                     rsp.code = "error";
                     rsp.msg  = "操作失败";
                 }
             }
         }
         catch (Exception ex)
         {
             rsp.code = "error";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }