Ejemplo n.º 1
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("member_exit_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.member_exit bll = new BLL.member_exit();
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    if (bll.Delete(id))
                    {
                        sucCount += 1;
                    }
                    else
                    {
                        errorCount += 1;
                    }
                }
            }
            AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除协会会员" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("member_exit_list.aspx", "keywords={0}", this.keywords));
        }
Ejemplo n.º 2
0
        private void ShowInfo(int _id)
        {
            BLL.member_exit   bll   = new BLL.member_exit();
            Model.member_exit model = bll.GetModel(_id);
            ddlTown.SelectedValue    = model.town.ToString();
            ddlVillage.SelectedValue = model.village.ToString();
            txtAddress.Text          = model.address;
            txtNo.Text                 = model.no;
            txtNo.ReadOnly             = true;
            txtName.Text               = model.name;
            rblGender.SelectedValue    = model.gender.ToString();
            txtBirthday.Text           = model.birthday.ToString();
            ddlEducation.SelectedValue = model.education;
            txtIdCard.Text             = model.id_card;
            txtAmount.Text             = model.amount.ToString();
            for (int i = 1; i < model.family.Count + 1; i++)
            {
                TextBox      txtFamilyName   = FindControl("txtFamilyName" + i) as TextBox;
                DropDownList ddlFamilyGender = FindControl("ddlFamilyGender" + i) as DropDownList;
                TextBox      txtFamilyRel    = FindControl("txtFamilyRel" + i) as TextBox;
                TextBox      txtFamilyBir    = FindControl("txtFamilyBir" + i) as TextBox;
                DropDownList ddlFamilyEdu    = FindControl("ddlFamilyEdu" + i) as DropDownList;

                var current = model.family[i - 1];
                txtFamilyName.Text            = current.name;
                ddlFamilyGender.SelectedValue = current.gender;
                txtFamilyRel.Text             = current.relationship;
                txtFamilyBir.Text             = current.birthday;
                ddlFamilyEdu.SelectedValue    = current.education;
            }
        }
Ejemplo n.º 3
0
        protected void btnReject_Click(object sender, EventArgs e)
        {
            BLL.member_exit bll     = new BLL.member_exit();
            Repeater        rptList = new Repeater();

            rptList = this.rptList;
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    var model = bll.GetModel(id);
                    if (model.status == 1)
                    {
                        JscriptMsg("该会员已经退会成功!", Utils.CombUrlTxt("exit_audit_list.aspx", "keywords={0}", this.keywords));
                        return;
                    }
                    else if (model.status == 2)
                    {
                        JscriptMsg("该会员已经驳回退会申请!", Utils.CombUrlTxt("exit_audit_list.aspx", "keywords={0}", this.keywords));
                        return;
                    }
                    bll.UpdateField(id, "status=2");
                    bll.UpdateField(id, "exit_time='" + DateTime.Now + "'");
                }
            }
            AddAdminLog(DTEnums.ActionEnum.Audit.ToString(), "审核频道内容信息"); //记录日志
            JscriptMsg("驳回退会成功!", Utils.CombUrlTxt("exit_audit_list.aspx", "keywords={0}", this.keywords));
        }
Ejemplo n.º 4
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            BLL.member_exit bll   = new BLL.member_exit();
            var             model = bll.GetModel(this.id);

            //this.rptList2.DataSource = model.albums;
            this.rptList2.DataBind();
        }
Ejemplo n.º 5
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page        = DTRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            BLL.member_exit bll = new BLL.member_exit();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("member_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 6
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.member_exit   bll   = new BLL.member_exit();
            Model.member_exit model = bll.GetModel(_id);
            model.town      = ddlTown.SelectedValue.ToString();
            model.village   = ddlVillage.SelectedValue.ToString();
            model.address   = txtAddress.Text.Trim();
            model.no        = txtNo.Text.Trim();
            model.name      = txtName.Text.Trim();
            model.gender    = rblGender.SelectedValue.ToString();
            model.birthday  = txtBirthday.Text.Trim();
            model.education = ddlEducation.SelectedValue.ToString();
            model.id_card   = txtIdCard.Text.Trim();
            model.amount    = Utils.StrToDecimal(txtAmount.Text, 0);
            model.add_time  = Utils.StrToDateTime(txtAddTime.Text.Trim());
            if (model.town == "0")
            {
                JscriptMsg("请填写所属乡镇!", "");
                return(false);
            }
            if (model.village == "0")
            {
                JscriptMsg("请填写所属村庄!", "");
                return(false);
            }
            if (string.IsNullOrEmpty(model.no))
            {
                JscriptMsg("请填写会员编号!", "");
                return(false);
            }
            if (string.IsNullOrEmpty(model.name))
            {
                JscriptMsg("请填写姓名!", "");
                return(false);
            }
            List <Model.member_exit_family> ls = new List <Model.member_exit_family>();
            var familyModel = new Model.member_exit_family();

            if (!string.IsNullOrEmpty(txtFamilyName1.Text.Trim()))
            {
                familyModel.name         = txtFamilyName1.Text.Trim();
                familyModel.gender       = ddlFamilyGender1.SelectedValue.ToString();
                familyModel.relationship = txtFamilyRel1.Text.Trim();
                familyModel.birthday     = txtFamilyBir1.Text.Trim();
                familyModel.education    = ddlFamilyEdu1.SelectedValue.ToString();
                ls.Add(familyModel);
            }
            if (!string.IsNullOrEmpty(txtFamilyName2.Text.Trim()))
            {
                familyModel.name         = txtFamilyName2.Text.Trim();
                familyModel.gender       = ddlFamilyGender2.SelectedValue.ToString();
                familyModel.relationship = txtFamilyRel2.Text.Trim();
                familyModel.birthday     = txtFamilyBir2.Text.Trim();
                familyModel.education    = ddlFamilyEdu2.SelectedValue.ToString();
                ls.Add(familyModel);
            }
            if (!string.IsNullOrEmpty(txtFamilyName3.Text.Trim()))
            {
                familyModel.name         = txtFamilyName3.Text.Trim();
                familyModel.gender       = ddlFamilyGender3.SelectedValue.ToString();
                familyModel.relationship = txtFamilyRel3.Text.Trim();
                familyModel.birthday     = txtFamilyBir3.Text.Trim();
                familyModel.education    = ddlFamilyEdu3.SelectedValue.ToString();
                ls.Add(familyModel);
            }
            model.family = ls;
            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改协会会员:" + model.no); //记录日志
                result = true;
            }

            return(result);
        }