Beispiel #1
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();
            }
        }
Beispiel #2
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();
            }
        }
Beispiel #3
0
        void BindList()
        {
            Query q = Query.Build(new { SortFields = "Regdate desc" });

            //q.Add("UserStatus", UserStatus.审核通过.ToString());

            q.In("UserID", bur.GetVistorUserID().Select(p => p.UserID).Distinct().ToArray());
            q.Add("UserType", UserType.访客.ToString());
            string username = PubCom.CheckString(txtUserName.Text.Trim());

            if (username != "")
            {
                q.Add("UserName", username);
            }
            string userloginname = PubCom.CheckString(txtUserLoginName.Text.Trim());

            if (userloginname != "")
            {
                q.Add("UserLoginName", userloginname);
            }
            string orgname = PubCom.CheckString(txtOrgName.Text.Trim());

            if (orgname != "")
            {
                q.Add("OrgName", orgname);
            }
            if (dpUserRole.SelectedValue != "全部")
            {
                q.Append("UserID in(select UserID from SysUserRole where RoleID='" + dpUserRole.SelectedValue + "')");
            }
            if (dpUserStatus.SelectedValue != "全部")
            {
                if (dpUserStatus.SelectedValue == "启用")
                {
                    q.Add("IsUse", true);
                }
                else
                {
                    q.Add("IsUse", false);
                }
            }

            int rec = 0;

            rplist.DataSource = bu.GetUserList(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);
        }
Beispiel #4
0
        private void BindingList()
        {
            Query qm = Query.Build(new { SortFields = "MemberID" });

            qm.Add("MemberType", MemberType.普通学生.ToString());
            string Name = PubCom.CheckString(txtName.Text.Trim());

            if (Name != "")
            {
                qm.Add("MemberName", Name);
            }
            string Phone = PubCom.CheckString(txtPhone.Text.Trim());

            if (Phone != "")
            {
                qm.Add("Phone", Phone);
            }
            string Email = PubCom.CheckString(txtEmail.Text.Trim());

            if (Email != "")
            {
                qm.Add("Email", Email);
            }
            string Qualification = PubCom.CheckString(txtQualification.Text.Trim());

            if (Qualification != "")
            {
                qm.Add("Qualification", Qualification);
            }
            string Organization = PubCom.CheckString(txtOrganization.Text.Trim());

            if (Organization != "")
            {
                qm.Add("Organization", Organization);
            }

            int ret = 0;

            rplist.DataSource = bm.GetMembersList(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);
        }
Beispiel #5
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);
        }
Beispiel #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, "用户密码错误,请重试!");
            }
        }
Beispiel #7
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            SysCode sc = new SysCode();

            sc.CodeID    = bsc.GetMaxID() + 1;
            sc.CodeName  = PubCom.CheckString(txtCodeName.Text.Trim());
            sc.CodeText  = PubCom.CheckString(txtCodeText.Text.Trim());
            sc.CodeValue = PubCom.CheckString(txtCodeValue.Text.Trim());
            sc.SortNo    = int.Parse(txtSortNo.Text.Trim());

            if (bsc.Insert(sc) != 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.LogAfterObject = JsonHelper.Obj2Json(sc);
                bsol.Insert(log);
                Message.ShowOKAndReflashParent(this, "添加成功", "zbquery");
            }
        }
Beispiel #8
0
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            Dynamic d = new Dynamic();


            d.DynamicID   = bd.GetMaxID() + 1;
            d.DynamicType = DynamicType.团队动态.ToString();
            d.IsTop       = CbIstop.Checked;

            d.Content  = container.Text;
            d.SubTime  = DateTime.Now;
            d.Uploader = GetLogUserName();
            d.Title    = PubCom.CheckString(txtTitle.Text.Trim());


            if (bd.Insert(d) != 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.LogAfterObject = JsonHelper.Obj2Json(d);
                bsol.Insert(log);

                Message.ShowOKAndRedirect(this, "添加团队动态成功", "TDDynamicManage.aspx");
            }
        }
Beispiel #9
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");
            }
        }
Beispiel #10
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);
        }
Beispiel #11
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");
        }
Beispiel #12
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");
        }
Beispiel #13
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);
        }
Beispiel #14
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, "添加失败");
            }
        }
Beispiel #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, "修改失败");
            }
        }
Beispiel #16
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;
            }
        }
Beispiel #17
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            Tool a = new Tool();

            a.ToolID     = ba.GetMaxID() + 1;
            a.ToolName   = PubCom.CheckString(txtToolName.Text.Trim());
            a.UploadTime = DateTime.Now;
            a.Uploader   = GetLogUserName();
            a.ToolType   = dpToolType.SelectedValue;
            a.PathType   = dppathtype.SelectedValue;
            a.ToolPath   = PubCom.CheckString(txtToolPath.Text.Trim());
            string Extension = Path.GetExtension(PubCom.CheckString(txtToolName.Text.Trim())); //扩展名 ".aspx"

            if (string.IsNullOrEmpty(Extension))
            {
                Message.ShowWrong(this, "请输入文件后缀名!如.mp4");
                return;
            }
            else
            {
                a.ToolSuffix = Extension.Substring(1, Extension.Length);
            }
            //int ret = 0;
            //if (rec == 1)
            //{

            //    HttpFileCollection htf = Request.Files;

            //   ret = ba.UploadFile(htf[0], PicFilePath, a.ToolID,dpToolType.SelectedValue);


            //}


            if (ba.Update(a) == 1)
            {
                //// 插入日志
                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(a);//不包含附件
                log.LogRemark      = "";
                bsol.Insert(log);
                Message.ShowOKAndRedirect(this, "修改成功", "ToolManage.aspx");
            }
            else
            {
                Message.ShowWrong(this, "修改失败");
            }
        }
Beispiel #18
0
        void BindList()
        {
            var qm = Query.Build(new { SortFields = "CodeName desc,SortNo" });

            string name = PubCom.CheckString(txtCodeName.Text.Trim());

            if (name != "")
            {
                qm.Add("CodeName", name);
            }

            string text = PubCom.CheckString(txtCodeText.Text.Trim());

            if (text != "")
            {
                qm.Add("CodeText", text);
            }

            string value = PubCom.CheckString(txtCodeValue.Text.Trim());

            if (value != "")
            {
                qm.Add("CodeValue", value);
            }

            int rec = 0;

            rplist.DataSource = bsc.GetSysCodeList(qm, 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>(qm.GetCondition(true));
            bsol.Insert(log);
        }
Beispiel #19
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");
            }
        }
Beispiel #20
0
        private void BindingList()
        {
            Query qm = Query.Build(new { SortFields = "IsTop, Sort" });


            string Name = PubCom.CheckString(txtExpertName.Text.Trim());

            if (Title != "")
            {
                qm.Add("EName", Name);
            }
            string country = PubCom.CheckString(txtCountry.Text.Trim());

            if (country != "")
            {
                qm.Add("ECountry", country);
            }

            if (dpIsTop.SelectedValue != "")
            {
                qm.Append(dpIsTop.SelectedValue == "0" ? "IsTop=0" : "IsTop=1 or IsTop is null");
            }

            int ret = 0;

            rplist.DataSource = be.GetExpertsList(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);
        }
Beispiel #21
0
        protected void ZButton1_Click(object sender, EventArgs e)
        {
            SysMenu sm = new SysMenu();

            sm.MenuID       = bm.GetMaxID() + 1;
            sm.MenuName     = PubCom.CheckString(txtMenuName.Text.Trim());
            sm.MenuSort     = int.Parse(PubCom.CheckString(txtMenuSort.Text.Trim()));
            sm.ParentMenuID = int.Parse(PubCom.CheckString(txtParentMenuID.Text.Trim()));
            sm.MenuType     = "";
            sm.ModuleCode   = PubCom.CheckString(txtModuleCode.Text.Trim());
            sm.PageUrl      = txtPageUrl.Text.Trim();
            sm.IsLeaf       = cbIsLeaf.Checked;
            sm.IsVisiable   = cbIsVisiable.Checked;

            if (bm.Insert(sm) != 1)
            {
                Message.ShowWrong(this, "添加失败");
                return;
            }
            else
            {
                // 插入日志
                SysOperateLog log = new SysOperateLog();
                log.LogID          = StringHelper.getKey();
                log.LogType        = LogType.菜单信息.ToString();
                log.LogObjectID    = sm.MenuID.ToString();
                log.LogObjectName  = sm.MenuName;
                log.OperateUser    = GetLogUserName();
                log.OperateDate    = DateTime.Now;
                log.LogOperateType = "菜单添加";
                log.LogAfterObject = JsonHelper.Obj2Json <SysMenu>(sm);

                bsol.Insert(log);

                Message.ShowOK(this, "添加成功");
                BindMenu();
            }
        }
Beispiel #22
0
        private void BindingList()
        {
            Query qm = new Query();

            qm.OrderBy("CHARINDEX(RTRIM(CAST(ToolType as NCHAR)),'视频文件,文本文件,压缩文件'), UploadTime desc");

            string name = PubCom.CheckString(txtName.Text.Trim());

            if (name != "")
            {
                qm.Add("ToolName", name);
            }


            if (dpToolType.SelectedValue != "")
            {
                qm.Add("ToolType", dpToolType.SelectedValue);
            }


            int ret = 0;

            rplist.DataSource = bn.GetToolsList(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);
        }
Beispiel #23
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            Tool a = new Tool();

            a.ToolID = ba.GetMaxID() + 1;

            a.ToolName   = PubCom.CheckString(txtToolName.Text.Trim());
            a.UploadTime = DateTime.Now;
            a.Uploader   = GetLogUserName();
            a.ToolType   = dpToolType.SelectedValue;
            //做个判定
            a.PathType = dppathtype.SelectedValue;
            a.ToolPath = PubCom.CheckString(txtToolPath.Text.Trim());
            string Extension = Path.GetExtension(PubCom.CheckString(txtToolPath.Text.Trim())); //扩展名 ".aspx"

            if (string.IsNullOrEmpty(Extension))
            {
                Message.ShowWrong(this, "请输入文件后缀名!如.mp4");
                return;
            }
            else
            {
                a.ToolSuffix = Extension.Substring(1);
            }
            if (ba.Insert(a) == 1)
            {
                //// 插入日志
                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(a); //不包含附件
                log.LogRemark      = "";
                bsol.Insert(log);
                Message.ShowOKAndRedirect(this, "添加成功", "ToolManage.aspx");
            }
            else
            {
                Message.ShowWrong(this, "添加失败");
            }
        }
Beispiel #24
0
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            string savepath = DateTime.Now.Year + "_" + DateTime.Now.Month + "/" + DateTime.Now.Day;
            Expert exold    = be.GetExpertsByID(Utils.StrToInt(hfexpertid.Value, 0));
            Expert ex       = new Expert();

            ex.ExpertID = Utils.StrToInt(hfexpertid.Value, 0);
            ex.EName    = PubCom.CheckString(txtEName.Text.Trim());
            ex.ECountry = PubCom.CheckString(txtECountry.Text.Trim());
            ex.ESummary = PubCom.CheckString(txtESummary.Text.Trim());
            if (dpIstop.SelectedValue != "")
            {
                ex.Istop = dpIstop.SelectedValue == "1";
            }
            if (dpEIdentification.SelectedValue != "")
            {
                ex.EIdentification = dpEIdentification.SelectedValue;
            }
            if (be.Update(ex) == 1)
            {
                be.UploadValidate(pic_upload, lbl_pic, PicFilePath, savepath, ex.ExpertID);

                // 插入日志  update

                Expert        exnew = be.GetExpertsByID(Utils.StrToInt(hfexpertid.Value, 0));
                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(exold);
                log.LogAfterObject  = JsonHelper.Obj2Json(exnew);
                bsol.Insert(log);
                Message.ShowOKAndRedirect(this, "修改专家成功", "ExpertManage.aspx");
            }

            else
            {
                Message.ShowWrong(this, "修改专家失败!");
                return;
            }
        }
Beispiel #25
0
        private void BindList()
        {
            Query  q        = Query.Build(new { SortFields = "OperateDate desc" });
            string LogTypes = PubCom.CheckString(dpLogType.SelectedValue.Trim());

            string OperateUser = PubCom.CheckString(txtOperateUser.Text.Trim());

            if (LogTypes != "==请选择==")
            {
                q.Add("LogType", LogTypes);
            }

            //处理日期类
            if (StarTime.Text.Trim() != "")
            {
                q.Gt("OperateDate", StarTime.Text.Trim());
            }
            if (EndTime.Text.Trim() != "")
            {
                q.Lt("OperateDate", EndTime.Text.Trim());
            }
            if (OperateUser != "")
            {
                q.Add("OperateUser", OperateUser);
            }
            int rec = 0;

            rplist.DataSource = bsol.GetSysOperateLogList(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);
        }
Beispiel #26
0
        protected void btnEdit_OnClick(object sender, EventArgs e)
        {
            New oldn = bn.GetNewsByID(Utils.StrToInt(ID, 0));

            if (bn.Update(new New
            {
                NewsID = Utils.StrToInt(hfNewsID.Value, 0),
                Title = PubCom.CheckString(txtTitle.Text.Trim()),
                NewsContent = container.Text,
                summary = PubCom.CheckString(txtsummary.Text.Trim()),
                Uploader = txtauthor.Text.Trim(),
                SubmitTime = DateTime.Now,
                IsHot = CbIsHot.Checked,
                IsTop = CbIstop.Checked,
                NewsType = dpNewstype.SelectedValue,
                StaticType = dpstatictype.SelectedValue
            }) != 1)
            {
                Message.ShowWrong(this, "更新文章失败");
            }


            else
            {
                bn.UploadValidate(pic_upload, lbl_pic, PicFilePath, Utils.StrToInt(hfNewsID.Value, 0));

                New           n   = bn.GetNewsByID(Utils.StrToInt(ID, 0));
                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(oldn);
                log.LogAfterObject  = JsonHelper.Obj2Json(n);
                bsol.Insert(log);
                Message.ShowOKAndRedirect(this, "更新新闻成功", "NewsManage.aspx");
            }
        }
Beispiel #27
0
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            Member m = new Member();

            m.MemberID = Utils.StrToInt(hfMemberID.Value, 0);

            m.MemberName    = PubCom.CheckString(txtMName.Text.Trim());
            m.Phone         = PubCom.CheckString(txtPhone.Text.Trim());
            m.Email         = PubCom.CheckString(txtMail.Text.Trim());
            m.Organization  = PubCom.CheckString(ttxOrgName.Text.Trim());
            m.Qualification = PubCom.CheckString(txtQualification.Text.Trim());
            Utils.ObjToInt(dpgrade.SelectedValue, 0);

            Member mold = bm.GetMembersByID(Utils.StrToInt(hfMemberID.Value, 0));

            if (bm.Update(m) == 1)
            {
                //插入图片
                bm.UploadValidate(pic_upload, lbl_pic, PicFilePath, m.MemberID, MemberType.普通学生);
                //// 插入日志 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(mold);
                log.LogAfterObject  = JsonHelper.Obj2Json(m);
                bsol.Insert(log);
                Message.ShowOKAndRedirect(this, "普通学生信息成功", "StuMemberManage.aspx");
            }

            else
            {
                Message.ShowWrong(this, "普通学生信息失败!");
                return;
            }
        }
Beispiel #28
0
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            Dynamic d = new Dynamic();

            Dynamic dold = bd.GetDynamicsByID(Utils.StrToInt(hfdynamicID.Value, 0));

            d.DynamicID = Utils.StrToInt(hfdynamicID.Value, 0);

            d.IsTop = CbIstop.Checked;

            d.Content  = container.Text;
            d.SubTime  = DateTime.Now;
            d.Uploader = GetLogUserName();
            d.Title    = PubCom.CheckString(txtTitle.Text.Trim());


            if (bd.Update(d) != 1)
            {
                Message.ShowWrong(this, "修改联盟动态失败!");
            }
            else
            {
                // 插入日志  update

                Dynamic       dnew = bd.GetDynamicsByID(Utils.StrToInt(hfdynamicID.Value, 0));
                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(dold);
                log.LogAfterObject  = JsonHelper.Obj2Json(dnew);
                bsol.Insert(log);

                Message.ShowOKAndRedirect(this, "修改联盟动态成功", "LMDynamicManage.aspx");
            }
        }
Beispiel #29
0
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            Member m = new Member();

            m.MemberID      = bm.GetMaxID() + 1;
            m.MemberType    = MemberType.联盟成员.ToString();
            m.MemberName    = PubCom.CheckString(txtMName.Text.Trim());
            m.Phone         = PubCom.CheckString(txtPhone.Text.Trim());
            m.Email         = PubCom.CheckString(txtMail.Text.Trim());
            m.Organization  = PubCom.CheckString(ttxOrgName.Text.Trim());
            m.Qualification = PubCom.CheckString(txtQualification.Text.Trim());



            if (bm.Insert(m) == 1)
            {
                //插入图片
                bm.UploadValidate(pic_upload, lbl_pic, PicFilePath, m.MemberID, MemberType.联盟成员);
                //// 插入日志 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(m);
                bsol.Insert(log);
                Message.ShowOKAndRedirect(this, "添加联盟成员成功", "LMMemberManage.aspx");
            }

            else
            {
                Message.ShowWrong(this, "添加联盟成员失败!");
                return;
            }
        }
Beispiel #30
0
        private void BindingList()
        {
            Query qm = Query.Build(new { SortFields = "FinishTime Desc" });


            //6个dpdownlist

            if (dpExpert.SelectedValue != "")
            {
                qm.Add("e.ExpertID", dpExpert.SelectedValue);
            }
            if (dpLm.SelectedValue != "")
            {
                qm.Add("m.LmMemberID", dpLm.SelectedValue);
            }
            if (dpTd.SelectedValue != "")
            {
                qm.Add("m.TdMemberID", dpTd.SelectedValue);
            }
            if (dpProject.SelectedValue != "")
            {
                qm.Add("p.ProjectID", dpProject.SelectedValue);
            }

            string Name = PubCom.CheckString(txtBookName.Text.Trim());

            if (Name != "")
            {
                qm.Add("t.TreatiseName", Name);
            }
            string author = PubCom.CheckString(txtAuthor.Text.Trim());

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

            if (Subtime != "")
            {
                qm.Add("t.FinishTime", DateTime.Parse(Subtime));
            }
            string publication = PubCom.CheckString(txtPublish.Text.Trim());

            if (publication != "")
            {
                qm.Add("t.Publishing", publication);
            }

            int ret = 0;

            rplist.DataSource = bt.GetTreatisesList(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);
        }