Exemplo n.º 1
0
 public ActionResult Faction(int id)
 {
     bizFaction bf = new bizFaction();
     Faction model = bf.Get(id);
     ViewData["ID"] = id;
     return View(model);
 }
Exemplo n.º 2
0
 public void FactionCheckUpUnPass(int id)
 {
     bizFaction bf = new bizFaction();
     bizUsers bu = new bizUsers();
     bizUserMsg bm = new bizUserMsg();
     Faction model = bf.Get(id);
     Users modelUser = bu.Get(model.BuildUserID);
     bm.AddSysMsg(model.BuildUserID, "你提交的部落: [b]" + model.FName + "[/b] 的申请[color=red]没有通过审核[/color]。");
     bf.Delete(id);
 }
Exemplo n.º 3
0
        public string UsersJinbiDeal(string userName,string users, int factionID, int jinbi)
        {
            if (users == null)
                return "你没有选择用户";
            if (jinbi <= 0)
                return "派发的吧币不能为空或者负数";

            string[] userArray = users.Split(',');
            dalUsers du = new dalUsers();
            dalFaction df = new dalFaction();
            dalFactionLog dfl = new dalFactionLog();
            bizUserMsg bum = new bizUserMsg();
            Faction model = df.Get(factionID);
            if (model.FJinbi < userArray.Length * jinbi)
            {
                return "部落基金池没这么多基金(" + userArray.Length * jinbi + ")可以派发";
            }

            foreach (var item in userArray)
            {
                Users modelUser = du.Get(int.Parse(item));

                if (modelUser.FactionID == factionID)
                {
                    modelUser.Attach();
                    modelUser.Jinbi = modelUser.Jinbi + jinbi;
                    modelUser.Detach();
                    du.Update(modelUser);
                }

                dfl.Add(factionID, userName + " 从部落基金中派发了" + jinbi + "吧币给了 " + modelUser.UserName);
                bum.AddSysMsg(int.Parse(item), userName + " 从部落基金中派发了" + jinbi + "吧币给了你");

            }
            bizFaction bf = new bizFaction();
            Faction modelF = bf.Get(factionID);
            modelF.Attach();
            modelF.FJinbi = modelF.FJinbi - userArray.Length * jinbi;
            modelF.Detach();
            bf.Update(modelF);

            return "";
        }
Exemplo n.º 4
0
        public ActionResult FactionCheckUp(int id)
        {
            bizFaction bf = new bizFaction();
            Faction model = bf.Get(id);

            return View(model);
        }
Exemplo n.º 5
0
        public string UsersDeal(string btn, string users, int factionID, int factoionDeID)
        {
            if (users == null)
                return "";
            string[] userArray = users.Split(',');
            dalUsers du = new dalUsers();
            dalFactionUserLog blog = new dalFactionUserLog();
            if (btn == "1")//转移
            {
                int adminFactionDeID = GetByIsAdmin(factionID);
                if (factoionDeID == adminFactionDeID)
                {
                    List<Users> listFDe = du.ListByFaction(factionID, adminFactionDeID);
                    if ((listFDe.Count + userArray.Length) > 4)
                        return "部落酋长不能超过4个人担任";
                }
                foreach (var item in userArray)
                {
                    Users modelUser = du.Get(int.Parse(item));
                    modelUser.Attach();
                    modelUser.FactionDeID = factoionDeID;
                    modelUser.Detach();
                    du.Update(modelUser);
                }
            }

            if (btn == "2")//删除
            {
                bizFactionLog bfl = new bizFactionLog();
                foreach (var item in userArray)
                {
                    Users modelUser = du.Get(int.Parse(item));
                    FactionUserLog modelLog = blog.GetCurrByUserID(int.Parse(item));
                    if (modelUser.FactionID == factionID)
                    {
                        modelUser.Attach();
                        modelUser.FactionID = 0;
                        modelUser.FactionDeID = 0;
                        modelUser.Detach();
                        du.Update(modelUser);
                    }
                    if (modelLog != null)
                    {
                        modelLog.Attach();
                        modelLog.ExitTime = DateTime.Now;
                        modelLog.Detach();
                        blog.Update(modelLog);
                    }

                    bfl.Add(factionID, modelUser.UserName + " 被踢出部落");
                }
                bizFaction bf = new bizFaction();
                Faction modelF = bf.Get(factionID);
                modelF.Attach();
                modelF.MemberNum = du.ListByFaction(factionID).Count();
                modelF.Detach();
                bf.Update(modelF);
            }

            return "";
        }
Exemplo n.º 6
0
        public ActionResult FGiveJinbi(int id,FormCollection f)
        {
            if (id != FactionID)
                return RedirectToAction("FAdminAlert", new { id = id });
            int jinbi = int.Parse(f["JinbiNum"].ToString());
            bizUsers bu = new bizUsers();
            bizFaction bf = new bizFaction();
            Faction modelF = bf.Get(id);
            bizFactionLog blog = new bizFactionLog();
            FactionLog modelBlog = new FactionLog();
            Users model = bu.Get(UserID);
            if (jinbi <= 0)
            {
                TempData["Msg"] = "��̫������˰ɣ�";
                return RedirectToAction("FGiveJinbi", new { id = id });
            }
            if (model.Jinbi <= jinbi)
            {
                TempData["Msg"] = "��û����ô��ɱҰɣ�";
                return RedirectToAction("FGiveJinbi", new { id = id });
            }
            modelF.Attach();
            modelF.FJinbi += jinbi;
            modelF.Detach();
            model.Attach();
            model.Jinbi -= jinbi;
            model.Detach();
            modelBlog.FactionID = id;
            modelBlog.Remark = model.UserName+" ���׸�������� "+jinbi+" �ɱ�";
            bf.Update(modelF);
            bu.Update(model);
            blog.Add(modelBlog);

            TempData["Msg"] = "�����ɹ�����л��Բ������ľ�����";
            return RedirectToAction("FGiveJinbi", new { id = id });
        }
Exemplo n.º 7
0
        public ActionResult FIndex(int id)
        {
            bizFaction bf = new bizFaction();
            Faction model = bf.Get(id);
            bizUsers bu = new bizUsers();
            Users modelUser = bu.Get(UserID);
            ViewData["ID"] = id;

            ViewData["FactionDeID"] = modelUser.FactionDeID;
            ViewData["FactionID"] = modelUser.FactionID ;
            ViewData["AdminType"] = modelUser.AdminType ;
            SessionInfo sInfo = SessionGet();
            sInfo.FactionDeID = modelUser.FactionDeID;
            sInfo.FactionID = modelUser.FactionID;
            SessionSet(sInfo);
            return View(model);
        }
Exemplo n.º 8
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 });
        }
Exemplo n.º 9
0
 public ActionResult FGiveJinbi(int id)
 {
     if (id != FactionID)
         return RedirectToAction("FAdminAlert", new { id = id });
     bizFaction bf = new bizFaction();
     bizUsers bu = new bizUsers();
     Users modelUser = bu.Get(UserID);
     ViewData["ID"] = id;
     ViewData["Jinbi"] = modelUser.Jinbi;
     Faction modelF = bf.Get(id);
     return View(modelF);
 }
Exemplo n.º 10
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);
        }
Exemplo n.º 11
0
        public ActionResult FAdminImage(int id, HttpPostedFileBase file1, HttpPostedFileBase file2)
        {
            if ((new bizFactionDe()).GetByIsAdmin(id) != FactionDeID && UserCommon.CheckBBSHighAdminRight(AdminType) == false)
                return RedirectToAction("FAdminAlert", new { id = id });

            bizFaction bf = new bizFaction();
            Faction model = bf.Get(id);
            ViewData["ID"] = id;

            if (file1 != null)
            {
                Public.ImageHelper.UpImageAttr upImageAttr1;

                string result = Public.ImageHelper.ImageUp(file1, Enumerations.ImageUpPathType.bbs, model.FLogo == null ? "" : model.FLogo, 30, 180, 90, out upImageAttr1);

                if (result != "")
                {
                    TempData["Msg"] = result;
                    return RedirectToAction("FAdminImage", new { id = id });
                }
                else
                {
                    model.Attach();
                    model.FLogo = upImageAttr1.imagePath;
                    model.Detach();
                    bf.Update(model);
                }
            }

            if (file2 != null)
            {
                Public.ImageHelper.UpImageAttr upImageAttr2;
                string result2 = Public.ImageHelper.ImageUp(file2, Enumerations.ImageUpPathType.bbs, model.FImages == null ? "" : model.FImages, 200, 714, 102, out upImageAttr2);

                if (result2 != "")
                {
                    TempData["Msg"] = result2;
                    return RedirectToAction("FAdminImage", new { id = id });
                }
                else
                {
                    model.Attach();
                    model.FImages = upImageAttr2.imagePath;
                    model.Detach();
                    bf.Update(model);
                }
            }

            return RedirectToAction("FAdminImage", new { id = id });
        }
Exemplo n.º 12
0
        public ActionResult FAdminImage(int id)
        {
            if ((new bizFactionDe()).GetByIsAdmin(id) != FactionDeID && UserCommon.CheckBBSHighAdminRight(AdminType) == false)
                return RedirectToAction("FAdminAlert", new { id = id });

            bizFaction bf = new bizFaction();
            Faction model = bf.Get(id);
            ViewData["ID"] = id;
            return View(model);
        }
Exemplo n.º 13
0
 public ActionResult FAdminDeUsers(int id)
 {
     if ((new bizFactionDe()).GetByIsAdmin(id) != FactionDeID && UserCommon.CheckBBSHighAdminRight(AdminType) == false)
         return RedirectToAction("FAdminAlert", new { id = id });
     int deID = int.Parse(Request.QueryString["deid"].ToString());
     bizFaction bf=new bizFaction();
     bizFactionDe bfd = new bizFactionDe();
     bizUsers bu = new bizUsers();
     Faction model = bf.Get(id);
     FactionDe modelDe = bfd.Get(deID);
     List<FactionDe> listDe = bfd.ListByID(id);
     List<Users> listUser = bu.ListByFaction(id, deID);
     ViewData["ID"] = id;
     ViewData["Faction"] = model;
     ViewData["FactionDe"] = modelDe;
     ViewData["listDe"] = listDe;
     return View(listUser);
 }
Exemplo n.º 14
0
        public ActionResult FAdminBase(int id,FormCollection f)
        {
            if ((new bizFactionDe()).GetByIsAdmin(id) != FactionDeID && UserCommon.CheckBBSHighAdminRight(AdminType) == false)
                return RedirectToAction("FAdminAlert", new { id = id });

            bizFaction bf = new bizFaction();
            Faction model = bf.Get(id);
            model.Attach();
            model.FDesc = f["FDesc"];
            model.FSystem = f["FSystem"];
            model.Detach();
            bf.Update(model);
            return RedirectToAction("FAdminBase", new { id = id });
        }