Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     currentuser = sitetemp.getcurrentuser(false);
     if (!IsPostBack)
     {
         ucVerification.LoadPage(currentuser);
     }
 }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     currentuser = sitetemp.getcurrentuser(true);
     if (!IsPostBack)
     {
         LoadCurrencyTable();
     }
 }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            currentuser = sitetemp.getcurrentuser(false);
            LoadListView();
            if (!IsPostBack)
            {

            }
        }
Esempio n. 4
0
        public void LoadPayments(int userkey)
        {
            Type t = Page.Master.GetType();
            if (t.Name == "site_master")
            {
                Site currentsite = (Peerfx.Site)Page.Master;
                currentuser = currentsite.getcurrentuser(false);
            }

            RadListView2.DataSource = Peerfx_DB.SPs.ViewPaymentsRequestedbyuser(userkey).GetDataSet().Tables[0];
            RadListView2.DataBind();
        }
Esempio n. 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     currentuser = sitetemp.getcurrentuser(false);
     if ((Request.QueryString["code"] != null) && (Request.QueryString["code"] != ""))
     {
         Setfb();
     }
     else if ((Request.QueryString["error"] != null) && (Request.QueryString["error"] != ""))
     {
         Response.Redirect("/User/Verification.aspx");
     }
 }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((Request.QueryString["paymentkey"] != null) && (Request.QueryString["paymentkey"] != ""))
            {
                paymentkey = Convert.ToInt32(Request.QueryString["paymentkey"]);
            }

            currentuser = sitetemp.getcurrentuser(false);
            if (!IsPostBack)
            {
                if (paymentkey != 0)
                {
                    Paymentdetails.LoadInfo(paymentkey,currentuser.User_key);
                }
            }
        }
Esempio n. 7
0
        protected void AsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
        {
            string file = Server.MapPath("/Files/UserImages/") + "\\" + currentuser.User_key.ToString() + ".jpg";
            if (currentuser.Image_url != null)
            {
                File.Delete(file);
            }

            byte[] imageData;
            using (Stream stream = e.File.InputStream)
            {
                imageData = new byte[stream.Length];
                stream.Read(imageData, 0, (int)stream.Length);
            }

            //save image

            //AsyncUpload1.UploadedFiles[0].SaveAs(file);

            string fullurl = Request.Url.AbsoluteUri;
            //string saveimgurl = //fullurl.Substring(0, fullurl.ToLower().IndexOf("order_form2.aspx")) + Thumbnail.ImageUrl.Replace("~/", "");

            //sitetemp.savepicurl2(saveimgurl, file);

            FileStream fs = new FileStream(file, FileMode.Create);
            BinaryWriter w = new BinaryWriter(fs);
            try
            {
                w.Write(imageData);
            }
            finally
            {
                fs.Close();
                w.Close();
            }

            currentuser = sitetemp.getcurrentuser(false);
            Insertimgurl();

            imguser.ImageUrl += "?r=" + DateTime.Now.TimeOfDay.ToString();
        }
Esempio n. 8
0
        public void CreateClient(Users user)
        {
            Hashtable hstemp = new Hashtable();
            //hstemp.Add("referenceId", "");
            hstemp.Add("firstName", user.First_name);
            hstemp.Add("middleInitial", "");
            hstemp.Add("lastName", user.Last_name);
            hstemp.Add("ssn", "555-55-5555");//NNN-NN-NNNN
            hstemp.Add("dob", "1978-10-10");//YYYY-MM-DD
            Hashtable hsaddress = new Hashtable();
            hsaddress.Add("line1","13 mockingbird lane");
            //hsaddress.Add("line2","Dallas");
            hsaddress.Add("city","Dallas");
            hsaddress.Add("state","TX");
            hsaddress.Add("zipcode","75230");

            hstemp.Add("address", hsaddress);
            hstemp.Add("homePhone", "5555555555");
            //hstemp.Add("mobilePhone", "");
            //hstemp.Add("workPhone", "");
            hstemp.Add("email", user.Email);
            //hstemp.Add("username", "");
            string strresponse = Web_Request("createClient", hstemp);

            //get clientid
            JObject o = JObject.Parse(strresponse);

            int status = (int)o["status"];
            if (status == 1){
                //request worked
                JObject o2 = (JObject)o["clientId"];
                int clientid = (int)o2["bancBoxId"];
                Peerfx_DB.SPs.UpdateBancBoxClientid(user.User_key, clientid).Execute();

                string clientstatus = (string)o["clientStatus"];
                Peerfx_DB.SPs.UpdateBancBoxClientstatus(clientid, clientstatus).Execute();
            }
        }
Esempio n. 9
0
        public Int64 Create_user_account(Users user)
        {
            Int64 returnpaymentobject = 0;
            if (user.Bancbox_client_id == 0)
            {
                //Create client id
                CreateClient(user);
                //update user object with bancbox clientid
                user = sitetemp.get_user_info(user.User_key);

            }
            //VerifyClient(user);
            returnpaymentobject = OpenAccount(user);
            return returnpaymentobject;
        }
Esempio n. 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     currentuser = sitetemp.getcurrentuser(false);
 }
Esempio n. 11
0
        public void LoadInfo(int paymentkey, int userkey)
        {
            //Load payment info
            currentuser = sitetemp.get_user_info(userkey);

            Payment paymenttemp = sitetemp.getPayment(paymentkey);

            int sellcurrency = paymenttemp.Sell_currency;
            int buycurrency = paymenttemp.Buy_currency;
            string Sellfull = paymenttemp.Txt_Sell_full;
            string Buyfull = paymenttemp.Txt_Buy_full;
            string rate = paymenttemp.Rate.ToString();
            string service_fee = sitetemp.GetCurrencySymbol(buycurrency) + " " + paymenttemp.Service_fee.ToString("F") + " " + sitetemp.getcurrencycode(buycurrency);
            if (paymenttemp.Actual_txt_Sell_full != null){
                Sellfull = paymenttemp.Actual_txt_Sell_full;
                Buyfull = paymenttemp.Actual_txt_Buy_full;
                rate = paymenttemp.Actual_rate.ToString();
                service_fee = sitetemp.GetCurrencySymbol(buycurrency) + " " + paymenttemp.Actual_service_fee.ToString("F") + " " + sitetemp.getcurrencycode(buycurrency);
            }

            Users user_sender = sitetemp.get_user_info(paymenttemp.Requestor_user_key);

            lblconfirmquotesendamount.Text = Sellfull;
            lblconfirmquotereceiveamount.Text = Buyfull;
            lblconfirmquoteyouget.Text = Buyfull;
            lblconfirmquoteexchangerate.Text = rate;
            lblconfirmquoteservicefee.Text = service_fee;

            lblsenderfullname.Text = user_sender.Full_name;
            /*
            lblconfirmsenderfullname.Text = user_sender.Full_name;
            //lblconfirmsenderdob.Text = user_sender.Dob.ToString("
            lblconfirmsenderaddress.Text = user_sender.Address1;
            lblconfirmsendercity.Text = user_sender.City;
            lblconfirmsenderpostalcode.Text = user_sender.Postalcode;
            lblconfirmsenderstate.Text = user_sender.State;
            lblconfirmsendercountry.Text = sitetemp.getcountrytext(user_sender.Country);
            lblconfirmsenderemail.Text = user_sender.Email;
            lblconfirmsenderphone.Text = user_sender.Phonenumber1;
            */

            //Check the type of payment
            bool receiverbankaccount = true;
            if (paymenttemp.Payment_object_receiver_type == 1) //going to bank account
            {
                lblType.Text = "To Bank Account";
                BankAccounts bank_receiver = sitetemp.getBankAccounts(0,paymenttemp.Payment_object_receiver);
                lblconfirmreceiverfullname.Text = bank_receiver.First_name + " " + bank_receiver.Last_name;

                if (bank_receiver.Currency_key == 3)//USD account
                {
                    lblconfirmreceiverABArouting.Text = bank_receiver.ABArouting;
                    pnlconfirmreceiverABArouting.Visible = true;
                    pnlconfirmreceiverBankCode.Visible = false;
                    pnlconfirmreceiverIBAN.Visible = false;
                }
                else
                {
                    lblconfirmreceiverIBAN.Text = bank_receiver.IBAN;
                }
                pnlconfirmreceiverAccount.Visible = true;
                lblconfirmreceiverAccount.Text = bank_receiver.Account_number;
                lblconfirmreceiverBankCode.Text = bank_receiver.BIC;
            }
            else if (paymenttemp.Payment_object_receiver_type == 3) //going to user balance
            {
                lblType.Text = "To User Balance";
                receiverbankaccount = false;
                Users user_receiver = sitetemp.get_user_from_paymentobject(paymenttemp.Payment_object_receiver);
                lblreceivinguserbalance.Text = sitetemp.getcurrencycode(buycurrency) + " User Balance: " + user_receiver.Email + " (" + user_receiver.Full_name + ")";
            }
            else if (paymenttemp.Payment_object_receiver_type == 7) //Embee top up
            {
                lblType.Text = "To Phone Top Up";
                receiverbankaccount = false;
                EmbeeObject embee = sitetemp.getEmbeeObject(paymentkey);
                lblreceivinguserbalance.Text = embee.Productname;
            }

            if (!receiverbankaccount)
            {
                pnlreceivinguserbalance.Visible = true;
                pnlreceivingbankaccount.Visible = false;
            }

            lblFundingSource.Text = "Bank Account";
            if (paymenttemp.Payment_object_sender != 0)
            {
                if (sitetemp.IsBankAccount(paymenttemp.Payment_object_sender))
                {
                    lblFundingSource.Text = "Bank Account";
                    lblBankDetails.Text = sitetemp.getBankAccountDescription(paymenttemp.Payment_object_sender);
                }
                else if (sitetemp.IsUserBalance(paymenttemp.Payment_object_sender))
                {
                    lblFundingSource.Text = sitetemp.getcurrencycode(sellcurrency) + " User Balance: " + user_sender.Email + " (" + user_sender.Full_name + ")";
                }
            }

            /*
            bool receiverbankaccount = true;
            if (ddlReceivers.SelectedValue != "0")
            {
                if (ddlReceivers.SelectedValue == "-1")
                {
                    //selected other passport user
                    lblreceivinguserbalance.Text = ddlotherpassportusers.Text;
                    receiverbankaccount = false;
                }
                else if (ddlReceivers.SelectedValue == "-2")
                {
                    //selected embee top up
                    lblreceivinguserbalance.Text = ddlembeecatalog.SelectedItem.Text;
                    receiverbankaccount = false;
                }
                else
                {
                    if (ddlReceivers.SelectedValue != "")
                    {
                        if (sitetemp.IsUserBalance(Convert.ToInt64(ddlReceivers.SelectedValue)))
                        {
                            //it's a user balance, get user balance info
                            lblreceivinguserbalance.Text = ddlReceivers.SelectedItem.Text;
                            receiverbankaccount = false;
                        }
                    }
                }

                if (!receiverbankaccount)
                {
                    pnlreceivinguserbalance.Visible = true;
                    pnlreceivingbankaccount.Visible = false;
                }
            }*/

            lblconfirmreceiverdescription.Text = paymenttemp.Payment_description;
            //lblconfirmreceiveremail.Text = txtemailreceiver.Text;
            lblCreatedDate.Text = paymenttemp.Date_created.AddHours(sitetemp.getTimezoneOffset(currentuser.Timezoneid)).ToString();
            lblStatus.Text = paymenttemp.Payment_status_text;
        }
Esempio n. 12
0
 public Users get_treasury_account(int treasury_type)
 {
     Users currentuser = new Users();
     DataTable dttemp = Peerfx_DB.SPs.ViewTreasuryAccount(treasury_type).GetDataSet().Tables[0];
     if (dttemp.Rows.Count > 0)
     {
         if (dttemp.Rows[0]["user_key"] != DBNull.Value){
           currentuser = get_user_info(Convert.ToInt32(dttemp.Rows[0]["user_key"]));
         }
     }
     return currentuser;
 }
Esempio n. 13
0
        public void Send_Email_Payment_Completed(int paymentkey, Users currentuser)
        {
            Payment paymenttemp = sitetemp.getPayment(paymentkey);

            string thebody = getHeader(currentuser.Full_name) + System.IO.File.ReadAllText(HttpContext.Current.Server.MapPath("/Emails/payment_completed.txt")) + getPaymentdetails(paymentkey) + getFooter();

            SimpleEmail(currentuser.Full_name, "", currentuser.Email, "", thebody, "Passport Payment Completed");
        }
Esempio n. 14
0
        public void Send_Email_Payment_Confirmed(int paymentkey, Users currentuser)
        {
            Payment paymenttemp = sitetemp.getPayment(paymentkey);

            if (paymenttemp.Payment_object_receiver_type == 7)//embee top up
            {
                Send_Email_Payment_Confirmed_Embee(paymentkey);
            }
            else //all other types of payments
            {

                string thebody = getHeader(currentuser.Full_name) + System.IO.File.ReadAllText(HttpContext.Current.Server.MapPath("/Emails/payment_confirmed.txt")) + getPaymentdetails(paymentkey) + getFooter();

                if (sitetemp.IsUserBalance(paymenttemp.Payment_object_sender)) //funding source is user balance
                {
                    thebody = thebody.Replace("DEPOSITINSTRUCTIONS", "");
                }
                else
                {
                    //funding source is bank account, include deposit instructions
                    string thebodydepositinstructions = System.IO.File.ReadAllText(HttpContext.Current.Server.MapPath("/Emails/payment_confirmed_depositinstructions.txt"));
                    string peerfxbankaccount = sitetemp.getBankAccountDescription(sitetemp.get_Payment_Object_sendmoneyto_For_Payment(currentuser.User_key, paymenttemp.Sell_currency));

                    thebody = thebody.Replace("DEPOSITINSTRUCTIONS", thebodydepositinstructions);
                    thebody = thebody.Replace("BANKACCOUNT", peerfxbankaccount);
                    thebody = thebody.Replace("NEXTSTEPS", sitetemp.RenderUserControl("~/User_Controls/ExchangeCurrency_NextSteps.ascx"));
                }

                SimpleEmail(currentuser.Full_name, "", currentuser.Email, "", thebody, "Passport Payment Confirmed");
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     LastUpdated();
     currentuser = sitetemp.getcurrentuser(true);
 }
Esempio n. 16
0
        public void VerifyClient(Users user)
        {
            Hashtable hstemp = new Hashtable();

            hstemp.Add("clientId", Get_hsclient(user.Bancbox_client_id));
            hstemp.Add("generateQuestions", 2);

            string strresponse = Web_Request("verifyClient", hstemp);
            //get clientid
            JObject o = JObject.Parse(strresponse);

            int status = (int)o["status"];
            if (status == 1)
            {
                string cipStatus = (string)o["cipStatus"];
                Peerfx_DB.SPs.UpdateBancBoxCipstatus(user.Bancbox_client_id, cipStatus).Execute();
            }
        }
Esempio n. 17
0
        private Users view_users_info_getdbinfo(DataSet dstemp)
        {
            Users users = new Users();
            users.User_key = 0;
            users.Bancbox_client_id = 0;
            users.Bancbox_payment_object_key = 0;
            if (dstemp.Tables[0].Rows[0]["user_key"] != DBNull.Value)
            {
                users.User_key = Convert.ToInt32(dstemp.Tables[0].Rows[0]["user_key"].ToString());
            }
            if (dstemp.Tables[0].Rows[0]["account_number"] != DBNull.Value)
            {
                users.Account_number = dstemp.Tables[0].Rows[0]["account_number"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["title"] != DBNull.Value)
            {
                users.Title = dstemp.Tables[0].Rows[0]["title"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["first_name"] != DBNull.Value)
            {
                users.First_name = dstemp.Tables[0].Rows[0]["first_name"].ToString();
                users.Full_name = users.First_name;
            }
            if (dstemp.Tables[0].Rows[0]["middle_name"] != DBNull.Value)
            {
                users.Middle_name = dstemp.Tables[0].Rows[0]["middle_name"].ToString();
                users.Full_name += " " + users.Middle_name;
            }
            if (dstemp.Tables[0].Rows[0]["last_name"] != DBNull.Value)
            {
                users.Last_name = dstemp.Tables[0].Rows[0]["last_name"].ToString();
                users.Full_name += " " + users.Last_name;
            }
            if (dstemp.Tables[0].Rows[0]["dob"] != DBNull.Value)
            {
                users.Dob = Convert.ToDateTime(dstemp.Tables[0].Rows[0]["dob"].ToString());
            }
            if (dstemp.Tables[0].Rows[0]["country_residence"] != DBNull.Value)
            {
                users.Country_residence = Convert.ToInt32(dstemp.Tables[0].Rows[0]["country_residence"].ToString());
            } if (dstemp.Tables[0].Rows[0]["email"] != DBNull.Value)
            {
                users.Email = dstemp.Tables[0].Rows[0]["email"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["ip_address"] != DBNull.Value)
            {
                users.Ip_address = dstemp.Tables[0].Rows[0]["ip_address"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["last_changed"] != DBNull.Value)
            {
                users.Last_changed = Convert.ToDateTime(dstemp.Tables[0].Rows[0]["last_changed"].ToString());
            }
            if (dstemp.Tables[0].Rows[0]["last_online"] != DBNull.Value)
            {
                users.Last_online = Convert.ToDateTime(dstemp.Tables[0].Rows[0]["last_online"]);
            }
            if (dstemp.Tables[0].Rows[0]["signed_up"] != DBNull.Value)
            {
                users.Signed_up = Convert.ToDateTime(dstemp.Tables[0].Rows[0]["signed_up"].ToString());
            } if (dstemp.Tables[0].Rows[0]["user_status"] != DBNull.Value)
            {
                users.User_status = Convert.ToInt32(dstemp.Tables[0].Rows[0]["user_status"].ToString());
            } if (dstemp.Tables[0].Rows[0]["isadmin"] != DBNull.Value)
            {
                users.Isadmin = Convert.ToBoolean(dstemp.Tables[0].Rows[0]["isadmin"].ToString());
            } if (dstemp.Tables[0].Rows[0]["address1"] != DBNull.Value)
            {
                users.Address1 = dstemp.Tables[0].Rows[0]["address1"].ToString();
            } if (dstemp.Tables[0].Rows[0]["address2"] != DBNull.Value)
            {
                users.Address2 = dstemp.Tables[0].Rows[0]["address2"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["city"] != DBNull.Value)
            {
                users.City = dstemp.Tables[0].Rows[0]["city"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["state"] != DBNull.Value)
            {
                users.State = dstemp.Tables[0].Rows[0]["state"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["country"] != DBNull.Value)
            {
                users.Country = Convert.ToInt32(dstemp.Tables[0].Rows[0]["country"].ToString());
            } if (dstemp.Tables[0].Rows[0]["postalcode"] != DBNull.Value)
            {
                users.Postalcode = dstemp.Tables[0].Rows[0]["postalcode"].ToString();
            } if (dstemp.Tables[0].Rows[0]["phonecountrycode1"] != DBNull.Value)
            {
                users.Phonecountrycode1 = dstemp.Tables[0].Rows[0]["phonecountrycode1"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["phonetype1"] != DBNull.Value)
            {
                users.Phonetype1 = Convert.ToInt32(dstemp.Tables[0].Rows[0]["phonetype1"].ToString());
            }
            if (dstemp.Tables[0].Rows[0]["phonenumber1"] != DBNull.Value)
            {
                users.Phonenumber1 = dstemp.Tables[0].Rows[0]["phonenumber1"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["phonecountrycode2"] != DBNull.Value)
            {
                users.Phonecountrycode2 = dstemp.Tables[0].Rows[0]["phonecountrycode2"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["phonetype2"] != DBNull.Value)
            {
                users.Phonetype2 = Convert.ToInt32(dstemp.Tables[0].Rows[0]["phonetype2"].ToString());
            } if (dstemp.Tables[0].Rows[0]["phonenumber2"] != DBNull.Value)
            {
                users.Phonenumber2 = dstemp.Tables[0].Rows[0]["phonenumber2"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["identitynationality"] != DBNull.Value)
            {
                users.Identitynationality = Convert.ToInt32(dstemp.Tables[0].Rows[0]["identitynationality"].ToString());
            }
            if (dstemp.Tables[0].Rows[0]["user_status_text"] != DBNull.Value)
            {
                users.User_status_text = dstemp.Tables[0].Rows[0]["user_status_text"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["ssn"] != DBNull.Value)
            {
                users.Ssn = dstemp.Tables[0].Rows[0]["ssn"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["passportnumber"] != DBNull.Value)
            {
                users.Passportnumber = dstemp.Tables[0].Rows[0]["passportnumber"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["bancbox_client_id"] != DBNull.Value)
            {
                users.Bancbox_client_id = Convert.ToInt32(dstemp.Tables[0].Rows[0]["bancbox_client_id"]);
            }
            if (dstemp.Tables[0].Rows[0]["bancbox_client_status"] != DBNull.Value)
            {
                users.Bancbox_client_status = dstemp.Tables[0].Rows[0]["bancbox_client_status"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["bancbox_cip_status"] != DBNull.Value)
            {
                users.Bancbox_cipstatus = dstemp.Tables[0].Rows[0]["bancbox_cip_status"].ToString();
            }
            if (dstemp.Tables[0].Rows[0]["bancbox_payment_object_key"] != DBNull.Value)
            {
                users.Bancbox_payment_object_key = Convert.ToInt64(dstemp.Tables[0].Rows[0]["bancbox_payment_object_key"]);
            }
            if (dstemp.Tables[0].Rows[0]["default_currency"] != DBNull.Value)
            {
                users.Default_currency = Convert.ToInt32(dstemp.Tables[0].Rows[0]["default_currency"]);
            }

            if (dstemp.Tables[0].Rows[0]["timezone"] != DBNull.Value)
            {
                users.Timezonekey = Convert.ToInt32(dstemp.Tables[0].Rows[0]["timezone"]);
            }
            else
            {
                users.Timezonekey = 2;
            }

            if (dstemp.Tables[0].Rows[0]["timezoneid"] != DBNull.Value)
            {
                users.Timezoneid = dstemp.Tables[0].Rows[0]["timezoneid"].ToString();
            }
            else
            {
                users.Timezoneid = "UTC";
            }

            //check if file exists
            string fullurl = HttpContext.Current.Server.MapPath("/Files/UserImages/") + "\\" + users.User_key.ToString() + ".jpg";
            if (File.Exists(fullurl))
            {
                users.Image_url = ConfigurationSettings.AppSettings["Root_url"].ToString()+ "Files/UserImages/" + users.User_key.ToString() + ".jpg";
            }
            users.Isverified = false;
            if (dstemp.Tables[0].Rows[0]["verification_points"] != DBNull.Value)
            {
                users.Verification_points = Convert.ToInt32(dstemp.Tables[0].Rows[0]["verification_points"]);
                if (users.Verification_points > 100)
                {
                    users.Isverified = true;
                }
            }

            if (dstemp.Tables[0].Rows[0]["referral"] != DBNull.Value)
            {
                users.Referral = dstemp.Tables[0].Rows[0]["referral"].ToString();
            }

            return users;
        }
Esempio n. 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            currentuser = sitetemp.getcurrentuser(false);
            //currentuser = sitetemp.get_user_info(10);
            //HttpContext.Current.Session["currentuser"] = currentuser;
            if (!IsPostBack)
            {
                LoadCurrencyTable();
                LoadPaymentTable();
                lblusername.Text = currentuser.Full_name;
                lbluseremail.Text = currentuser.Email;
                lblaccountnumber.Text = currentuser.Account_number;
                if (Request.QueryString["notification"] == "true")
                {
                    Master.NotificationShow("Your Payment went through.<br/><br/>You should receive an email with information about your Request.");
                }
                CheckVerifications();

                ddlcurrencyview.DataTextField = "info_currency_code";
                ddlcurrencyview.DataValueField = "info_currencies_key";
                ddlcurrencyview.DataSource = sitetemp.view_info_currencies_cansell();
                ddlcurrencyview.DataBind();

                ddltimezone.DataTextField = "info_timezone_name";
                ddltimezone.DataValueField = "info_timezone_key";
                ddltimezone.DataSource = Peerfx_DB.SPs.ViewInfoTimezones().GetDataSet().Tables[0];
                ddltimezone.DataBind();
                ddltimezone.SelectedValue = currentuser.Timezonekey.ToString();

                if (currentuser.Default_currency > 0)
                {
                    ddlcurrencyview.SelectedValue = currentuser.Default_currency.ToString();
                }

                LoadNetBalance();

            }
            //insert profile img
            if (currentuser.Image_url != null)
            {
                Insertimgurl();
            }
            if (currentuser.Isverified)
            {
                imgverificationheader.ImageUrl = "/images/buttons/Verified_yes.png";
            }
            else if (currentuser.Verification_points > 0)
            {
                imgverificationheader.ImageUrl = "/images/buttons/Verified_middle.png";
            }
        }
Esempio n. 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            currentuser = sitetemp.getcurrentuser(false);

            if (!IsPostBack)
            {
                //Load Currency dropdowns
                ddlsellcurrency.DataTextField = "info_currency_code";
                ddlsellcurrency.DataValueField = "info_currencies_key";
                ddlsellcurrency.DataSource = sitetemp.view_info_currencies_cansell();
                ddlsellcurrency.DataBind();

                ddlbuycurrency.DataTextField = "info_currency_code";
                ddlbuycurrency.DataValueField = "info_currencies_key";
                ddlbuycurrency.DataSource = sitetemp.view_info_currencies_canbuy();
                ddlbuycurrency.DataBind();

                ddlsellcurrency.SelectedIndex = 1;

                LoadRates(true);
                Checkifcanofferpremium();

                DataTable dtcountries = sitetemp.populatecountrylist();

                ddlcountryresidence.DataTextField = "Country_Text";
                ddlcountryresidence.DataValueField = "info_country_key";
                ddlcountryresidence.DataSource = dtcountries;
                ddlcountryresidence.DataBind();

                if ((Request.QueryString["sell"] != null) && (Request.QueryString["sell"] != ""))
                {
                    txtsell.Text = Request.QueryString["sell"].ToString();
                    ddlsellcurrency.SelectedValue = Request.QueryString["sellc"].ToString();
                    ddlbuycurrency.SelectedValue = Request.QueryString["buyc"].ToString();
                }

                //load countries into ddlembeecountry
                ddlembeecountry.DataTextField = "country_text";
                ddlembeecountry.DataValueField = "country";
                ddlembeecountry.DataSource = Peerfx_DB.SPs.ViewEmbeeCountries().GetDataSet().Tables[0];
                ddlembeecountry.DataBind();

            }
            if (sitetemp.isloggedin())
            {
                currentuser = sitetemp.getcurrentuser(false);
                hduserkey.Value = currentuser.User_key.ToString();

                pnlloggedinsender.Visible = true;
                pnlloggedinsender2.Visible = true;
                pnlnewsender.Visible = false;
                pnlnewsender2.Visible = false;
                ucUserInfo1.Choose_User(currentuser.User_key);
                ucUserInfo2.Choose_User(currentuser.User_key);
                txtfirstnamesender.Text = currentuser.First_name;
                txtlastnamesender.Text = currentuser.Last_name;

                if (!IsPostBack)
                {
                    LoadRecipientList();

                    //check if verified or not
                    /*
                    if (currentuser.Verification_points < 100)
                    {
                        btnContinue1.Visible = false;
                        btnNotVerified.Visible = true;
                    }*/
                }
            }
            else if (hduserkey.Value != "0")
            {
                currentuser = sitetemp.getcurrentuser(false);
            }
            if (!IsPostBack)
            {
                LoadRates(true);
            }
        }
Esempio n. 20
0
        protected void LoadRecipientList()
        {
            ddlReceivers.Items.Clear();

            //if logged in & have recipient list
            currentuser = sitetemp.getcurrentuser(false);
            DataSet dsrecipient = Peerfx_DB.SPs.ViewRecipientsByuserAndcurrency(currentuser.User_key,Convert.ToInt32(ddlbuycurrency.SelectedValue)).GetDataSet();
            if (dsrecipient.Tables[0].Rows.Count > 0)
            {
                //have at least 1 person on list
                ddlReceivers.DataTextField = "ddltext";
                ddlReceivers.DataValueField = "payment_object_key";
                ddlReceivers.DataSource = dsrecipient.Tables[0];
                ddlReceivers.DataBind();

                Loadtxtreceiverfields(Convert.ToInt64(ddlReceivers.Items[0].Value));
            }
            //Add New Recipient
            RadListBoxItem rdtemp = new RadListBoxItem();
            rdtemp.Value = "0";
            rdtemp.Text = "Bank Account";
            ddlReceivers.Items.Add(rdtemp);

            if (sitetemp.isCurrencyCanhold(Convert.ToInt32(ddlbuycurrency.SelectedValue)))
            {
                //Add Other Passport User
                RadListBoxItem rdtemp3 = new RadListBoxItem();
                rdtemp3.Value = "-1";
                rdtemp3.Text = "Another Passport User";
                ddlReceivers.Items.Add(rdtemp3);
            }

            //Add Embee Telco
            /*RadListBoxItem rdtemp4 = new RadListBoxItem();
            rdtemp4.Value = "-2";
            rdtemp4.Text = "Top Up Phone";
            ddlReceivers.Items.Add(rdtemp4);
            */

            if (sitetemp.isCurrencyCanhold(Convert.ToInt32(ddlbuycurrency.SelectedValue)))
            {
                DataTable dtuserbalance = sitetemp.getuserbalance_datatable(currentuser.User_key, Convert.ToInt32(ddlbuycurrency.SelectedValue));
                RadListBoxItem rdtemp2 = new RadListBoxItem();
                rdtemp2.Value = dtuserbalance.Rows[0]["payment_object_key"].ToString();
                rdtemp2.Text = dtuserbalance.Rows[0]["user_balance_text"].ToString();
                ddlReceivers.Items.Insert(0, rdtemp2);
            }

            ddlReceivers.SelectedIndex = 0;

            pnlembee.Visible = false;
            pnlotherpassportuser.Visible = false;
            pnlnewreceiver.Visible = false;
            pnlexistingreceiver.Visible = true;

            if (ddlReceivers.SelectedValue == "0")
            {
                openbankaccountentry();
            }
            /*else
            {
                pnlnewreceiver.Visible = true;
                pnlexistingreceiver.Visible = false;
                Cleartxtreceiverfields();
            }*/
        }
Esempio n. 21
0
 public Users getcurrentuser(bool MustbeAdmin)
 {
     Users user = new Users();
     //Check if logged in
     if (HttpContext.Current.Session["currentuser"] != null)
     {
         //User logged in
         user = (Users)HttpContext.Current.Session["currentuser"];
         user = get_user_info(user.User_key);
         HttpContext.Current.Session["currentuser"] = user;
         if ((user.Isadmin == false) && (MustbeAdmin))
         {
             //Redirect to login page
             HttpContext.Current.Response.Redirect(ConfigurationSettings.AppSettings["Root_url"] + "Login.aspx");
         }
         Peerfx_DB.SPs.UpdateUsersLastOnline(user.User_key).Execute();
     }
     else
     {
         //Redirect to login page
         HttpContext.Current.Response.Redirect(ConfigurationSettings.AppSettings["Root_url"] + "Login.aspx");
     }
     return user;
 }
Esempio n. 22
0
        public Int64 OpenAccount(Users user)
        {
            Int64 returnpaymentobject = 0;
            Hashtable hstemp = new Hashtable();

            hstemp.Add("clientId", Get_hsclient(user.Bancbox_client_id));
            hstemp.Add("title", "Passport USD Account");

            Hashtable hsroutable = new Hashtable();
            hsroutable.Add("credits", "YES");
            hsroutable.Add("debits", "NO");
            hstemp.Add("routable", hsroutable);

            string strresponse = Web_Request("openAccount", hstemp);

            JObject o = JObject.Parse(strresponse);

            int status = (int)o["status"];
            if (status == 1)
            {
                JObject o2 = (JObject)o["account"];
                JObject o3 = (JObject)o2["id"];
                Int64 accountid = (Int64)o3["bancBoxId"];
                string routing = (string)o2["routingNumber"];
                returnpaymentobject = sitetemp.insert_bancbox_account_returnpaymentobject(user.User_key, 3, sitetemp.getBancBoxOrganizationkey(), "BancBox Account", user.User_key, accountid.ToString(), "", "", routing, user.First_name, user.Last_name, "");
            }
            return returnpaymentobject;
        }
Esempio n. 23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     currentuser = sitetemp.getcurrentuser(false);
     if (!IsPostBack)
     {
         Loadcurrency();
         if (ddlcurrency.SelectedIndex > -1)
         {
             Loadreceiverlist();
         }
         BankAccountEntry1.hidecurrency();
     }
 }