Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Admin admin = new B_Admin();
     AdminGroupBll.Power_Judge(3);
     if (!IsPostBack)
     {
         BindSpeacils();
     }
 }
Esempio n. 2
0
 public static void Add(LogType logType, string description)
 {
     M_LoginAdmin loginModel = new B_Admin().GetLoginModel();
     ILog log = DataAccess.CreateLog();
     string ipAddress = string.Empty;
     if (HttpContext.Current.Request.UserHostAddress != null)
     {
         ipAddress = HttpContext.Current.Request.UserHostAddress;
     }
     log.Add(logType, loginModel.AdminName, loginModel.UserId, description, ipAddress, DateTime.Now);
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Admin admin = new B_Admin();
     M_LoginAdmin loginModel = admin.GetLoginModel();
     if (loginModel != null)
     {
         M_Admin model = admin.GetModel(loginModel.UserId);
         model.LastLogoutTime = DateTime.Now;
         admin.UpdateInfo(model);
     }
     admin.ClearCookie();
     Response.Redirect("~/system/Login.aspx");
 }
Esempio n. 4
0
 public void CheckMulitLogin()
 {
     this.CheckIsLogin();
     string str = string.Empty;
     if (HttpContext.Current.Request.Cookies["randNum"] != null)
     {
         str = Ky.Common.Function.UrlDecode(HttpContext.Current.Request.Cookies["randNum"].Value);
     }
     int userId = int.Parse(HttpContext.Current.Request.Cookies["AdminState"]["UserId"]);
     M_Admin model = new B_Admin().GetModel(userId);
     if (!(model.AllowMultiLogin || !(str != model.RandNumber)))
     {
         HttpContext.Current.Response.Write("<font style='color:red;font-size:12px'>该账号设置为不允许多人同时使用,已经有其他人用该账号登陆 <a href='" + Param.ApplicationRootPath + "/System/Login.aspx' style='color:blue'>重新登陆</a></font>");
         HttpContext.Current.Response.End();
     }
 }
Esempio n. 5
0
 public void Auditing(string tableName, string idStr, int status)
 {
     if (idStr != string.Empty)
     {
         B_Admin admin = new B_Admin();
         B_Column column = new B_Column();
         B_Channel channel = new B_Channel();
         string[] strArray = idStr.Split(new char[] { ',' });
         foreach (string str in strArray)
         {
             int id = int.Parse(str);
             DataRow info = this.dal.GetInfo(tableName, id);
             if (info == null)
             {
                 break;
             }
             int columnId = (int) info["colid"];
             M_Column column2 = column.GetColumn(columnId);
             if (column2 == null)
             {
                 break;
             }
             M_Channel channel2 = channel.GetChannel(column2.ChId);
             if (channel2 == null)
             {
                 break;
             }
             int num3 = (int) info["Status"];
             int num4 = (int) info["UserType"];
             int userId = (int) info["UId"];
             string str2 = info["UName"].ToString();
             string newValue = info["Title"].ToString();
             string str4 = channel2.Notice2.Replace("{@标题}", newValue);
             M_LoginAdmin loginModel = admin.GetLoginModel();
             int adiminId = loginModel.UserId;
             string loginName = loginModel.LoginName;
             this.dal.Auditing(tableName, id, status, adiminId, loginName);
             if ((((status == 3) && (num3 != 3)) && (num4 == 0)) && (userId > 0))
             {
                 B_WebMessage message = new B_WebMessage();
                 M_WebMessage message2 = new M_WebMessage();
                 message2.Title = "稿件采纳通知";
                 message2.Content = str4;
                 message2.IsRead = 0;
                 message2.IsSend = 1;
                 message2.ReceiverId = userId;
                 message2.ReceiverName = str2;
                 message2.SendId = 0;
                 message2.SendName = loginName;
                 message2.OverdueDate = DateTime.Now;
                 message2.AddDate = DateTime.Now;
                 message2.ReceiverDel = 0;
                 message2.SendDel = 0;
                 message.Insert(message2);
             }
             M_User user = new B_User().GetUser(userId);
             if (user == null)
             {
                 break;
             }
             B_UserGroup group = new B_UserGroup();
             M_UserGroup model = group.GetModel(user.GroupID);
             if (group == null)
             {
                 break;
             }
             int num7 = int.Parse(group.Power_UserGroup("Contribute", 0, model.GroupPower)) * column2.ScoreReward;
             new B_Money().Integral(num7, userId);
         }
     }
 }
Esempio n. 6
0
 public void Cancel(string tableName, int id)
 {
     B_Channel channel = new B_Channel();
     B_Column column = new B_Column();
     B_Admin admin = new B_Admin();
     DataRow info = this.dal.GetInfo(tableName, id);
     if (info != null)
     {
         int columnId = (int) info["colid"];
         M_Column column2 = column.GetColumn(columnId);
         if (column2 != null)
         {
             M_Channel channel2 = channel.GetChannel(column2.ChId);
             if (channel2 != null)
             {
                 int num2 = (int) info["UserType"];
                 int num3 = (int) info["UId"];
                 string str = info["UName"].ToString();
                 string newValue = info["Title"].ToString();
                 string str3 = channel2.Notice1.Replace("{@标题}", newValue);
                 string loginName = admin.GetLoginModel().LoginName;
                 this.dal.Cancel(tableName, id);
                 if ((num2 == 0) && (num3 > 0))
                 {
                     B_WebMessage message = new B_WebMessage();
                     M_WebMessage model = new M_WebMessage();
                     model.Title = "退稿通知";
                     model.Content = str3;
                     model.IsRead = 0;
                     model.IsSend = 1;
                     model.ReceiverId = num3;
                     model.ReceiverName = str;
                     model.SendId = 0;
                     model.SendName = loginName;
                     model.OverdueDate = DateTime.Now;
                     model.AddDate = DateTime.Now;
                     model.ReceiverDel = 0;
                     model.SendDel = 0;
                     message.Insert(model);
                 }
             }
         }
     }
 }
Esempio n. 7
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        B_SiteInfo bsiteinfo = new B_SiteInfo();

        string sSelectUserType = Request.Form["SelectUserType"];
        string sTitle = bsiteinfo.GetFiltering(Title.Text);
        string sContent = bsiteinfo.GetFiltering(Function.Encode(Content.Text));
        B_Admin adminBll = new B_Admin();
        M_LoginAdmin loginModel = adminBll.GetLoginModel();
        string sSendName = loginModel.AdminName.ToString();
        string sOverdueDate = OverdueDate.Text;

        model.SendId = 0;
        model.SendName = sSendName;
        model.Title = sTitle;
        model.Content = sContent;
        model.IsSend = 1;
        model.ReceiverDel = 0;
        model.SendDel = 0;
        model.OverdueDate = DateTime.Parse(sOverdueDate);
        model.AddDate = DateTime.Now;
        model.TypeId = 1;

        //所有用户
        if (sSelectUserType == "1")
        {
            model.ReceiverId = 0;
            model.ReceiverName = "";
            model.IsRead = 1;
            model.AllUser = 1;
            model.UserGroupId = 0;
            bll.Insert(model);

            Function.ShowSysMsg(1, "<li>成功向所有用户发送短消息!</li><li><a href='WebMessage/WebMessage.aspx'>继续发送短消息</a> <a href='WebMessage/WebMessageList.aspx'>返回短消息管理列表</a></li>");
        }

        //指定用户组
        if (sSelectUserType == "2")
        {
            model.ReceiverId = 0;
            model.ReceiverName = "";
            model.IsRead = 1;
            model.AllUser = 0;

            string MyUserGroupList = "";

            if (UserGroupList.Items.Count > 0)
            {
                for (int i = 0; i < UserGroupList.Items.Count; i++)
                {
                    if (UserGroupList.Items[i].Selected == true)
                    {
                        MyUserGroupList += UserGroupList.Items[i].Text+"、";
                        model.UserGroupId = int.Parse(UserGroupList.Items[i].Value.ToString());
                        bll.Insert(model);
                    }
                }
            }

            Function.ShowSysMsg(1, "<li>成功向" + MyUserGroupList.Substring(0, MyUserGroupList.Length - 1) + "组发送短消息!</li><li><a href='WebMessage/WebMessage.aspx'>继续发送短消息</a> <a href='WebMessage/WebMessageList.aspx'>返回短消息管理列表</a></li>");
        }

        //指定用户
        if (sSelectUserType == "3")
        {
            string sUserNmuber = UserNmuber.Text;
            if (sUserNmuber == "")
            {
                Function.ShowSysMsg(0, "<li>请输入用户</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
            }

            string MyUserNumber = "";

            for (int i = 0; i < Function.GetSplit(sUserNmuber, "|").Length; i++)
            {
                muser = buser.GetUser(Function.GetSplit(sUserNmuber, "|")[i]);

                if (muser!=null)
                {
                    MyUserNumber += Function.GetSplit(sUserNmuber, "|")[i] + "、";

                    model.ReceiverId = muser.UserID;
                    model.ReceiverName = muser.LogName;
                    model.IsRead = 0;
                    model.AllUser = 0;
                    model.UserGroupId = 0;
                    bll.Insert(model);
                }
            }
            Function.ShowSysMsg(1, "<li>成功向" + MyUserNumber.Substring(0, MyUserNumber.Length - 1) + "用户发送短消息!</li><li><a href='WebMessage/WebMessage.aspx'>继续发送短消息</a> <a href='WebMessage/WebMessageList.aspx'>返回短消息管理列表</a></li>");
        }
    }
Esempio n. 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        B_Admin admin = new B_Admin();
        admin.CheckMulitLogin();
        AjaxPro.Utility.RegisterTypeForAjax(typeof(System_user_SetUser));

        if (!string.IsNullOrEmpty(Request.QueryString["TypeId"]))
        {
            try
            {
                TypeId = int.Parse(Request.QueryString["TypeId"]);
            }
            catch { }
        }

        if (!IsPostBack)
        {
            BindddlistGroup();
        }
        //用户模型数据
        MUserGroupModel = BUserGroupModel.GetModel(TypeId);
        ModelHtml.Text = MUserGroupModel.ModelHtml;

        RepUserGroupModel.DataSource = BUserGroupModel.GetAll();
        RepUserGroupModel.DataBind();

        ModelName.Text = MUserGroupModel.Name;

        dtIsUser = BUserGroupModelField.GetIsUserList(TypeId);

        if (Request.QueryString["uid"] != null && Request.QueryString["uid"] != "")
        {
            userId = Function.CheckNumber(Request.QueryString["uid"]) ? int.Parse(Request.QueryString["uid"]) : 0;
            if (!IsPostBack)
            {
                ShowUser();
            }
        }

        //管理员新增用户
        //自动选择用户组为注册会员组
        if (userId == 0)
        {
        }
        //修改用户
        else
        {
            DivCnfmPwd.Visible = false;
            txtLogName.Enabled = false;
            lbDot.Visible = false;
        }
    }
Esempio n. 9
0
 public void Power_Judge(int ChId, int ColId, int TypeId, string ErrorTitle)
 {
     B_Admin admin = new B_Admin();
     M_LoginAdmin loginModel = admin.GetLoginModel();
     int groupId = admin.GetModel(loginModel.UserId).GroupId;
     if (!this.Power_Channel(ChId, ColId, groupId, TypeId))
     {
         Ky.Common.Function.ShowSysMsg(0, ErrorTitle);
     }
 }
Esempio n. 10
0
 public void Power_Judge(int ChId)
 {
     B_Admin admin = new B_Admin();
     M_LoginAdmin loginModel = admin.GetLoginModel();
     int groupId = admin.GetModel(loginModel.UserId).GroupId;
     M_PowerColumn model = new B_PowerColumn().GetModel(ChId);
     if (!this.Power_Column(ChId, groupId))
     {
         Ky.Common.Function.ShowSysMsg(0, model.ColumnErrorCodes);
     }
 }