示例#1
0
        protected void lnkSendMail_Click(object sender, EventArgs e)
        {
            MEMBERS_BC ctlMember = new MEMBERS_BC();

            MEMBERS obj = ctlMember.SelectItem(Singleton <BITCurrentSession> .Inst.SessionMember.ID);

            SendMailToRegisterUser(obj.Username, obj.Fullname, obj.Password_PIN, obj.Email);
        }
示例#2
0
        public MEMBERS GetDataOnForm()
        {
            MEMBERS obj = new MEMBERS();

            obj.Username = txtUserName.Text;
            obj.Fullname = txtFullName.Text.Trim();
            obj.Phone    = txtPhone.Text.Trim();
            obj.Email    = txtEmail.Text.Trim();
            obj.Wallet   = txtWallet.Text.Trim();
            return(obj);
        }
示例#3
0
        public MEMBERS GetDataOnForm()
        {
            MEMBERS obj = new MEMBERS();

            obj.CodeId       = Singleton <BITCurrentSession> .Inst.SessionMember.CodeId;
            obj.Fullname     = txtFullName.Text.Trim();
            obj.Phone        = txtPhone.Text.Trim();
            obj.Wallet       = txtWallet.Text.Trim();
            obj.Password_PIN = txtPasswordPIN.Text.Trim();
            return(obj);
        }
示例#4
0
        public void LoadUserInfor()
        {
            MEMBERS_BC ctlMember = new MEMBERS_BC();

            MEMBERS obj = ctlMember.SelectItem(Singleton <BITCurrentSession> .Inst.SessionMember.ID);

            txtUserName.Text = obj.Username;
            txtEmail.Text    = obj.Email;
            txtFullName.Text = obj.Fullname;
            txtPhone.Text    = obj.Phone;
            txtWallet.Text   = obj.Wallet;
            //txtSysWallet.Text = obj.Sys_Wallet;
            lnkSendMail.Text = "Click here to receive Transaction password via email: " + obj.Email;
        }
示例#5
0
 protected void btnUpdateAdmin_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         try
         {
             MEMBERS    obj       = GetDataOnForm();
             MEMBERS_BC ctlMember = new MEMBERS_BC();
             ctlMember.UpdateItem(obj);
         }
         catch (Exception ex)
         {
             ShowMessageError(lblMessage, ex.ToString(), true);
         }
     }
 }
示例#6
0
        public void UpdateProfile()
        {
            MEMBERS_BC ctlMember = new MEMBERS_BC();

            MEMBERS obj = GetDataOnForm();

            //Tung: Them doan check Password 2
            if (obj.Password_PIN == Singleton <BITCurrentSession> .Inst.SessionMember.Password_PIN)
            {
                ctlMember.UpdateItem(obj);
                ShowMessageError(lblMessage, "Update profile member successful", true);
            }
            else
            {
                ShowMessageError(lblMessage, "Password PIN is invalid! ", true);
            }
        }
示例#7
0
        public void LoadUserInfor()
        {
            int Id;

            if (Singleton <BITCurrentSession> .Inst.SessionMember.CodeId == "0")
            {
                if (Convert.ToInt32(HttpContext.Current.Session["BIT_MemberID_Edit"]) == 0)
                {
                    Id = Singleton <BITCurrentSession> .Inst.SessionMember.ID;
                }
                else
                {
                    Id = Convert.ToInt32(HttpContext.Current.Session["BIT_MemberID_Edit"]);
                }

                btnUpdateAdmin.Visible = true;
                btnUpdate.Visible      = false;
                divBlockChain.Visible  = false;
                //txtFullName.Attributes.Remove("readonly");
                //txtEmail.Attributes.Remove("readonly");
                //txtPhone.Attributes.Remove("readonly");
                //txtWallet.Attributes.Remove("readonly");
            }
            else
            {
                Id = Singleton <BITCurrentSession> .Inst.SessionMember.ID;
                getAdminWallet();
                //txtFullName.Attributes.Add("readonly", "readonly");
                //txtEmail.Attributes.Add("readonly", "readonly");
                //txtPhone.Attributes.Add("readonly", "readonly");
                //txtWallet.Attributes.Add("readonly", "readonly");
            }

            MEMBERS_BC ctlMember = new MEMBERS_BC();
            MEMBERS    obj       = ctlMember.SelectItemByID(Id);

            txtUserName.Text = obj.Username;
            txtEmail.Text    = obj.Email;
            txtFullName.Text = obj.Fullname;
            txtPhone.Text    = obj.Phone;
            txtWallet.Text   = obj.Wallet;
            //txtSysWallet.Text = obj.Sys_Wallet;

            hidCodeId.Value = obj.CodeId;
        }
示例#8
0
        public void LoadDataToForm()
        {
            if (Session["PH_DETAIL_COMMAND_DETAIL_ID"] != null)
            {
                var ctlCmdDetail  = new COMMAND_DETAIL_BC();
                var ctlMem        = new MEMBERS_BC();
                int CMD_DETAIL_ID = Convert.ToInt32(Session["PH_DETAIL_COMMAND_DETAIL_ID"]);

                this.COMMAND_DETAIL_ID = CMD_DETAIL_ID;
                // lay command detail ID
                COMMAND_DETAIL cmdDetail = ctlCmdDetail.SelectItem(CMD_DETAIL_ID);
                MEMBERS        member    = ctlMem.SelectItem(cmdDetail.CodeId_To);

                imgGHWallet.ImageUrl = string.Format("http://chart.googleapis.com/chart?chs=200x200&cht=qr&chl={0}", member.Wallet.Trim()).Trim();
                lblGHWallet.Text     = "Address: " + member.Wallet;
                txtTotalAmount.Text  = cmdDetail.Amount.ToString();
            }
        }
        protected void lnkConfirm_Click(object sender, EventArgs e)
        {
            LinkButton          btn = (LinkButton)(sender);
            string              ID  = btn.CommandArgument;
            PACKAGE_TRANSACTION pck = Singleton <PACKAGE_TRANSACTION_BC> .Inst.SelectItem(Convert.ToInt32(ID));

            //update pck ph_status = 1;
            //update members set startdate = pack startdate endate = packendate
            pck.STATUS_PH = 1;
            //create store update package and members
            Singleton <PACKAGE_TRANSACTION_BC> .Inst.updateItem(pck);

            MEMBERS objMem = Singleton <MEMBERS_BC> .Inst.SelectItem(pck.CODEID);

            objMem.ActiveDate  = pck.START_DATE;
            objMem.ExpiredDate = pck.END_DATE;
            Singleton <MEMBERS_BC> .Inst.UpdateExpireDate(objMem);

            TNotify.Alerts.Danger(string.Format("Confirmed Invest Package {0} for User {1} Completed", pck.PACKAGEID, objMem.Username), true);
            Response.Redirect("../admin/adminselectpackInvest.aspx");
        }
示例#10
0
 public void InsertItem(MEMBERS obj)
 {
     defaultDB.ExecuteNonQuery("sp_MEMBERS_Insert",
                                                   //Eobj.CodeId,// @CodeId varchar(250)
                               obj.Username,       //@Username	varchar(50)
                               obj.Password,       //@Password	varchar(50)
                               obj.CodeId_Sponsor, //@CodeId_Sponsor	varchar(250)
                               obj.Password_PIN,   //@Password_PIN varchar(50)
                               obj.Fullname,       //@Fullname	nvarchar(250)
                               obj.Phone,          //@Phone	varchar(50)
                               obj.Email,          //@Email	varchar(100)
                               obj.Wallet,         //@Wallet	nvarchar(250)
                               obj.CreateDate,     //@CreateDate	datetime
                               obj.Level,          //@Level  varchar(50)
                               obj.ExistsChild,    //@ExistsChild bit
                               obj.Status,         //@Status	int
                               obj.Country,        //@Country	nvarchar(250)
                               obj.IsLock,         //@IsLock int
                               obj.Upline          //@UpLine varchar(250)
                                                   //, obj.Username, obj.Password, obj.Password_PIN, obj.CodeId_Sponsor, obj.Fullname, obj.Phone, obj.Email, obj.Wallet, obj.CreateDate, obj.Country, obj.IsLock, obj.Status
                               );
 }
示例#11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                if (!Singleton <BITCurrentSession> .Inst.isLoginUser)
                {
                    //Response.Redirect("../Account/Login.aspx");
                    string a = Request.Params[0];

                    string strUserName = GiaiMa(a);
                    if (String.IsNullOrEmpty("strUserName"))
                    {
                        return;
                    }
                    MEMBERS obj = Singleton <MEMBERS_BC> .Inst.SelectItemByUserName(strUserName);

                    if (obj == null)
                    {
                        Response.Redirect("Login.aspx");
                    }
                    else
                    {
                        newRegist = true;
                        lblUserNameSponsor.Text = obj.CodeId;
                        Load_Category();
                    }
                }
                else
                {
                    dynamic h1 = Request.Url.Host;
                    dynamic h2 = Request.Url.Authority;
                    lblLink.Text = h2 + "/Admin/Register.aspx?ref=" + MaHoa(Singleton <BITCurrentSession> .Inst.SessionMember.Username);
                    newRegist    = false;
                    Load_Category();
                }
            }
        }
示例#12
0
        public MEMBERS GetDataOnForm()
        {
            MEMBERS obj = new MEMBERS();

            obj.Username = txtUserName.Text.Trim();
            obj.Password = txtPassword.Text;

            if (newRegist)
            {
                obj.CodeId_Sponsor = lblUserNameSponsor.Text;
                obj.Upline         = Singleton <MEMBERS_BC> .Inst.SelectItem(obj.CodeId_Sponsor).Username;
            }
            else
            {
                obj.CodeId_Sponsor = Singleton <BITCurrentSession> .Inst.SessionMember.CodeId;
                obj.Upline         = Singleton <BITCurrentSession> .Inst.SessionMember.Username;
            }


            obj.Password_PIN = txtPassword_PIN.Text;
            obj.Fullname     = txtFullName.Text.Trim();

            obj.Phone       = txtPhone.Text;
            obj.Email       = txtEmail.Text.Trim();
            obj.Wallet      = txtWallet.Text;
            obj.CreateDate  = DateTime.Today;
            obj.Level       = "0";
            obj.ExistsChild = false;
            obj.Status      = (int)Constants.MEMBER_STATUS.WaitActive;
            obj.Country     = ddlCountry.SelectedValue.ToString();
            //obj.ActiveDate = DBNull.Value; //@ActiveDate datetime
            //obj.ExpiredDate = DateTime.Now.AddMonths(1); //@ExpiredDate datetime
            obj.IsLock = 0;

            return(obj);
        }
示例#13
0
 public void UpdateItem(MEMBERS obj)
 {
     defaultDB.ExecuteNonQuery("sp_MEMBERS_Update"
                               , obj.CodeId, obj.Fullname, obj.Phone, obj.Email, obj.Wallet);
 }
示例#14
0
 public void UpdateExpireDate(MEMBERS obj)
 {
     defaultDB.ExecuteNonQuery("sp_MEMBERS_Update_ExpireDate"
                               , obj.CodeId, obj.ActiveDate, obj.ExpiredDate);//stt =1
 }
示例#15
0
 //quynhld 22-08
 public void UpdateLevelAndStatus(MEMBERS obj)
 {
     ctl.UpdateLevelAndStatus(obj);
 }
示例#16
0
 public void UpdateExpireDate(MEMBERS obj)
 {
     ctl.UpdateExpireDate(obj);
 }
示例#17
0
 public void UpdateItem(MEMBERS obj)
 {
     ctl.UpdateItem(obj);
 }
示例#18
0
 public void InsertItem(MEMBERS obj)
 {
     ctl.InsertItem(obj);
 }
示例#19
0
 //UpdateLevelAndStatus - quynhld
 public void UpdateLevelAndStatus(MEMBERS obj)
 {
     defaultDB.ExecuteNonQuery("sp_MEMBERS_UpdateLevelAndStatus"
                               , obj.CodeId, obj.Fullname, obj.Phone, obj.Wallet, obj.Level, obj.Status);
 }
示例#20
0
        protected void btnRegister_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsValid)
                {
                    if (chk.Checked)
                    {
                        MEMBERS_BC ctlMember = new MEMBERS_BC();
                        MEMBERS    obj       = GetDataOnForm();

                        try
                        {
                            // check sponsor acc have execute PH success
                            DateTime dtExpired;
                            bool     bSponsorPH = false;
                            if (newRegist)
                            {
                                dtExpired = Singleton <MEMBERS_BC> .Inst.SelectItem(obj.CodeId_Sponsor).ExpiredDate;
                            }
                            else
                            {
                                dtExpired = Singleton <BITCurrentSession> .Inst.SessionMember.ExpiredDate;
                            }

                            if (dtExpired == null)
                            {
                                bSponsorPH = false;
                            }
                            else if (dtExpired < DateTime.Now)
                            {
                                bSponsorPH = false;
                            }
                            else
                            {
                                bSponsorPH = true;
                            }

                            bool bExistAcc = ctlMember.IsExistsItem(obj.Username, obj.Wallet, obj.Email);

                            if (bSponsorPH)
                            {
                                if (!bExistAcc)
                                {
                                    ctlMember.InsertItem(obj);
                                    SendMailToRegisterUser(obj.Username, obj.Fullname, obj.Password, obj.Password_PIN, obj.Email);
                                    TNotify.Alerts.Information("Register member " + txtUserName.Text + " success.");
                                    //lblMessage.Text = "Register member " + txtUserName.Text + " success.";
                                    //Response.Write("<script>alert('" + lblMessage.Text + "');</script>");
                                    lblMessage.Visible = true;
                                    //Response.Redirect("../Admin/Dashboard.aspx");
                                }
                                else
                                {
                                    lblMessage.Text    = "Username is already taken";
                                    lblMessage.Visible = true;
                                }
                            }
                            else
                            {
                                lblMessage.Text    = "You can't create account member, please execute Active Package Invest transaction!";
                                lblMessage.Visible = true;
                            }
                        }
                        catch (Exception ex)
                        {
                            throw new Exception(ex.ToString());
                            //throw new Exception(ex.ToString);
                        }
                    }
                }
                else
                {
                    lblMessage.Text    = "You must to agrre our term";
                    lblMessage.Visible = true;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
        }