Exemplo n.º 1
0
        protected void btnOK_Click(object sender, EventArgs e)
        {
            Model.manager     manager = GetAdminInfo();
            Model.U_User_Info model   = new BLL.U_User_Info().GetModel(int.Parse(Request.QueryString["id"]));
            if (txtAmount.Text != "")
            {
                model.account_amount += Convert.ToDecimal(txtAmount.Text);
                new BLL.U_User_Info().Update(model);

                Model.U_User_Recharge record = new Model.U_User_Recharge();
                record.FK_user_id         = model.user_id;
                record.recharge_user_name = model.user_name;
                record.recharge_type      = 1;
                record.payment_type       = ddl_payment_type.SelectedValue;
                record.recharge_amount    = Convert.ToDecimal(txtAmount.Text);
                record.balance            = model.account_amount;
                record.real_amount        = Convert.ToDecimal(txtRealMoney.Text);
                record.rechage_time       = DateTime.Now;
                record.create_by          = manager.id;
                record.create_name        = manager.real_name;
                record.recharge_remark    = txtRemark.Text;
                new BLL.U_User_Recharge().Add(record);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "1", "alert('充值完成!');ok();", true);
            }
        }
Exemplo n.º 2
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("user_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.U_User_Info bll = new BLL.U_User_Info();
            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("user_list.aspx", "keywords={0}", this.keywords));
        }
Exemplo n.º 3
0
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (ddl_cost_item.SelectedValue != "")
            {
                Model.manager     manager = GetAdminInfo();
                Model.U_User_Info model   = new BLL.U_User_Info().GetModel(int.Parse(Request.QueryString["id"]));
                Model.P_Cost_Item item    = new BLL.P_Cost_Item().GetModel(int.Parse(ddl_cost_item.SelectedValue));
                if (model.account_amount >= item.item_amount)
                {
                    model.account_amount -= item.item_amount;
                    new BLL.U_User_Info().Update(model);

                    Model.U_User_Recharge record = new Model.U_User_Recharge();
                    record.FK_user_id         = model.user_id;
                    record.recharge_user_name = model.user_name;
                    record.recharge_type      = 1;
                    record.payment_type       = null;
                    record.recharge_amount    = item.item_amount;
                    record.balance            = model.account_amount;
                    record.real_amount        = null;
                    record.rechage_time       = DateTime.Now;
                    record.create_by          = manager.id;
                    record.create_name        = manager.real_name;
                    record.recharge_remark    = null;
                    new BLL.U_User_Recharge().Add(record);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "1", "alert('消费完成!');ok();", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "1", "alert('余额不够,请确认!');", true);
                }
            }
        }
Exemplo n.º 4
0
        private void ShowInfo(int _id)
        {
            BLL.U_User_Info   bll   = new BLL.U_User_Info();
            Model.U_User_Info model = bll.GetModel(_id);

            txtName.Text         = model.user_name;
            txtCardnum.Text      = model.user_cardnum;
            txtTelphone.Text     = model.user_telphone;
            txtRemark.Text       = model.user_remark;
            rblSex.SelectedValue = model.user_sex;
        }
Exemplo n.º 5
0
 private void GetData()
 {
     if (!string.IsNullOrEmpty(Request.QueryString["id"]))
     {
         Model.U_User_Info model = new BLL.U_User_Info().GetModel(int.Parse(Request.QueryString["id"]));
         if (model != null)
         {
             lblName.Text   = model.user_name;
             lblAmount.Text = model.account_amount.ToString();
         }
     }
 }
Exemplo n.º 6
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page        = DTRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            BLL.U_User_Info bll = new BLL.U_User_Info();
            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("user_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

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

            BLL.U_User_Info   bll   = new BLL.U_User_Info();
            Model.U_User_Info model = bll.GetModel(_id);

            model.user_name     = txtName.Text;
            model.user_cardnum  = txtCardnum.Text;
            model.user_sex      = rblSex.SelectedValue;
            model.user_telphone = txtTelphone.Text;
            model.user_remark   = txtRemark.Text;

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改会员信息:" + model.user_name); //记录日志
                result = true;
            }
            return(result);
        }
Exemplo n.º 8
0
        private bool DoAdd()
        {
            bool result = false;

            Model.U_User_Info model = new Model.U_User_Info();
            BLL.U_User_Info   bll   = new BLL.U_User_Info();

            model.account_amount    = 0;
            model.user_name         = txtName.Text;
            model.user_cardnum      = txtCardnum.Text;
            model.user_sex          = rblSex.SelectedValue;
            model.user_telphone     = txtTelphone.Text;
            model.user_status       = 1;
            model.user_remark       = txtRemark.Text;
            model.create_time       = DateTime.Now;
            model.last_pay_time     = null;
            model.last_rechage_time = null;
            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加会员:" + model.user_name); //记录日志
                result = true;
            }
            return(result);
        }