Esempio n. 1
0
 /// <summary>
 /// 判断管理员是否已经登录(解决Session超时问题)
 /// </summary>
 public bool IsAdminLogin()
 {
     //如果Session为Null
     if (Session[DTKeys.SESSION_ADMIN_INFO] != null)
     {
         return(true);
     }
     else
     {
         //检查Cookies
         string adminname = Utils.GetCookie("AdminName", "DTcms");
         string adminpwd  = Utils.GetCookie("AdminPwd", "DTcms");
         if (adminname != "" && adminpwd != "")
         {
             BLL.xiehui   bll   = new BLL.xiehui();
             Model.xiehui model = bll.GetModel(adminname, adminpwd);
             if (model != null)
             {
                 Session[DTKeys.SESSION_ADMIN_INFO] = model;
                 return(true);
             }
         }
     }
     return(false);
 }
Esempio n. 2
0
        private void sign_article_click(HttpContext context)
        {
            var username = DTRequest.GetString("username");
            var password = DTRequest.GetString("password");

            BLL.xiehui   bll   = new BLL.xiehui();
            Model.xiehui model = bll.GetModel(username, password, true);
            if (model == null)
            {
                context.Response.Write("{\"status\": 2, \"msg\": \"用户名或密码有误,请重试!\"}");
                return;
            }

            BLL.article bllArticle   = new BLL.article();
            var         id           = DTRequest.GetInt("id", 0);
            var         articleModel = bllArticle.GetModel(id);

            articleModel.status          = 2;
            articleModel.sign_user_name += username + "|" + DateTime.Now.ToString() + ",";
            //判断当前用户是否已签收过
            var isUserSign = bllArticle.GetList(1, " id=" + id + " and sign_user_name like '%" + username + "|%'", "add_time desc").Tables[0].Rows.Count;

            if (isUserSign > 0)
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"对不起,该用户已经签收!\"}");
                return;
            }
            if (bllArticle.Update(articleModel))
            {
                context.Response.Write("{\"status\": 1, \"msg\": \"恭喜您,签收成功!\"}");
                return;
            }
            context.Response.Write("{\"status\": 0, \"msg\": \"对不起,签收过程中发生错误!\"}");
        }
Esempio n. 3
0
 private void ShowInfo(int _id)
 {
     BLL.xiehui   bll   = new BLL.xiehui();
     Model.xiehui model = bll.GetModel(_id);
     ddlParentId.SelectedValue = model.parent_id.ToString();
     ddlRoleId.SelectedValue   = model.role_id.ToString();
     txtUserName.Text          = model.no;
     txtUserName.ReadOnly      = true;
     txtUserName.Attributes.Remove("ajaxurl");
     if (!string.IsNullOrEmpty(model.password))
     {
         txtPassword.Attributes["value"] = txtPassword1.Attributes["value"] = defaultpassword;
     }
     txtRealName.Text      = model.name;
     ddlTown.SelectedValue = model.town;
     town_Change_Click("", new EventArgs());
     ddlVillage.SelectedValue = model.village;
     txtPerson.Text           = model.person;
     txtTel.Text     = model.tel;
     txtAddress.Text = model.address;
     if (model.is_lock == 0)
     {
         cbIsLock.Checked = true;
     }
     else
     {
         cbIsLock.Checked = false;
     }
 }
Esempio n. 4
0
 private void ShowInfo(int _id)
 {
     BLL.xiehui   bll   = new BLL.xiehui();
     Model.xiehui model = bll.GetModel(_id);
     txtUserName.Text  = model.no;
     txtRealName.Text  = model.name;
     txtTelephone.Text = model.tel;
 }
Esempio n. 5
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string userName = txtUserName.Text.Trim();
            string userPwd  = txtPassword.Text.Trim();

            if (userName.Equals("") || userPwd.Equals(""))
            {
                msgtip.InnerHtml = "请输入用户名或密码";
                return;
            }
            if (Session["AdminLoginSun"] == null)
            {
                Session["AdminLoginSun"] = 1;
            }
            else
            {
                Session["AdminLoginSun"] = Convert.ToInt32(Session["AdminLoginSun"]) + 1;
            }
            //判断登录错误次数
            if (Session["AdminLoginSun"] != null && Convert.ToInt32(Session["AdminLoginSun"]) > 5)
            {
                msgtip.InnerHtml = "错误超过5次,关闭浏览器重新登录!";
                return;
            }
            BLL.xiehui   bll   = new BLL.xiehui();
            Model.xiehui model = bll.GetModel(userName, userPwd, true);
            if (model == null)
            {
                msgtip.InnerHtml = "用户名或密码有误,请重试!";
                return;
            }
            Session[DTKeys.SESSION_ADMIN_INFO] = model;
            Session.Timeout = 45;
            //写入登录日志
            Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig();
            if (siteConfig.logstatus > 0)
            {
                new BLL.manager_log().Add(model.id, model.no, DTEnums.ActionEnum.Login.ToString(), "用户登录");
            }
            //写入Cookies
            Utils.WriteCookie("DTRememberName", model.no, 14400);
            Utils.WriteCookie("AdminName", "DTcms", model.no);
            Utils.WriteCookie("AdminPwd", "DTcms", model.password);
            Response.Redirect("index.aspx");
            return;
        }
Esempio n. 6
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.xiehui   bll      = new BLL.xiehui();
            Model.xiehui model    = bll.GetModel(_id);
            int          parentId = int.Parse(ddlParentId.SelectedValue);

            //如果选择的父ID不是自己,则更改
            if (parentId != model.id)
            {
                model.parent_id = parentId;
            }
            model.role_id   = int.Parse(ddlRoleId.SelectedValue);
            model.role_type = new BLL.manager_role().GetModel(model.role_id).role_type;
            if (cbIsLock.Checked == true)
            {
                model.is_lock = 0;
            }
            else
            {
                model.is_lock = 1;
            }
            //判断密码是否更改
            if (txtPassword.Text.Trim() != defaultpassword)
            {
                //获取用户已生成的salt作为密钥加密
                model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            }
            model.name    = txtRealName.Text.Trim();
            model.town    = ddlTown.SelectedValue.ToString();
            model.village = ddlVillage.SelectedValue.ToString();
            model.person  = txtPerson.Text.Trim();
            model.tel     = txtTel.Text.Trim();
            model.address = txtAddress.Text.Trim();

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改账号:" + model.no); //记录日志
                result = true;
            }

            return(result);
        }
Esempio n. 7
0
        private List <StatisEntity> GetStatisList()
        {
            BLL.account bll       = new BLL.account();
            BLL.xiehui  xiehuiBll = new BLL.xiehui();

            var id   = xiehuiBll.GetId(txtTown.Text, txtVillage.Text);
            var ds   = bll.GetStatisList(this.keywords, Utils.StrToInt(id, 0), Utils.StrToInt(this.bSubject, 0), Utils.StrToInt(this.sSubject, 0)).Tables[0];
            var list = new List <StatisEntity>();

            foreach (DataRow item in ds.Rows)
            {
                BLL.subject_detail subjectDetailBll = new BLL.subject_detail();
                var subjcetDetail = subjectDetailBll.GetModel(Utils.StrToInt(item["b_subject"].ToString(), 0), Utils.StrToInt(item["s_subject"].ToString(), 0));
                if (subjcetDetail == null)
                {
                    continue;
                }
                var model  = new StatisEntity();
                var xiehui = xiehuiBll.GetModel(Utils.StrToInt(item["xiehui_id"].ToString(), 0));

                BLL.subject subjectBll   = new BLL.subject();
                var         bSubjectName = subjectBll.GetName(Utils.StrToInt(item["b_subject"].ToString(), 0));
                var         sSubjectName = subjectBll.GetName(Utils.StrToInt(item["s_subject"].ToString(), 0));

                model.Town      = xiehui.town;
                model.Village   = xiehui.village;
                model.XieHui    = xiehui.name;
                model.BBSubjcet = bSubjectName;
                model.SSbuject  = sSubjectName;
                model.Amount    = subjcetDetail.amount.ToString();
                model.BQJie     = item["jie"].ToString();
                model.BQDai     = item["dai"].ToString();
                model.QmAmount  = (Utils.StrToInt(subjcetDetail.amount.ToString(), 0) - Utils.StrToInt(item["jie"].ToString(), 0) + Utils.StrToInt(item["dai"].ToString(), 0)).ToString();
                list.Add(model);
            }
            return(list);
        }
Esempio n. 8
0
        private List <StatisEntity> GetStatisList()
        {
            BLL.account        bll              = new BLL.account();
            BLL.xiehui         xiehuiBll        = new BLL.xiehui();
            BLL.subject        subjectBll       = new BLL.subject();
            BLL.subject_detail subjectDetailBll = new BLL.subject_detail();

            var ds   = bll.GetStatisList(this.keywords, 0, Utils.StrToInt(ddlBSubject.SelectedValue, 0), Utils.StrToInt(ddlSSubject.SelectedValue, 0)).Tables[0];
            var list = new List <StatisEntity>();

            foreach (DataRow dr in ds.Rows)
            {
                var xiehui = xiehuiBll.GetModel(Utils.StrToInt(dr["xiehui_id"].ToString(), 0));
                var model  = new StatisEntity();
                model.Town    = xiehui.town;
                model.Village = xiehui.village;
                model.XieHui  = xiehui.name;
                model.XianJin = GetAmount("现金", dr);
                model.YHCK    = GetAmount("银行存款", dr);
                model.JCHZJ   = GetAmount("借出互助金", dr);
                //资产小计=现金+银行存款+借出互助金
                model.ZCXJ = (Utils.StrToInt(model.XianJin, 0) + Utils.StrToInt(model.YHCK, 0) + Utils.StrToInt(model.JCHZJ, 0)).ToString();
                //借出互助资金占比率=资产小计/借出互助金
                model.JCZB  = Utils.StrToInt(model.JCHZJ, 0) == 0 ? "0" : (Utils.StrToInt(model.ZCXJ, 0) / Utils.StrToInt(model.JCHZJ, 0)).ToString();
                model.RHHZ  = GetAmount("会员入会互助金", dr);
                model.ZFHZJ = GetAmount("政府拨入互助资金", dr);
                //负债小计=会员入会互助金+政府拨入互助金
                model.FZXJ = (Utils.StrToInt(model.RHHZ, 0) + Utils.StrToInt(model.ZFHZJ, 0)).ToString();
                //净资产=资产小计-负债小计
                model.JZC  = (Utils.StrToInt(model.ZCXJ, 0) + Utils.StrToInt(model.FZXJ, 0)).ToString();
                model.ZFBZ = GetAmount("政府补助收入", dr);
                model.JCZY = GetAmount("互助金占用费收入", dr);
                model.YWGL = GetAmount("业务管理费收入", dr);
                model.GYJ  = GetAmount("公益金", dr);
                //收入小计=政府补助收入+互助金占用费收入+业务管理费收入+公益金
                model.SRXJ = (Utils.StrToInt(model.ZFBZ, 0) + Utils.StrToInt(model.JCZY, 0) + Utils.StrToInt(model.YWGL, 0) + Utils.StrToInt(model.GYJ, 0)).ToString();
                model.HDZC = GetAmount("业务活动支出", dr);
                //本期结余=收入小计-业务活动支出
                model.BQJY = (Utils.StrToInt(model.SRXJ, 0) + Utils.StrToInt(model.HDZC, 0)).ToString();
                list.Add(model);
            }
            //var list = new List<StatisEntity>()
            //{
            //   new StatisEntity(){Town="漩涡镇",Village="茨沟村",XieHui="漩涡镇茨沟村协会",XianJin="",YHCK="191816.41",JCHZJ="556000.00",ZCXJ="747816.41",JCZB="74.35%",RHHZ="54600.00",ZFHZJ="693780",FZXJ="748380",JZC="-563.59 ",ZFBZ="",JCZY="250.00",GYJ="",SRXJ="1261.41",HDZC="1825",BQJY="-563.59"},

            //   new StatisEntity(){Town="漩涡镇",Village="东河村",XieHui="漩涡镇东河村协会",XianJin="",YHCK="307102.74",JCHZJ="451000.00",ZCXJ="758102.74",JCZB="59.49%",RHHZ="39400.00",ZFHZJ="713420",FZXJ="752820",JZC="5282.74",ZFBZ="",JCZY="5282.74",GYJ="",SRXJ="5282.74",HDZC="",BQJY="5282.74"},

            //   new StatisEntity(){Town="漩涡镇",Village="金星村",XieHui="漩涡镇金星村协会",XianJin="",YHCK="237406.44 ",JCHZJ="555000.00",ZCXJ="792406.44",JCZB="70.04%",RHHZ="48300.00",ZFHZJ="741740",FZXJ="790040",JZC="2366.44",ZFBZ="",JCZY="2366.44",GYJ="",SRXJ="2366.44",HDZC="",BQJY="2366.44"},

            //   new StatisEntity(){Town="漩涡镇",Village="田凤村",XieHui="漩涡镇田凤村协会",XianJin="",YHCK="494204.05",JCHZJ="305000.00",ZCXJ="799204.05",JCZB="38.16%",RHHZ="27000.00",ZFHZJ="770950",FZXJ="797950",JZC="1254.05",ZFBZ="",JCZY="1254.05",GYJ="",SRXJ="1254.05",HDZC="",BQJY="1254.05"},

            //   new StatisEntity(){Town="漩涡镇",Village="田堰村",XieHui="漩涡镇田堰村协会",XianJin="",YHCK="441926.13",JCHZJ="310000.00",ZCXJ="751926.13",JCZB="41.23%",RHHZ="29900.00",ZFHZJ="715700",FZXJ="745600",JZC="6326.13",ZFBZ="",JCZY="8121.13",GYJ="",SRXJ="8121.13",HDZC="1795",BQJY="6326.13"},

            //   new StatisEntity(){Town="漩涡镇",Village="上七村",XieHui="漩涡镇上七村协会",XianJin="",YHCK="500379.17",JCHZJ="",ZCXJ="500379.17",JCZB="0.00%",RHHZ="",ZFHZJ="500000",FZXJ="500000",JZC="379.17",ZFBZ="",JCZY="379.17",GYJ="",SRXJ="379.17",HDZC="",BQJY="379.17"},

            //   new StatisEntity(){Town="漩涡镇",Village="龙泉村",XieHui="漩涡镇龙泉村协会",XianJin="237",YHCK="170990.74",JCHZJ="370000.00",ZCXJ="541227.74",JCZB="68.36%",RHHZ="42700.00",ZFHZJ="500000",FZXJ="542700",JZC="-1472.26",ZFBZ="",JCZY="290.74",GYJ="",SRXJ="290.74",HDZC="1763",BQJY="-1472.26"},

            //   new StatisEntity(){Town="漩涡镇",Village="中银村",XieHui="漩涡镇中银村协会",XianJin="47",YHCK="246524.64",JCHZJ="412000.00",ZCXJ="658571.64",JCZB="62.56%",RHHZ="41900.00",ZFHZJ="600000",FZXJ="641900",JZC="16671.64",ZFBZ="",JCZY="18576.64",GYJ="",SRXJ="18576.64",HDZC="1905",BQJY="16671.64"},
            //};
            return(list);
            //BLL.account bll = new BLL.account();
            //var ds = bll.GetStatisList(this.keywords,1, Utils.StrToInt(this.bSubject, 0), Utils.StrToInt(this.sSubject, 0)).Tables[0];
            //var list = new List<StatisEntity>();
            //foreach (DataRow item in ds.Rows)
            //{
            //    BLL.subject_detail subjectDetailBll = new BLL.subject_detail();
            //    var subjcetDetail = subjectDetailBll.GetModel(Utils.StrToInt(item["b_subject"].ToString(), 0), Utils.StrToInt(item["s_subject"].ToString(), 0));
            //    if (subjcetDetail == null)
            //    {
            //        continue;
            //    }
            //    var model = new StatisEntity();
            //    BLL.xiehui xiehuiBll = new BLL.xiehui();
            //    var xiehui = xiehuiBll.GetModel(Utils.StrToInt(item["xiehui_id"].ToString(), 0));

            //    BLL.subject subjectBll = new BLL.subject();
            //    var bSubjectName = subjectBll.GetName(Utils.StrToInt(item["b_subject"].ToString(), 0));
            //    var sSubjectName = subjectBll.GetName(Utils.StrToInt(item["s_subject"].ToString(), 0));

            //    model.Town = xiehui.town;
            //    model.Village = xiehui.village;
            //    model.XieHui = xiehui.name;
            //    model.BBSubjcet = bSubjectName;
            //    model.SSbuject = sSubjectName;
            //    model.Amount = subjcetDetail.amount.ToString();
            //    model.BQJie = item["jie"].ToString();
            //    model.BQDai = item["dai"].ToString();
            //    model.QmAmount = (Utils.StrToInt(subjcetDetail.amount.ToString(), 0) - Utils.StrToInt(item["jie"].ToString(), 0) + Utils.StrToInt(item["dai"].ToString(), 0)).ToString();
            //    list.Add(model);
            //}
            //return list;
        }