コード例 #1
0
        //
        // GET: /Manage/
        public ActionResult Index()
        {
            bizUsers b = new bizUsers();
            Users model = b.Get(UserID);

            return View(model);
        }
コード例 #2
0
        public string Add(string userName, string remark, string datetime, string adminName)
        {
            bizUsers bu = new bizUsers();
            Users model = bu.Get(userName);
            if (model == null)
                return "该用户不存在";
            string[] da=datetime.Split('-');
            int da1 = int.Parse(da[0]);
            string ds2 = da[1];

            int userID = model.UserID;
            UserForbid m = new UserForbid();
            m.AddTime = DateTime.Now;
            m.AdminName = adminName;
            //m.ForbidTime = DateTime.Now.AddHours(hours);
            if (ds2 == "Minutes")
                m.ForbidTime = DateTime.Now.AddMinutes(da1);
            else if(ds2=="Hours")
                m.ForbidTime = DateTime.Now.AddHours(da1);
            else if (ds2 == "Days")
                m.ForbidTime = DateTime.Now.AddDays(da1);
            else if (ds2 == "Months")
                m.ForbidTime = DateTime.Now.AddMonths(da1);
            else if (ds2 == "Years")
                m.ForbidTime = DateTime.Now.AddYears(da1);
            else
                throw new Exception("时间不正确");
            m.Remark = remark;
            m.UserName = model.UserName;
            m.UserID = model.UserID;
            DeleteAllByUserName(userName);
            Add(m);
            return "";
        }
コード例 #3
0
        public static Users GetUser(int userid)
        {
            bizUsers biz = new bizUsers();

            Users model = biz.Get(userid);

            return model;
        }
コード例 #4
0
ファイル: Passport.asmx.cs プロジェクト: dalinhuang/myxx
 public int GetUserID(string username)
 {
     bizUsers bu = new bizUsers();
     Users model = bu.Get(username);
     if (model == null)
         return 0;
     else
         return model.UserID;
 }
コード例 #5
0
ファイル: bizFaction.cs プロジェクト: dalinhuang/myxx
 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);
 }
コード例 #6
0
ファイル: RegisterController.cs プロジェクト: dalinhuang/myxx
 public ContentResult CheckUserName(string UserName)
 {
     bizUsers provider = new bizUsers();
     if (MyText.CheckHaveSymbol(UserName))
         return Content("1");
     if (provider.CheckUserName(UserName.Replace(" ", "").Trim()) == false)
         return Content("0");
     else
         return Content("1");
 }
コード例 #7
0
        public ActionResult AddRe(int id,FormCollection f)
        {
            int userID = UserID;
            Biz.bizBBSDE bde = new bizBBSDE();
            bizUsers bu = new bizUsers();
            Users modelUser = bu.Get(userID);

            if ((new bizUserForbid()).GetByUserID(userID) != null)
            {
                TempData["Msg"] = "�����ڽ����ڼ䣬�޷�������";
                return Redirect("/news/detail/" + id + "_1.html#re");
            }

            if (LastPostTime.AddSeconds(5) > DateTime.Now)
            {
                TempData["Msg"] = "������ٶȹ��죬5���Ӻ��ٻء�";
                return Redirect("/news/detail/" + id + "_1.html#re");
            }
            else
            {
                LastPostTime = DateTime.Now;
            }
            if (MyText.GetNoSpaceStr(f["txtContent"]).Trim().Length < 2)
            {
                TempData["Msg"] = "�ظ����ݲ���С��2���ַ���";
                return Redirect("/news/detail/" + id + "_1.html#re");
            }

            string content = CommonCache.FilterTextReplace(f["txtContent"]);
            if (bde.GetPrevContent(modelUser.UserID) == content)
            {
                TempData["Msg"] = "�����ˮ��";
                return Redirect("/news/detail/" + id + "_1.html#re");
            }

            if (bbs.GetLevels(modelUser.OnlineTime) < 2)
            {
                TempData["Msg"] = "2���ſ��Իظ���������2��ֻ��Ҫ5����Ŷ��";
                return RedirectToAction("Post");
            }

            int bbsMainID = (new bizNews()).Get(id).BBSMainID;
            string images = "";
            string face = "";
            byte isShowTag=0;
            int addUser = UserID;
            string addIP = Public.CommonHelper.GetIPAddress();
            int reDeID = 0;
            byte isNiming = 0;

            bde.BBSDEAdd(bbsMainID,2, content, "", images, face, isShowTag, isNiming, addUser, addIP, reDeID);

            int count = bde.DeCount(bbsMainID);
            return Redirect("/news/detail/" + id + "_1.html#re");
        }
コード例 #8
0
        public ContentResult AddUserCard(FormCollection f)
        {
            bizUsers bu = new bizUsers();
            bizUserXCard buc = new bizUserXCard();

            Users model = bu.Get(f["UserName"].Trim());
            if (model == null)
                return Content("���û�������");
            buc.AddCard(model.UserID,model.UserName,UserName, f["cardName"], int.Parse(f["cardNum"]));
            return Content("��Ƭ��ӳɹ�");
        }
コード例 #9
0
        public ActionResult AddUserJinbi(FormCollection f)
        {
            if (UserID != 1001)
            {
                return Content("");
            }
            bizUsers u = new bizUsers();
            u.AddUserJinbi(f["username"].Trim(),UserName, int.Parse(f["AddJinbi"]));

            return Content("�ɱ���ӳɹ���");
        }
コード例 #10
0
        public JsonResult GetUserInfo()
        {
            int userID = UserID;

            bizUsers b = new bizUsers();
            Users modelUser = b.Get(userID);

            int julinzhuising = Common.Untilies.UserCommon.JulinzhuIsToday(modelUser.JulinzhuDate) == true&&modelUser.JulinzhuMaxValue>0 ? 1 : 0;
            int julinzhumax = modelUser.JulinzhuMaxValue == null ? 0 : (int)modelUser.JulinzhuMaxValue;
            int julinzhucurr = modelUser.JulinzhuCurrValue == null ? 0 : (int)modelUser.JulinzhuCurrValue;

            return this.Json(new { zaixian=1,julinzhuising = julinzhuising, julinzhumax = julinzhumax, julinzhucurr = julinzhucurr });
        }
コード例 #11
0
        public static void GetUser(int userid, out string imageUser, out string UserName)
        {
            imageUser = "";
            UserName = "";

            bizUsers biz = new bizUsers();

            Users model = biz.Get(userid);
            if (model != null)
            {
                imageUser = model.Images;
                UserName = model.UserName;
            }
        }
コード例 #12
0
 public ActionResult BuyCard(FormCollection f)
 {
     bizUsers bu = new bizUsers();
     bizCard bc = new bizCard();
     bizUserXCard buc = new bizUserXCard();
     Card cmodel = bc.Get(f["cardName"]);
     Users umodel = bu.Get(UserID);
     if (cmodel.AllowBuy != 1)
         return Content("�õ����޷�����");
     if (umodel.Jinbi < int.Parse(f["cardNum"]) * cmodel.Price)
         return Content("��İɱҲ������޷�����");
     buc.BuyCard(UserID, f["cardName"], int.Parse(f["cardNum"]));
     return Content("�ɹ�������" + f["cardNum"] + "��"+cmodel.CardAlias);
 }
コード例 #13
0
ファイル: bizGQuanMain.cs プロジェクト: dalinhuang/myxx
 public string Add(int userID, int num, int jinbiNum,string pwd,out int id)
 {
     id = 0;
     bizUsers bu = new bizUsers();
     Users modelUser = bu.Get(userID);
     if (modelUser.Jinbi < num * jinbiNum)
         return "你随身携带的吧币不足,无法摆擂";
     GQuanMain model = new GQuanMain();
     model.UserID = userID;
     model.Num = num;
     model.JinbiNum = jinbiNum;
     model.Pwd = pwd;
     model.Status = 0;
     id=Add(model);
     return "";
 }
コード例 #14
0
 public ActionResult ChangePwdBBS(FormCollection f)
 {
     bizUsers bu = new bizUsers();
     Users modelUser = bu.Get(UserID);
     if (f["PwdOld"] != modelUser.Password)
     {
         TempData["Msg"] = "���벻��ȷ";
         return Redirect("/bbs/SelfInfoSet.html");
     }
     else
     {
         bu.ModPassword(modelUser, f["PwdNew"]);
         TempData["Msg"] = "�����޸ijɹ�";
         return Redirect("/bbs/SelfInfoSet.html");
     }
 }
コード例 #15
0
 public ActionResult RightFunction(int id)
 {
     bizUsers bUser = new bizUsers();
     bizSysFunction bs = new bizSysFunction();
     bizSysFunctionType bst = new bizSysFunctionType();
     bizUserXSysFunction bu = new bizUserXSysFunction();
     ViewData["ListType"] = bst.List();
     Users user = bUser.Get(id);
     ViewData["Users"]=user;
     ViewData["ListUser"] = bu.List(id);
     ViewData["List"] = bs.List();
     ViewData["Bar"] = MenuBar.Start()
         .AddMenu("�û�Ȩ������", "/AdminSys/Right")
         .AddMenu("����" + user.UserName, "")
         .GetMenuHtml();
     return View();
 }
コード例 #16
0
        /// <summary>
        /// 得到用户发帖排行榜
        /// </summary>
        /// <returns></returns>
        public List<Users> ListUserBBSNum()
        {
            string SysName = "ListUserBBSNum";
            List<Users> list = null;

            if (SysCache.Contains(SysName))
            {
                return SysCache.Get(SysName) as List<Users>;
            }

            if (list != null)
                return list;

            bizUsers bu = new bizUsers();
            list = bu.ListTopByBBSNum(150);
            SysCache.Add(SysName, list, new AbsoluteTime(DateTime.Now.AddHours(2)));
            return list;
        }
コード例 #17
0
        public ActionResult ChangePwd(FormCollection f)
        {
            ViewData["CurrMenu"] = "�޸�����";
            bizUsers bu = new bizUsers();
            Users modelUser = bu.Get(UserID);

            if (f["PwdOld"] != modelUser.Password)
            {
                ViewData["Msg"] = "���벻��ȷ";
                return View();
            }
            else
            {
                bu.ModPassword(modelUser, f["PwdNew"]);
                ViewData["Msg"] = "�����޸ijɹ�";
                return View();
            }
        }
コード例 #18
0
        public void Deal(int userReportID,int adminID,string adminName,string re,byte jiangliType)
        {
            bool giveJiangli = false ;
            bizUsers bu = new bizUsers();
            bizUserMsg bum = new bizUserMsg();
            UserReports model = Get(userReportID);
            Users modelUser = bu.Get(model.UserID);
            model.Attach();
            model.AdminID = adminID;
            model.AdminName = adminName;
            model.AdminRe = re;
            if (model.JiangliType == 0)
            {
                giveJiangli = true;
                model.JiangliType = jiangliType;
            }
            model.ReTime = DateTime.Now;
            model.Detach();
            Update(model);
            if (giveJiangli == true)
            {
                if (model.JiangliType == 1)
                {
                    modelUser.Attach();
                    modelUser.Jinbi += 200;
                    modelUser.Detach();
                    bu.Update(modelUser);
                    bum.AddSysMsg(model.UserID, "因为你的举报,系统奖励了你200吧币。");
                }
                if (model.JiangliType == 2)
                {
                    bizUserXCard buc = new bizUserXCard();
                    buc.AddCard(model.UserID, "bigqiqiu", 1);

                    bum.AddSysMsg(model.UserID, "因为你的举报,系统奖励了你1张强化气球卡。");
                }
            }
        }
コード例 #19
0
        public ActionResult Apply(FormCollection f)
        {
            int userID = UserID;
            if (f["FName"].Trim() == "")
            {
                TempData["Msg"] = "����������Ϊ�ա�";
                return RedirectToAction("Apply");
            }
            if (f["BuildDesc"].Trim() == "")
            {
                TempData["Msg"] = "�������ɲ���Ϊ�ա�";
                return RedirectToAction("Apply");
            }
            bizUsers bu = new bizUsers();
            bizFaction bf = new bizFaction();
            Users modelUser = bu.Get(userID);
            if (modelUser.Jinbi < 100000 || (modelUser.Score - modelUser.UsedScore) < 50)
            {
                TempData["Msg"] = "�㲻��������������";
                return RedirectToAction("Apply");
            }
            if (bf.GetByUserID(userID) != null)
            {
                TempData["Msg"] = "���Ѿ��ύ�����룬��ʱ�޷������롣";
                return RedirectToAction("Apply");
            }

            Faction model = new Faction();
            model.FName = f["FName"].Trim();
            model.BuildDesc = f["BuildDesc"].Trim();
            model.BuildUserID = userID;
            model.BuildUserName = UserName;
            model.Status = 0;
            bf.Add(model);
            TempData["Msg"] = "��������Ѿ��ύ����ȴ�����Ա��������";
            return View();
        }
コード例 #20
0
        /// <summary>
        /// ����QIDҳ��
        /// </summary>
        /// <returns></returns>
        public ActionResult qidApply()
        {
            int userID = UserID;

            ViewData["CurrMenu"] = "QID����";
            bizUsers bu = new bizUsers();
            bizUserQID b = new bizUserQID();
            Users modelUser = bu.Get(userID);
            //����㷢�������룬��ת��������ҳ��
            UserQID model = b.GetIngByUserID(userID);
            if (model != null)
                return RedirectToAction("qidApplyIng");
            //������Ѿ�����QID����ת��QID���ҳ��
            UserQID model2 = b.GetByUserID(userID);
            if (model2 != null)
                return RedirectToAction("qidApplyed");
            //�����õ�ij�˵����룬��ת�����ܴ���ҳ��
            UserQID model3 = b.GetIngByAllUserID(userID);
            if (model3 != null)
                return RedirectToAction("qidApplyDeal");
            TempData["Msg"] = "";
            ViewData["Remark"] = "";
            return View();
        }
コード例 #21
0
        public static bool AddUserHammer(string userName, int HammerCount,string remark)
        {
            bizUsers biz = new bizUsers();

            Users model = biz.Get(userName);

            if (model == null)
            {
                return false;
            }

            bizGrabHammerAction biz1 = new bizGrabHammerAction();
            DataSet ds = biz1.AddHammer(model.UserID, HammerCount, remark);

            if (MainFunc.IsDataSetNoNull(ds))
            {
                if (MainFunc.GetInteger(ds.Tables[0].Rows[0][0]) == 0)
                {
                    return true;
                }
            }

            return false;
        }
コード例 #22
0
 public ActionResult UserInfo()
 {
     bizUsers bu = new bizUsers();
     Users model = bu.Get(UserID);
     if (SZXX.Common.Untilies.UserCommon.JulinzhuIsToday(model.JulinzhuDate) == true&&model.JulinzhuMaxValue>0)
     {
         ViewData["juImageUrl"]  = "/images/bbs/julinzhu.gif";
         ViewData["jutitle"]  = "�����飬���ռ����飺" + model.JulinzhuCurrValue + "/" + model.JulinzhuMaxValue + "��˫�����ͷ�";
     }
     else
     {
         ViewData["juImageUrl"]  = "/images/bbs/julinzhu1.gif";
         ViewData["jutitle"]  = "�����飬˫�����ɼ�����������һ�ž���������ռ�����״̬";
     }
     return View(model);
 }
コード例 #23
0
        public ActionResult SendMessage(FormCollection f)
        {
            bizUserFriend bf = new bizUserFriend();
            List<UserFriendDetail> list = bf.ListByUser(UserID);
            bizUsers b = new bizUsers();
            Users model = b.Get(f["UserName"].Trim());
            if (model == null)
            {
                TempData["Msg"] = "���û�������";
                TempData["UserName"] = f["UserName"].Trim();
                return RedirectToAction("SendMessage");
            }
            if (model.UserID == 1000)
            {
                TempData["Msg"] = "���ܸ�ϵͳ������Ϣ";
                TempData["UserName"] = f["UserName"].Trim();
                return RedirectToAction("SendMessage");
            }
            bizUserMsg bum = new bizUserMsg();
            bizPopUp bp = new bizPopUp();
            PopUp modelP = new PopUp();
            modelP.Title = "ϵͳ��ʾ";
            modelP.Types = 2;
            modelP.Content = "�û���" + UserName + "�����㷢��һ�������";
            modelP.UserID = model.UserID;
            modelP.AddUser = 1000;
            modelP.URL = "/user/selfMessage/0-1.html";
            modelP.Target = "_blank";
            modelP.StartTime = DateTime.Now;
            modelP.EndTime = DateTime.Now.AddDays(1);
            modelP.Status = 0;
            bum.Add(UserID, model.UserID, CommonCache.FilterTextReplace(f["Content"]));
            bp.Add(modelP);

            TempData["Msg"] = "���ŷ��ͳɹ�";
            return RedirectToAction("SendMessage");
        }
コード例 #24
0
        public ActionResult SendMessage(int? id)
        {
            bizUsers b = new bizUsers();
            ViewData["MsgBar"] = bbs.GetUserMsgBarHtml2(3);

            if (id == null)
            {
                return View();
            }

            Users model = b.Get(id);
            if (model == null)
                TempData["UserName"] = "";
            else
                TempData["UserName"] = model.UserName;
            ViewData["UserID"] = UserID;
            return View();
        }
コード例 #25
0
        public ActionResult JulinjuShifang()
        {
            int userID = UserID;
            bizUsers bu = new bizUsers();
            Users model = bu.Get(userID);
            int currValue = 0;
            if (SZXX.Common.Untilies.UserCommon.JulinzhuIsToday(model.JulinzhuDate))
            {
                model.Attach();
                currValue = (int)model.JulinzhuCurrValue;
                model.Jingyan += currValue;
                model.JulinzhuMaxValue -= currValue;
                if (model.JulinzhuMaxValue < 0)
                    model.JulinzhuMaxValue = 0;
                model.Detach();
                bu.Update(model);
                Users model1 = bu.Get(model.UserID);
                model1.Attach();
                model1.JulinzhuCurrValue = 0;
                model1.Detach();
                bu.Update(model1);

                return Content("���Ѿ�����Ӿ������л��" + currValue + "�㾭�顣");
            }
            else
            {
                return Content("��ľ����黹û�б������");
            }
        }
コード例 #26
0
        /// <summary>
        /// 用户签名的上传
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="basePath"></param>
        /// <param name="files"></param>
        /// <param name="fileTypes"></param>
        /// <param name="imagePath"></param>
        /// <returns></returns>
        public static string ImageUpOfQianming(int userID, HttpPostedFileBase files, Enumerations.ImageUseType fileTypes, out string imagePath)
        {
            string basePath = ConfigurationManager.AppSettings["ImagePath"];
            string imageDomain = ConfigurationManager.AppSettings["ImageDomain"];
            imagePath = "";

            bizUsers b = new bizUsers();
            Users model = b.Get(userID);
            DateTime nowDate = DateTime.Now;
            string extName = MyText.GetFileExtName(files.FileName);
            if (MyText.IsImage(extName) == false)
            {
                return "文件类型不符合";
            }

            if (files.ContentLength > 1024 * 20)
            {
                return "签名照片已超过20K,不能上传";
            }

            System.Drawing.Image image = System.Drawing.Image.FromStream(files.InputStream);
            if (image.Width > 300 || image.Height > 300)
            {
                return "头像图片已经超过最大尺寸:300×300(象素)";
            }

            try
            {
                System.IO.File.Delete(basePath + model.Images);
            }
            catch { ; }
            try
            {
                string filePath = "/userfiles/profile/" + nowDate.Year + "/" + nowDate.Month + "/" + nowDate.Day;
                string fileName = "user" + model.UserID + "." + extName;
                string imageUrl = imageDomain + filePath + "/" + fileName;
                filePath = basePath + filePath;
                System.IO.Directory.CreateDirectory(filePath);
                files.SaveAs(filePath + "/" + fileName);

                model.Attach();
                model.Images = imageUrl;
                model.Detach();
                b.Update(model);
                imagePath =  imageUrl;
            }
            catch (Exception e)
            {
                return e.Message;

            }

            return "";
        }
コード例 #27
0
        /// <summary>
        /// 上传论坛中的图片
        /// </summary>
        /// <param name="basePath"></param>
        /// <param name="files"></param>
        /// <param name="fileTypes"></param>
        /// <param name="imagePath"></param>
        /// <returns></returns>
        public static string ImageUpOfBbs(int userID, HttpPostedFileBase files, int userImageTypeID, out string imagePath)
        {
            string basePath = ConfigurationManager.AppSettings["ImagePath"];
            string imageDomain = ConfigurationManager.AppSettings["ImageDomain"];
            imagePath = "";
            if (files == null)
                return "";
            bizUsers b = new bizUsers();
            Users model = b.Get(userID);
            DateTime nowDate = DateTime.Now;
            string extName = MyText.GetFileExtName(files.FileName);
            string fileNameBase = model.UserID.ToString() + nowDate.Hour.ToString() + nowDate.Minute.ToString() + nowDate.Second.ToString() + nowDate.Millisecond.ToString();
            if (bbs.GetLevels(model.OnlineTime) < 5)
            {
                return "你还没到5级,无法上传图片";
            }
            if (MyText.IsImage(extName) == false)
            {
                return "不是符合规定的图片文件";
            }
            if (files.ContentLength > 1024 * 300)
            {
                return "照片已超过300K,不能上传";
            }

            System.Drawing.Image image = System.Drawing.Image.FromStream(files.InputStream);

            try
            {
                //图片的路径
                string filePath = "/userfiles/bbs/" + nowDate.Year + "/" + nowDate.Month + "/" + nowDate.Day;
                string fileSmallName = fileNameBase + "small." + extName; //缩略图的名称
                string fileName = fileNameBase + "." + extName; //图片的名称
                string imageUrl = filePath + "/" + fileName;
                int width = image.Width; //图片的宽度
                int height = image.Height; //图片的高度

                System.IO.Directory.CreateDirectory(basePath + filePath); //创建文件夹

                if (extName.ToLower() != "gif") //如果是gif文件,则不加水印
                    image = PublicHelper.AddWatermarkImage(image, basePath + "/images/shuiyin.gif", "WM_BOTTOM_RIGHT");

                image.Save(basePath + filePath + "/" + fileName);

                ImagePlus imgplus = new ImagePlus(files.InputStream);
                imgplus.MakeThumbnail(120, 120, 1);
                imgplus.SaveAs(basePath + filePath + "/" + fileSmallName, extName);

                UserImages uiModel = new UserImages();
                uiModel.UserID = model.UserID;
                uiModel.UserImageTypeID = userImageTypeID;
                uiModel.ImageName = MyText.GetFileNoExtName(MyText.GetFileName(files.FileName));
                uiModel.ImageSmallPath = imageDomain + filePath + "/" + fileSmallName;
                uiModel.ImagePath = imageDomain + filePath + "/" + fileName;
                uiModel.ImageSize = files.ContentLength / 1024;
                uiModel.Height = height;
                uiModel.Width = width;
                uiModel.AddTime = DateTime.Now;
                bizUserImages bui = new bizUserImages();
                bui.Add(uiModel);
                imagePath = imageDomain+imageUrl;
            }
            catch (Exception e)
            {
                return e.Message;
            }
            return "";
        }
コード例 #28
0
 public ActionResult UserInfoSmall()
 {
     bizUsers bu = new bizUsers();
     Users model = bu.Get(UserID);
     return View(model);
 }
コード例 #29
0
 public ActionResult UserInfo(int userID)
 {
     bizUsers b = new bizUsers();
     Users model = b.Get(userID);
     bizUserLog ul = new bizUserLog();
     UserLog modelUL = ul.GetOfLastLogin(userID);
     ViewData["LastLoginTime"] = modelUL == null ? "" : modelUL.LoginTime.ToString();
     return View(model);
 }
コード例 #30
0
 public ActionResult UserImgFolder(int userID)
 {
     bizUsers b = new bizUsers();
     Users model = b.Get(userID);
     bizUserImageType bt = new bizUserImageType();
     List<UserImageType> list = bt.ListByUser(userID);
     if (list == null || list.Count == 0)
         return Redirect("/user/img/"+ userID +"_0_1.html");
     ViewData["FolderList"] = list;
     return View(model);
 }