Exemplo n.º 1
0
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            Notice n    = new Notice();
            Notice nold = bn.GetNoticesByID(Utils.StrToInt(hfNoticeID.Value, 0));

            n.NoticeID       = Utils.StrToInt(hfNoticeID.Value, 0);
            n.NoticeTitle    = PubCom.CheckString(txtTitle.Text.Trim());
            n.NoticeStatus   = dpStatus.SelectedValue;
            n.NoticeContent  = container.Text;
            n.LastUpdateDate = DateTime.Now;

            if (bn.Update(n) != 1)
            {
                Message.ShowWrong(this, "修改公告失败!");
            }
            else
            {
                //// 插入日志 add
                SysOperateLog log = new SysOperateLog();
                log.LogID           = StringHelper.getKey();
                log.LogType         = LogType.公告信息.ToString();
                log.OperateUser     = GetLogUserName();
                log.OperateDate     = DateTime.Now;
                log.LogOperateType  = "公告信息修改";
                log.LogBeforeObject = JsonHelper.Obj2Json(nold);
                log.LogAfterObject  = JsonHelper.Obj2Json(n);
                bsol.Insert(log);

                Message.ShowOKAndRedirect(this, "修改公告信息成功", "NoticeManage.aspx");
            }
        }
Exemplo n.º 2
0
        public JsonResult EditInfo(SysOperateLog EidModle)
        {
            HttpReSultMode ReSultMode = new HttpReSultMode();
            bool           IsAdd      = false;

            EidModle.OperateTime = DateTime.Now;
            if (!(EidModle.Id != null && !EidModle.Id.ToString().Equals("00000000-0000-0000-0000-000000000000")))//id为空,是添加
            {
                IsAdd = true;
            }
            if (IsAdd)
            {
                EidModle.Id        = Guid.NewGuid();
                EidModle.isDeleted = false;

                try
                {
                    OPBiz.Add(EidModle);

                    ReSultMode.Code = 11;
                    ReSultMode.Data = EidModle.Id.ToString();
                    ReSultMode.Msg  = "添加成功";
                }
                catch (Exception e)
                {
                    ReSultMode.Code = -11;
                    ReSultMode.Data = e.ToString();
                    ReSultMode.Msg  = "添加失败";
                }
            }
            return(Json(ReSultMode, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        protected void ZButton2_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < rprole.Items.Count; i++)
            {
                SysRole sr = new SysRole();

                sr.RoleID   = int.Parse((rprole.Items[i].FindControl("zlsc") as ZLinkButton).CommandArgument);
                sr.RoleName = PubCom.CheckString((rprole.Items[i].FindControl("tRoleName") as TextBox).Text.Trim());
                sr.IsUse    = (rprole.Items[i].FindControl("cIsUse") as CheckBox).Checked;
                var oldrole = JsonHelper.Obj2Json(br.GetRoleByID(sr.RoleID));
                br.Update(sr);
                if (oldrole == JsonHelper.Obj2Json(sr))
                {
                    // 插入日志
                    SysOperateLog log = new SysOperateLog();
                    log.LogID           = StringHelper.getKey();
                    log.LogType         = LogType.角色信息.ToString();
                    log.OperateUser     = GetLogUserName();
                    log.OperateDate     = DateTime.Now;
                    log.LogOperateType  = "角色修改";
                    log.LogBeforeObject = oldrole;
                    log.LogAfterObject  = JsonHelper.Obj2Json(sr);
                    bsol.Insert(log);
                }
            }
            BindRoleList();



            Message.ShowOK(this, "修改完成");
        }
Exemplo n.º 4
0
        protected void rplist_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int did = int.Parse(e.CommandArgument.ToString());

            if (e.CommandName == "sc")
            {
                if (bd.Delete(new SysDepartment()
                {
                    DepartmentID = did
                }) != 1)
                {
                    Message.ShowWrong(this, "删除失败");
                    return;
                }
                else
                {
                    // 插入日志
                    SysOperateLog log = new SysOperateLog();
                    log.LogID           = StringHelper.getKey();
                    log.LogType         = LogType.部门信息.ToString();
                    log.OperateUser     = GetLogUserName();
                    log.OperateDate     = DateTime.Now;
                    log.LogOperateType  = "部门删除";
                    log.LogBeforeObject = JsonHelper.Obj2Json(bd.GetDepartmentByID(did));

                    bsol.Insert(log);
                    Message.ShowOK(this.Page, "删除成功");
                    BindList();
                }
            }
        }
Exemplo n.º 5
0
        protected void ZButton1_Click(object sender, EventArgs e)
        {
            bro.DeleteByRoleID(roleid);
            for (int i = 0; i < rproleoperate.Items.Count; i++)
            {
                CheckBoxList cbl = rproleoperate.Items[i].FindControl("cboperate") as CheckBoxList;
                foreach (ListItem li in cbl.Items)
                {
                    if (li.Selected)
                    {
                        SysRoleOperate sro = new SysRoleOperate();
                        sro.OperateID = int.Parse(li.Value);
                        sro.RoleID    = roleid;
                        bro.Insert(sro);
                        // 插入日志
                        SysOperateLog log = new SysOperateLog();
                        log.LogID          = StringHelper.getKey();
                        log.LogType        = LogType.角色信息.ToString();
                        log.LogObjectID    = sro.RoleID.ToString();
                        log.LogObjectName  = br.GetRoleByID(sro.RoleID).RoleName;
                        log.OperateUser    = GetLogUserName();
                        log.OperateDate    = DateTime.Now;
                        log.LogOperateType = "角色设置操作添加";
                        log.LogAfterObject = JsonHelper.Obj2Json(sro);

                        bsol.Insert(log);
                    }
                }
            }
            BUser bu = new BUser();

            bu.ReSetUserRoleOperate(roleid);//没有方法
            Message.ShowOKAndRedirect(this, "修改成功", "RoleManage.aspx");
        }
Exemplo n.º 6
0
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            var usermodel = bu.GetUserByUserID(userID);

            if (usermodel.UserPassword == EncryptHelper.EncryptPassword(PubCom.CheckString(txtOldPsw.Text.Trim()), Constants.PassWordEncodeType))
            {
                string newpsw = EncryptHelper.EncryptPassword(PubCom.CheckString(txtNewPsw.Text.Trim()), Constants.PassWordEncodeType);//new密码
                if (bu.Update(new SysUser()
                {
                    UserID = userID, UserPassword = newpsw
                }) == 1)
                {
                    // 插入日志
                    SysOperateLog log = new SysOperateLog();
                    log.LogID           = StringHelper.getKey();
                    log.LogType         = LogType.帐户信息.ToString();
                    log.LogObjectID     = userID;
                    log.LogObjectName   = "[" + usermodel.UserLoginName + "]" + usermodel.UserName;
                    log.OperateUser     = GetLogUserName();
                    log.OperateDate     = DateTime.Now;
                    log.LogOperateType  = "密码重置";
                    log.LogBeforeObject = JsonHelper.Obj2Json <string>("[原密码:]" + usermodel.UserPassword);
                    log.LogAfterObject  = JsonHelper.Obj2Json <string>("[新密码:]" + EncryptHelper.Encode(newpsw));
                    bsol.Insert(log);

                    Message.ShowOKAndBack(this, "修改密码成功!");
                }
            }
            else
            {
                Message.ShowWrong(this, "用户密码错误,请重试!");
            }
        }
Exemplo n.º 7
0
        public JsonResult GetInfo(string ID)
        {
            var           mql2   = SysOperateLogSet.SelectAll().Where(SysOperateLogSet.Id.Equal(ID));
            SysOperateLog Rmodel = OPBiz.GetEntity(mql2);

            return(Json(Rmodel, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 8
0
        protected void zbupdate_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < rpoperate.Items.Count; i++)
            {
                CheckBox cb = rpoperate.Items[i].FindControl("cboperate") as CheckBox;
                if (cb.Checked)
                {
                    if (!bo.IsHaveOperareName(mid, cb.Text.Trim()))
                    {
                        SysOperate so = new SysOperate();
                        so.MenuID      = mid;
                        so.OperateID   = bo.GetMaxID() + 1;
                        so.OperateName = cb.Text.Trim();
                        bo.Insert(so);
                        //bo.Insert(new SysOperate() { MenuID = mid, OperateID = bo.GetMaxID() + 1, OperateName = cb.Text.Trim() });
                        SysOperateLog log = new SysOperateLog();
                        log.LogID          = StringHelper.getKey();
                        log.LogType        = LogType.菜单信息.ToString();
                        log.LogObjectID    = mid.ToString();
                        log.LogObjectName  = bm.GetSysMenuByID(mid).MenuName;
                        log.OperateUser    = GetLogUserName();
                        log.OperateDate    = DateTime.Now;
                        log.LogOperateType = "设置操作";

                        log.LogAfterObject = JsonHelper.Obj2Json(so);
                        log.LogRemark      = "添加的菜单操作";
                        bsol.Insert(log);
                    }
                }
            }

            Response.Redirect("MenuManage.aspx");
        }
Exemplo n.º 9
0
        protected void ZButton1_Click(object sender, EventArgs e)
        {
            SysDepartment sd = new SysDepartment();

            sd.DepartmentID   = bd.GetMaxID() + 1;
            sd.DepartmentName = PubCom.CheckString(txtDepartmentName.Text.Trim());
            sd.IsUse          = cbIsUse.Checked;

            if (bd.Insert(sd) != 1)
            {
                Message.ShowWrong(this, "添加失败");
                return;
            }
            else
            {
                // 插入日志
                SysOperateLog log = new SysOperateLog();
                log.LogID          = StringHelper.getKey();
                log.LogType        = LogType.部门信息.ToString();
                log.LogObjectID    = sd.DepartmentID.ToString();
                log.LogObjectName  = sd.DepartmentName;
                log.OperateUser    = GetLogUserName();
                log.OperateDate    = DateTime.Now;
                log.LogOperateType = "部门添加";
                log.LogAfterObject = JsonHelper.Obj2Json(sd);

                bsol.Insert(log);
                Message.ShowOK(this, "添加成功");
                BindList();
            }
        }
Exemplo n.º 10
0
        protected void ZButton2_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < rplist.Items.Count; i++)
            {
                SysDepartment sd = new SysDepartment();

                sd.DepartmentID   = int.Parse((rplist.Items[i].FindControl("zlsc") as ZLinkButton).CommandArgument);
                sd.DepartmentName = PubCom.CheckString((rplist.Items[i].FindControl("tDepartmentName") as TextBox).Text.Trim());
                sd.IsUse          = (rplist.Items[i].FindControl("cIsUse") as CheckBox).Checked;


                var olddepartment = JsonHelper.Obj2Json(bd.GetDepartmentByID(sd.DepartmentID));
                bd.Update(sd);
                if (olddepartment == JsonHelper.Obj2Json(sd))
                {
                    // 插入日志
                    SysOperateLog log = new SysOperateLog();
                    log.LogID           = StringHelper.getKey();
                    log.LogType         = LogType.部门信息.ToString();
                    log.OperateUser     = GetLogUserName();
                    log.OperateDate     = DateTime.Now;
                    log.LogOperateType  = "部门修改";
                    log.LogBeforeObject = olddepartment;
                    log.LogAfterObject  = JsonHelper.Obj2Json(sd);
                    bsol.Insert(log);
                }
            }
            BindList();
            Message.ShowOK(this, "修改完成");
        }
Exemplo n.º 11
0
        void BindList()
        {
            Query  q    = Query.Build(new { SortFields = "AreaID" });
            string name = PubCom.CheckString(txtAreaName.Text.Trim());

            if (name != "")
            {
                q.Add("AreaName", name);
            }
            int rec = 0;

            //获取数据列表
            rplist.DataSource = ba.GetAreaList(q, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out rec);
            rplist.DataBind();
            //赋值起始页
            AspNetPager1.RecordCount = rec;
            //// 插入日志
            SysOperateLog log = new SysOperateLog();

            log.LogID          = StringHelper.getKey();
            log.LogType        = LogType.地区信息.ToString();
            log.OperateUser    = GetLogUserName();
            log.OperateDate    = DateTime.Now;
            log.LogOperateType = "地区查询";
            log.LogAfterObject = JsonHelper.Obj2Json <string>(q.GetCondition(true));
            bsol.Insert(log);
        }
Exemplo n.º 12
0
        protected void ZButton1_Click(object sender, EventArgs e)
        {
            SysRole sr = new SysRole();

            sr.RoleID   = br.GetMaxID() + 1;
            sr.RoleName = PubCom.CheckString(txtRoleName.Text.Trim());
            sr.IsUse    = cbIsUse.Checked;

            if (br.Insert(sr) != 1)
            {
                Message.ShowWrong(this, "添加失败");
                return;
            }
            else
            {
                // 插入日志
                SysOperateLog log = new SysOperateLog();
                log.LogID          = StringHelper.getKey();
                log.LogType        = LogType.角色信息.ToString();
                log.LogObjectID    = sr.RoleID.ToString();
                log.LogObjectName  = sr.RoleName;
                log.OperateUser    = GetLogUserName();
                log.OperateDate    = DateTime.Now;
                log.LogOperateType = "角色添加";
                log.LogAfterObject = JsonHelper.Obj2Json <SysRole>(sr);

                bsol.Insert(log);

                Message.ShowOK(this, "添加成功");
                BindRoleList();
            }
        }
Exemplo n.º 13
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            SysUser su = new SysUser();

            su.UserID        = System.Guid.NewGuid().ToString("N");//ID生成策略
            su.UserLoginName = txtUserLoginName.Text.Trim();
            su.UserName      = txtUserName.Text.Trim();
            su.UserPassword  = EncryptHelper.EncryptPassword(Constants.DefaultPassword, Constants.PassWordEncodeType);//默认密码
            su.Tel           = txtTel.Text.Trim();
            su.Sex           = rbsex.SelectedValue;
            su.RegDate       = DateTime.Now;
            su.Phone         = txtPhone.Text.Trim();
            su.IsMain        = true;
            su.Email         = txtMail.Text.Trim();
            su.IsUse         = true;
            su.UserType      = UserType.普通管理员.ToString();
            su.UserStatus    = UserStatus.审核通过.ToString();

            if (bu.GetUserByUserLoginName(su.UserLoginName) != null)
            {
                Message.ShowWrong(this, "用户登录名已经存在");
                txtUserLoginName.Focus();
                return;
            }
            int rec = bu.Insert(su);

            if (rec == 1)
            {
                foreach (ListItem li in lbseleted.Items)
                {
                    bur.Insert(new SysUserRole()
                    {
                        RoleID = int.Parse(li.Value.Trim()), UserID = su.UserID
                    });
                }


                // 插入日志
                SysOperateLog log = new SysOperateLog();
                log.LogID          = StringHelper.getKey();
                log.LogType        = LogType.帐户信息.ToString();
                log.LogObjectID    = su.UserID;
                log.LogObjectName  = "[" + su.UserLoginName + "]" + su.UserName;
                log.OperateUser    = GetLogUserName();
                log.OperateDate    = DateTime.Now;
                log.LogOperateType = "用户添加";
                log.LogAfterObject = JsonHelper.Obj2Json <SysUser>(su);

                bsol.Insert(log);

                Message.ShowOKAndRedirect(this, "添加成功,初始密码为:" + Constants.DefaultPassword, "UserManage.aspx");
            }
            else
            {
                Message.ShowWrong(this, "添加失败");
            }
        }
Exemplo n.º 14
0
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            Project p = new Project();

            p.ProjectID      = bp.GetMaxID() + 1;
            p.ProjectName    = PubCom.CheckString(txtName.Text.Trim());
            p.ProjectContent = PubCom.CheckString(txtContent.Text.Trim());
            p.ProjectPeriod  = DpProjectPeriod.SelectedValue;
            p.OrgName        = PubCom.CheckString(txtOrgName.Text.Trim());
            p.StartTime      = DateTime.Parse(StarTime.Text.Trim());
            p.EndTime        = DateTime.Parse(EndTime.Text.Trim());
            string str = txtProjectStage.Text.Trim();

            str            = str.Replace("<", "&lt;");
            str            = str.Replace(">", "&gt;");
            str            = str.Replace(" ", "&nbsp;");
            str            = str.Replace("\r\n", "<br>");
            p.ProjectStage = str;
            if (dpExpert.SelectedValue != "")
            {
                p.ExpertID = Utils.StrToInt(dpExpert.SelectedValue, 0);
            }
            if (dpLm.SelectedValue != "")
            {
                p.LmMemberID = Utils.StrToInt(dpLm.SelectedValue, 0);
            }
            if (dpTd.SelectedValue != "")
            {
                p.TdMemberID = Utils.StrToInt(dpTd.SelectedValue, 0);
            }
            if (dpstu.SelectedValue != "")
            {
                p.StuMemberID = Utils.StrToInt(dpstu.SelectedValue, 0);
            }

            if (bp.Insert(p) == 1)
            {
                //// 插入日志 add
                SysOperateLog log = new SysOperateLog();
                log.LogID          = StringHelper.getKey();
                log.LogType        = LogType.项目信息.ToString();
                log.OperateUser    = GetLogUserName();
                log.OperateDate    = DateTime.Now;
                log.LogOperateType = "项目新增";

                log.LogAfterObject = JsonHelper.Obj2Json(p);
                bsol.Insert(log);
                Message.ShowOKAndRedirect(this, "添加项目成功", "ProjectManage.aspx");
            }

            else
            {
                Message.ShowWrong(this, "添加项目失败!");
                return;
            }
        }
Exemplo n.º 15
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            SysUser oldsu = bu.GetUserByUserID(hfID.Value);

            SysUser su = new SysUser();

            su.UserID        = hfID.Value;
            su.UserLoginName = txtUserLoginName.Text.Trim();
            su.UserName      = txtUserName.Text.Trim();
            su.Phone         = txtPhone.Text.Trim();
            su.Tel           = txtTel.Text.Trim();
            su.Sex           = rbsex.SelectedValue;
            su.Email         = txtMail.Text.Trim();
            su.IsUse         = true;

            if (bu.GetUserByUserLoginName(su.UserLoginName) != null && su.UserLoginName != oldsu.UserLoginName)
            {
                Message.ShowWrong(this, "用户登录名已经存在");
                txtUserLoginName.Focus();
                return;
            }
            int rec = bu.Update(su);

            if (rec == 1)
            {
                bur.DeleteByUserID(UserID);
                foreach (ListItem li in lbseleted.Items)
                {
                    bur.Insert(new SysUserRole()
                    {
                        RoleID = int.Parse(li.Value.Trim()), UserID = su.UserID
                    });
                }


                // 插入日志
                SysOperateLog log = new SysOperateLog();
                log.LogID           = StringHelper.getKey();
                log.LogType         = LogType.帐户信息.ToString();
                log.LogObjectID     = su.UserID;
                log.LogObjectName   = "[" + su.UserLoginName + "]" + su.UserName;
                log.OperateUser     = GetLogUserName();
                log.OperateDate     = DateTime.Now;
                log.LogOperateType  = "用户修改";
                log.LogBeforeObject = JsonHelper.Obj2Json <SysUser>(oldsu);
                log.LogAfterObject  = JsonHelper.Obj2Json <SysUser>(su);

                bsol.Insert(log);

                Message.ShowOKAndRedirect(this, "修改成功", "UserManage.aspx");
            }
            else
            {
                Message.ShowWrong(this, "修改失败");
            }
        }
Exemplo n.º 16
0
        private void BindList()
        {
            hfID.Value = LogID;
            SysOperateLog log = bsol.GetSysOperateLogByID(LogID);

            ltLogType.Text         = log.LogType;
            ltOperateUser.Text     = log.OperateUser;
            ltLogOperateType.Text  = log.LogOperateType;
            ltLogBeforeObject.Text = log.LogBeforeObject;
            ltLogAfterObject.Text  = log.LogAfterObject;
            ltLogRemark.Text       = log.LogRemark;
        }
Exemplo n.º 17
0
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            New            n    = new New();
            BNew           bn   = new BNew();
            BSysOperateLog bsol = new BSysOperateLog();

            n.NewsID      = bn.GetMaxID() + 1;
            n.IsTop       = CbIstop.Checked;
            n.IsHot       = CbIsHot.Checked;
            n.NewsContent = container.Text;
            n.SubmitTime  = DateTime.Now;
            //n.SavePath = "details" + DateTime.Now.Year + "_" + DateTime.Now.Month + "/" +DateTime.Now.Day;
            n.Uploader   = PubCom.CheckString(txtauthor.Text.Trim());
            n.Title      = PubCom.CheckString(txtTitle.Text.Trim());
            n.summary    = PubCom.CheckString(txtsummary.Text.Trim());
            n.NewsType   = dpNewstype.SelectedValue;
            n.StaticType = dpstatictype.SelectedValue;
            //string PicUrl = "";
            //if (UploadValidate(out PicUrl))
            //{
            //    n.IsImg = 1;
            //    mp.Id = mpm.GetMaxID() + 1;
            //    mp.NewsId = n.Id;
            //    mp.Title = pic_upload.FileName;
            //    mp.PicUrl = PicUrl;
            //    mpm.Insert(mp);
            //}
            //else
            //{
            //    n.IsImg = 1;
            //}NewsManage

            if (bn.Insert(n) != 1)
            {
                Message.ShowWrong(this, "添加文章失败!");
            }
            else
            {
                bn.UploadValidate(pic_upload, lbl_pic, PicFilePath, n.NewsID);
                //// 插入日志 add
                SysOperateLog log = new SysOperateLog();
                log.LogID          = StringHelper.getKey();
                log.LogType        = LogType.新闻信息.ToString();
                log.OperateUser    = GetLogUserName();
                log.OperateDate    = DateTime.Now;
                log.LogOperateType = "新闻新增";

                log.LogAfterObject = JsonHelper.Obj2Json(n);
                bsol.Insert(log);
                Message.ShowOKAndRedirect(this, "添加文章成功", "NewsManage.aspx");
            }
        }
Exemplo n.º 18
0
        protected void rpmenu_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int mid = int.Parse(e.CommandArgument.ToString());

            if (e.CommandName == "sc")
            {
                Query qm = Query.Build(new { IsVisiable = 1, SortFields = "ParentMenuID,MenuSort" });

                qm.Append("ParentMenuID=" + mid);
                if (bm.GetMenuList(qm).Count != 0)
                {
                    Message.ShowWrong(this.Page, "请先删除子项");
                    return;
                }
                if (bm.Delete(new SysMenu()
                {
                    MenuID = mid
                }) != 1)
                {
                    Message.ShowWrong(this, "删除失败");
                    return;
                }
                else
                {
                    try
                    {
                        SysOperateLog log = new SysOperateLog();
                        log.LogID           = StringHelper.getKey();
                        log.LogType         = LogType.菜单信息.ToString();
                        log.LogObjectID     = mid.ToString();
                        log.LogObjectName   = bm.GetSysMenuByID(mid).MenuName;
                        log.OperateUser     = GetLogUserName();
                        log.OperateDate     = DateTime.Now;
                        log.LogOperateType  = "菜单删除";
                        log.LogBeforeObject = JsonHelper.Obj2Json(bm.GetSysMenuByID(mid));

                        bsol.Insert(log);
                        Message.ShowOK(this.Page, "删除成功");
                    }
                    catch (Exception ex)
                    {
                        Message.ShowWrong(this, "日志错误:" + ex);
                    }

                    BindMenu();
                }
            }
            if (e.CommandName == "setoperate")
            {
                Response.Redirect("OperateManage.aspx?ID=" + EncryptHelper.Encode(mid.ToString()));
            }
        }
Exemplo n.º 19
0
        private void BindingList()
        {
            Query qm = Query.Build(new { SortFields = "IsTop Desc,IsHot Desc,SubmitTime Desc" });

            string Title = PubCom.CheckString(txtTitle.Text.Trim());

            if (Title != "")
            {
                qm.Add("Title", Title);
            }
            string Author = PubCom.CheckString(txtAuthor.Text.Trim());

            if (Author != "")
            {
                qm.Add("Uploader", Author);
            }
            string Subtime = PubCom.CheckString(StarTime.Text.Trim());


            if (Subtime != "")
            {
                qm.Add("Subtime", DateTime.Parse(Subtime));
            }

            if (dpIsTop.SelectedValue != "")
            {
                qm.Add("IsTop", dpIsTop.SelectedValue == "1");
            }

            if (dpIsHot.SelectedValue != "")
            {
                qm.Add("IsHot", dpIsHot.SelectedValue == "1");
            }

            int ret = 0;

            rplist.DataSource = bn.GetNewsList(qm, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out ret);
            rplist.DataBind();
            AspNetPager1.RecordCount = ret;

            // 插入日志  query
            SysOperateLog log = new SysOperateLog();

            log.LogID          = StringHelper.getKey();
            log.LogType        = LogType.新闻信息.ToString();
            log.OperateUser    = GetLogUserName();
            log.OperateDate    = DateTime.Now;
            log.LogOperateType = "用户查询";
            log.LogAfterObject = JsonHelper.Obj2Json <string>(qm.GetCondition(true));
            bsol.Insert(log);
        }
Exemplo n.º 20
0
        protected void rplist_OnItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int    id    = int.Parse(e.CommandArgument.ToString());
            var    model = bn.GetToolsByID(id);
            string realpath;

            if (e.CommandName == "bj")
            {
                Response.Redirect("ToolEdit.aspx?ID=" + e.CommandArgument);
            }
            else if (e.CommandName == "sc")
            {
                if (bn.Delete(model) == 1)
                {
                    //// 插入日志  delete
                    SysOperateLog log = new SysOperateLog();
                    log.LogID           = StringHelper.getKey();
                    log.LogType         = LogType.工具信息.ToString();
                    log.OperateUser     = GetLogUserName();
                    log.OperateDate     = DateTime.Now;
                    log.LogOperateType  = "工具信息删除";
                    log.LogBeforeObject = JsonHelper.Obj2Json(model);
                    bsol.Insert(log);

                    Message.ShowOK(this, "删除工具信息成功!");
                }


                else
                {
                    Message.ShowWrong(this, "删除工具信息失败");
                }
            }
            else if (e.CommandName == "xz")
            {
                //做个判定
                if (model.PathType == PathType.务器.ToString())
                {
                    realpath = PicFilePathV + "ToolAttach/" + model.ToolPath;
                }
                else /*if (model.PathType == PathType.链接.ToString())*/
                {
                    realpath = model.ToolPath;
                }

                bn.DownloadFile(realpath);
            }

            BindingList();
        }
Exemplo n.º 21
0
        private void BindingList()
        {
            Query qm = Query.Build(new { SortFields = "LastUpdateDate Desc" });


            string Title = PubCom.CheckString(txtTitle.Text.Trim());

            if (Title != "")
            {
                qm.Add("NoticeTitle", Title);
            }
            string CreateUser = PubCom.CheckString(txtCreateUser.Text.Trim());

            if (CreateUser != "")
            {
                qm.Add("CreateUser", CreateUser);
            }
            string Subtime = PubCom.CheckString(StarTime.Text.Trim());


            if (Subtime != "")
            {
                qm.Add("CreateDate", DateTime.Parse(Subtime));
            }

            if (dpNoticeStatus.SelectedValue != "")
            {
                qm.Add("NoticeStatus", dpNoticeStatus.SelectedValue);
            }


            int ret = 0;

            rplist.DataSource = bn.GetNoticesList(qm, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out ret);
            rplist.DataBind();
            AspNetPager1.RecordCount = ret;
            // 插入日志  query
            SysOperateLog log = new SysOperateLog();

            log.LogID          = StringHelper.getKey();
            log.LogType        = LogType.公告信息.ToString();
            log.OperateUser    = GetLogUserName();
            log.OperateDate    = DateTime.Now;
            log.LogOperateType = "公告信息查询";
            log.LogAfterObject = JsonHelper.Obj2Json <string>(qm.GetCondition(true));
            bsol.Insert(log);
        }