Exemplo n.º 1
0
    protected void ibOK_Click(object sender, ImageClickEventArgs e)
    {
        Tz888.Model.Register.VIPMemberRegister modelInfo = new Tz888.Model.Register.VIPMemberRegister();
        Tz888.BLL.Register.VIPMemberRegister   obj       = new Tz888.BLL.Register.VIPMemberRegister();
        modelInfo.ApplyID          = 0;
        modelInfo.LoginName        = "";
        modelInfo.ManageTypeID     = hidManageType.Value != "" ?hidManageType.Value:"1003";
        modelInfo.BuyTerm          = Convert.ToInt16(rblBuyTerm.SelectedValue);
        modelInfo.OrgName          = tbOrgName.Text;
        modelInfo.RealName         = tbRealName.Text;
        modelInfo.Position         = tbPosition.Text;//职务
        modelInfo.Sex              = Convert.ToBoolean(rblSex.SelectedValue);
        modelInfo.TelCountryCode   = txtTelCountry.Text;
        modelInfo.TelStateCode     = txtTelZoneCode.Text;
        modelInfo.TelNum           = txtTelNumber.Text;
        modelInfo.Mobile           = txtMobile.Text;
        modelInfo.Email            = txtEmail.Text;
        modelInfo.ApplyDate        = DateTime.Now;
        modelInfo.IsPay            = 0; //是否付费
        modelInfo.OprStatus        = 0; // 审核状态:0未审核、1审核为拓富通会员、2已审核(已审基本信息)、3审核不通过、4退款、
        modelInfo.OprDescript      = "";
        modelInfo.OprMan           = "";
        modelInfo.OprDate          = DateTime.Now;
        modelInfo.Memo             = "";
        modelInfo.MarketPersonName = "";
        modelInfo.VIPValidateDate  = DateTime.Now;//生效时间
        modelInfo.Money            = 0;
        modelInfo.Years            = Convert.ToInt16(rblBuyTerm.SelectedValue);
        modelInfo.Price            = 0;
        modelInfo.ServiceType      = "2001";

        if (modelInfo.OrgName == "" && this.hidManageType.Value != "1001")
        {
            Tz888.Common.MessageBox.Show(this.Page, "公司名称不能为空");
            return;
        }
        if (modelInfo.RealName == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "真实姓名不能为空");
            return;
        }
        if (modelInfo.Email == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "'Email不能为空");
            return;
        }


        if (this.ViewState["tag"].ToString() == "add")
        {
            this.ViewState["ApplyID"] = obj.AddVIPMember(modelInfo);
        }
        else if (this.ViewState["tag"].ToString() == "update")
        {
            bool bl = obj.UpdateVIPMember(modelInfo);
        }
        if (Convert.ToInt32(this.ViewState["ApplyID"]) > 0)
        {
            Response.Redirect("VIPRegisterSubmit.aspx?ApplyID=" + this.ViewState["ApplyID"]);
        }
    }
    protected void ibOK_Click(object sender, ImageClickEventArgs e)
    {
        //获取ManageTypeID
        Tz888.SQLServerDAL.Conn getOpWorker = new Tz888.SQLServerDAL.Conn();
        DataTable dt = getOpWorker.GetList("logininfotab", "*", "ManageTypeID", 1, 1, 0, 1, "loginname='" + Page.User.Identity.Name + "'");

        if (dt != null && dt.Rows.Count > 0)
        {
            this.ViewState["ManageType"] = dt.Rows[0]["ManageTypeID"].ToString();
        }

        Tz888.Model.Register.VIPMemberRegister modelInfo = new Tz888.Model.Register.VIPMemberRegister();
        Tz888.BLL.Register.VIPMemberRegister   obj       = new Tz888.BLL.Register.VIPMemberRegister();
        modelInfo.LoginName = Page.User.Identity.Name;
        if (dt != null && dt.Rows.Count > 0)
        {
            modelInfo.ManageTypeID = this.ViewState["ManageType"].ToString();
        }
        modelInfo.BuyTerm          = Convert.ToInt16(rblBuyTerm.SelectedValue);
        modelInfo.OrgName          = tbOrgName.Text;
        modelInfo.RealName         = tbRealName.Text;
        modelInfo.Position         = tbPosition.Text;//职务
        modelInfo.Sex              = Convert.ToBoolean(rblSex.SelectedValue);
        modelInfo.TelCountryCode   = txtTelCountry.Text;
        modelInfo.TelStateCode     = txtTelZoneCode.Text;
        modelInfo.TelNum           = txtTelNumber.Text;
        modelInfo.Mobile           = txtMobile.Text;
        modelInfo.Email            = txtEmail.Text;
        modelInfo.ApplyDate        = DateTime.Now;
        modelInfo.IsPay            = 0; //是否付费
        modelInfo.OprStatus        = 0; // 审核状态:0未审核、1审核为拓富通会员、2已审核(已审基本信息)、3审核不通过、4退款、
        modelInfo.OprDescript      = "";
        modelInfo.OprMan           = "";
        modelInfo.OprDate          = DateTime.Now;
        modelInfo.Memo             = "";
        modelInfo.MarketPersonName = "";
        modelInfo.VIPValidateDate  = DateTime.Now;//生效时间

        if (modelInfo.OrgName == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "公司名称不能为空");

            return;
        }
        if (modelInfo.RealName == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "真实姓名不能为空");

            return;
        }
        if (modelInfo.Email == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "Email");
            return;
        }

        bool bl = true;

        try
        {
            if (this.ViewState["tag"].ToString() == "add")
            {
                modelInfo.ApplyID         = 0;
                this.ViewState["ApplyID"] = obj.AddVIPMember(modelInfo);
            }
            else if (this.ViewState["tag"].ToString() == "update")
            {
                modelInfo.ApplyID = Convert.ToInt32(this.ViewState["ApplyID"]);
                bl = obj.UpdateVIPMember(modelInfo);
            }
        }
        catch
        {
            Tz888.Common.MessageBox.Show(this.Page, "信息输入有错。。。");
        }

        if (Convert.ToInt32(this.ViewState["ApplyID"]) > 0 && bl == true)
        {
            Response.Redirect("VIPMemberSubmint_In.aspx?ApplyID=" + this.ViewState["ApplyID"]);
        }
    }