예제 #1
0
        public ActionResult FApply(int id,FormCollection f)
        {
            int userID = UserID;
            bizFaction bf = new bizFaction();
            bizUsers bu = new bizUsers();
            Users modelUser = bu.Get(UserID);
            Faction model = bf.Get(id);
            ViewData["ID"] = id;
            if (modelUser.FactionID != 0)
            {
                TempData["Msg"] = "���Ѿ������˲��䣬����������";
                return RedirectToAction("FApply", new { id = id });
            }
            bizFactionUserLog bfl = new bizFactionUserLog();
            if (bfl.GetByUserID(userID) != null)
            {
                TempData["Msg"] = "���Ѿ��ύ�˼��벿������룬������������";
                return RedirectToAction("FApply", new { id = id });
            }
            FactionUserLog modelLog = new FactionUserLog();
            modelLog.FactionID = id;
            modelLog.UserID = userID;
            modelLog.ApplyDesc = f["ApplyDesc"].Trim();
            modelLog.ApplyTime = DateTime.Now;
            bfl.Add(modelLog);

            TempData["Msg"] = "���Ѿ��ɹ��ύ�����룬��ȴ�������������ˡ�";
            return RedirectToAction("FApply", new { id = id });
        }
예제 #2
0
        /// <summary>
        /// ȡ�����벿������
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult FUnApply(int id)
        {
            //bizFaction bf = new bizFaction();
            bizFactionUserLog bfl = new bizFactionUserLog();
            FactionUserLog modelLog = bfl.GetByUserID(UserID);
            if(modelLog!=null)
                bfl.Delete(modelLog);

            return RedirectToAction("FApply", new { id = id });
        }
예제 #3
0
        public ActionResult FApply(int id)
        {
            bizFaction bf = new bizFaction();
            bizFactionUserLog bfl = new bizFactionUserLog();
            FactionUserLog modelLog = bfl.GetByUserID(UserID);
            ViewData["modelLog"] = modelLog;

            Faction model = bf.Get(id);
            ViewData["ID"] = id;
            return View(model);
        }