public ActionResult Details(string msg)
 {
     bool isHasNoActive
         = Request.Cookies[GLB.userId] != null && Convert.ToInt32(Request.Cookies[GLB.depId].Value) == GLB.adminDepId ? true : false;
     ResponseStatus resp = activityService.GetActivities(conta_Activity,isHasNoActive);
     Container_Authority_Msg auth = new Container_Authority_Msg();
     ResponseStatus resp1 = ServiceBuilder.BuildAuthService().GetSecondAuth(Request.Cookies, auth);
     if (resp1 == ResponseStatus.FAILED) resp = resp1;
     //if (Request.Cookies[GLB.userId] != null) Response.
     return this.JudgeResult(resp, () =>
         {
             conta_Activity.msg = msg;
             conta_Activity.isAdd = auth.isAdd;
             conta_Activity.isDelete = auth.isDelete;
             conta_Activity.isUpdate = auth.isUpdate;
             conta_Activity.isVisit = auth.isVisit;
             if (auth.isVisit)
             {
                 return View("Details_Visit", conta_Activity);
             }
             else
             {
                 return View(conta_Activity);
             }
         });
 }
 public ResponseStatus GetSecondAuth(HttpCookieCollection cookies, Container_Authority_Msg auth)
 {
     if (cookies[GLB.userId] == null)
     {
         auth.isAdd = false;
         auth.isDelete = false;
         auth.isUpdate = false;
         return ResponseStatus.SUCCESS;
     }
     auth.isVisit = false;
     string userId = cookies[GLB.userId].Value.ToString();
     RoleDal roleDal = new RoleDal();
     //Container_Authority_Msg auth = new Container_Authority_Msg();
     ResponseStatus resp = roleDal.GetSecondAuth(userId, auth);
     roleDal.ReturnUnitToPool();
     return resp;
 }
Exemple #3
0
 public ResponseStatus GetSecondAuth(string userId, Container_Authority_Msg auth)
 {
     dalBase.sql = "SELECT isadd,isdelete,isupdate FROM db_users,db_role WHERE db_users.roleid=db_role.id AND db_users.stuNum=@stuNum";
     dalBase.Param = new MySqlParameter("@stuNum",userId);
     bool isSUccess = dalBase.Run(Behavious.SELECT_WITH_SINGLEPARAM, false);
     return this.JudgeDBResult(isSUccess, () =>
         {
             dalBase.DataRead.Read();
             auth.isAdd = Convert.ToBoolean(dalBase.DataRead["isadd"]);
             auth.isDelete = Convert.ToBoolean(dalBase.DataRead["isdelete"]);
             auth.isUpdate = Convert.ToBoolean(dalBase.DataRead["isupdate"]);
             dalBase.CloseConnect();
         },
         () =>
         {
             dalBase.CloseConnect();
         });
 }
 public ActionResult Details(string msg)
 {
     conta_List_Department = new Container_List_Department();
         conta_List_Department.message = msg;
         conta_List_Department.List_Dep = new List<Department>();
         resp = departmentService.GetDepartments(Request, conta_List_Department);
         Container_Authority_Msg auth = new Container_Authority_Msg();
         ResponseStatus resp1 = ServiceBuilder.BuildAuthService().GetSecondAuth(Request.Cookies, auth);
         if (resp1 == ResponseStatus.FAILED) resp = resp1;
         return this.JudgeResult(resp, () =>
             {
                 conta_List_Department.isAdd = auth.isAdd;
                 conta_List_Department.isDelete = auth.isDelete;
                 conta_List_Department.isUpdate = auth.isUpdate;
                 conta_List_Department.isVisit = auth.isVisit;
                 return View(conta_List_Department);
             });
 }
 public ActionResult Details(int id,string msg)
 {
     activityWorks = new ActivityWorks();
     ResponseStatus resp = workService.GetWorks(Request, activityWorks, id);
     Container_Authority_Msg auth = new Container_Authority_Msg();
     ResponseStatus resp1 = ServiceBuilder.BuildAuthService().GetSecondAuth(Request.Cookies, auth);
     if (resp1 != ResponseStatus.SUCCESS) resp = resp1;
     if (resp == ResponseStatus.NOT_DATA) resp = ResponseStatus.SUCCESS;
     return this.JudgeResult(resp, () =>
     {
         activityWorks.WorkContent = msg;
         activityWorks.isAdd = auth.isAdd;
         activityWorks.isDelete = auth.isDelete;
         activityWorks.isUpdate = auth.isUpdate;
         activityWorks.isVisit = auth.isVisit;
         return View(activityWorks);
     });
 }
 public ActionResult Details(int? curpage,string msg)
 {
     paginate.CurrentPage = curpage == null ? 1 : (int)curpage;
     NoticeType ntype = Request.Cookies[GLB.userId] == null ? NoticeType.All_MEMBER : NoticeType.NONE;
     resp = noticeService.GetNotices(Request, ntype, paginate,conta_List_Notice);
     Container_Authority_Msg auth = new Container_Authority_Msg();
     ResponseStatus resp1 = ServiceBuilder.BuildAuthService().GetSecondAuth(Request.Cookies, auth);
     if (resp1 == ResponseStatus.FAILED) resp = resp1;
     return this.JudgeResult(resp, () =>
         {
             conta_List_Notice.NType = ntype;
             conta_List_Notice.msg = msg;
             conta_List_Notice.isAdd = auth.isAdd;
             conta_List_Notice.isDelete = auth.isDelete;
             conta_List_Notice.isUpdate = auth.isUpdate;
             conta_List_Notice.isVisit = auth.isVisit;
             return View(conta_List_Notice);
         });
 }
 public ActionResult Details(int? curpage,string message)
 {
     visitPaginate.CurrentPage = curpage == null ? 1 : (int)curpage;
     conta_List_Visit = new Container_List_Visit() {
         paginate = visitPaginate,
         msg = message
     };
     ResponseStatus resp = visitService.GetVisits(conta_List_Visit);
     Container_Authority_Msg auth = new Container_Authority_Msg();
     ResponseStatus resp1 = ServiceBuilder.BuildAuthService().GetSecondAuth(Request.Cookies, auth);
     if (resp1 == ResponseStatus.FAILED) resp = resp1;
     return base.JudgeResult(resp,
         () => {
             conta_List_Visit.isAdd = auth.isAdd;
             conta_List_Visit.isDelete = auth.isDelete;
             conta_List_Visit.isUpdate = auth.isUpdate;
             conta_List_Visit.isVisit = auth.isVisit;
             return View(conta_List_Visit);
         });
 }
 public ActionResult Details(int? curpage, string msg)
 {
     paginate.CurrentPage = curpage == null ? 1 : (int)curpage;
         conta_List_ImportantEvent = new Container_List_ImportantEvent();
         conta_List_ImportantEvent.List_ImportantEvent = new List<ImportantEvent>();
         resp = importantEventService.GetImportantEvents(Request, paginate, conta_List_ImportantEvent);
         Container_Authority_Msg auth = new Container_Authority_Msg();
         ResponseStatus resp1 = ServiceBuilder.BuildAuthService().GetSecondAuth(Request.Cookies, auth);
         if (resp1 == ResponseStatus.FAILED) resp = resp1;
         return this.JudgeResult(resp, () =>
             {
                 conta_List_ImportantEvent.paginate = paginate;
                 conta_List_ImportantEvent.msg = msg;
                 conta_List_ImportantEvent.isAdd = auth.isAdd;
                 conta_List_ImportantEvent.isDelete = auth.isDelete;
                 conta_List_ImportantEvent.isUpdate = auth.isUpdate;
                 conta_List_ImportantEvent.isVisit = auth.isVisit;
                 return View(conta_List_ImportantEvent);
             });
 }