protected void On_Click_Sell_Button(object sender, EventArgs e)
 {
     if (int.Parse(qty_txt.Value.ToString()) <= 0)
     {
         message.Text = "Not Allowed Negative Number ";
     }
     else
     {
         totalPrice = double.Parse(priceofstock_txt.Value.ToString()) * double.Parse(qty_txt.Value.ToString());
         dal        = new DataAccessLayer();
         pInf       = new personal_Information();
         vDiffBetweenBuyingandSelling = pInf.Ensuring_that_This_Client__Have_EnoughNumofStocks_for_Specific_Stock((string)Session["mail"], vStockName);
         if (vDiffBetweenBuyingandSelling != -1 && vDiffBetweenBuyingandSelling >= int.Parse(qty_txt.Value.ToString()))
         {
             vDiffBetweenBuyingandSelling -= int.Parse(qty_txt.Value.ToString());
             dal.Updating_Savings_For_Selling((string)Session["mail"], totalPrice);
             dal.Updating_theDiffofNumofStocksBuyandSell_for_Specific_Stock(vStockName, (string)Session["mail"], vDiffBetweenBuyingandSelling);
             dal.Insert_New_Order(vUserName, (string)Session["mail"], vStockName, DateTime.Parse(tdate_txt.Value.ToString()), totalPrice, int.Parse(qty_txt.Value.ToString()), "Selling");
             message.Text = "Selling Process Performed Successfully :D ";
         }
         else
         {
             message.Text = " YOU DONT HAVE ENOUGH # STOCKS FOR " + vStockName;
         }
     }
 }
Пример #2
0
        protected void on_Click_Confirm_Button(object sender, EventArgs e)
        {
            string temp            = Request.QueryString["username"];
            personal_Information p = new personal_Information();

            if (p.Retrieve_Exp_Date(temp).AddDays(1) > DateTime.Now)
            {
                p.confirm_Change_Password(temp, npass_txt.Value.ToString());
                Response.Write("<script> alert ('your password has been successfully updated') </script>");
                Response.Redirect("Login_Page.aspx");
            }
            lbresult.Text = " This Link Was Expired ";
        }
Пример #3
0
        public void on_Click_Login_Button(object sender, EventArgs e)
        {
            if (mailLogin_txt.Value.ToString() == "" || passLogin_txt.Value.ToString() == "")
            {
                return;
            }
            pInf  = new personal_Information();
            count = (int)ViewState["counter"];
            if (pInf.ensure_Email_with_Password(mailLogin_txt.Value.ToString(), passLogin_txt.Value.ToString()) && count != 0)
            {
                if (pInf.Check_User_Blocking(mailLogin_txt.Value.ToString()))
                {
                    Block_msg.Visible = true;
                    Block_msg.Text    = "Your Account Blocked ,Contact Us Please";
                    return;
                }
                else if (count != 5)
                {
                    count = 5;
                    ViewState["counter"] = count;
                }
                Session.Add("mail", mailLogin_txt.Value.ToString());
                Session.Add("log", 1);
                Response.Redirect("Insert_Order_or_Monitor_Users.aspx");
            }
            else
            {
                Block_msg.Visible = true;
                if (pInf.Check_User_Blocking(mailLogin_txt.Value.ToString()))
                {
                    Block_msg.Text = "Your Account Blocked ,Contact Us Please";
                    return;
                }
                else if (count == 0)
                {
                    pInf.Set_User_to_Blocked(mailLogin_txt.Value.ToString(), 'Y');
                    Block_msg.Text = " Your Account Was Blocked ";
                    /*Here Write the Code that put the Blocked user on the Monitor Page */
                    flag_Login = true;
                    return;
                }

                Block_msg.Text = "Invalid Email or Password ";
                count--;
                ViewState["counter"] = count;
            }
            flag_Login = true;
        }
Пример #4
0
        protected void on_Click_Sign_Up_Btn(object sender, EventArgs e)
        {
            //Session.Add("sign_doone", 1);
            if (int.Parse(saving_txt.Value.ToString()) <= 0)
            {
                savings_lbl.Text = "Not Allowed Negative or Zero . ";
                return;
            }
            message.Text = "";
            pInf         = new personal_Information();

            if (pInf.ensure_Exsisting_E_Mail(email_txt.Value.ToString()))
            {
                message.Text    = " This Mail Already Exsist ";
                message.Visible = true;
                return;
            }
            else
            {
                if (FileUpload1.HasFile)
                {
                    string extension = System.IO.Path.GetExtension(FileUpload1.FileName);

                    string imagename = FileUpload1.FileName;
                    if (extension == ".jpg" || extension == ".png" || extension == ".gif")
                    {
                        string path = Server.MapPath("assets/img/");
                        FileUpload1.SaveAs(path + imagename);

                        //vParam = new OracleParameter(":img", imagename);
                        //vParam.Direction = System.Data.ParameterDirection.Input;
                        //vParam.OracleType = OracleType.VarChar;
                        //vcmd.Parameters.Add(vParam);
                    }

                    pInf.Add_New_Client(fname_txt.Value.ToString(), lname_txt.Value.ToString(), email_txt.Value.ToString(), DateTime.Parse(bdate_txt.Value.ToString()), pass_txt.Value.ToString(), double.Parse(saving_txt.Value.ToString()), 'N', imagename, DateTime.Now);
                }
                else
                {
                    pInf.Add_New_Client(fname_txt.Value.ToString(), lname_txt.Value.ToString(), email_txt.Value.ToString(), DateTime.Parse(bdate_txt.Value.ToString()), pass_txt.Value.ToString(), double.Parse(saving_txt.Value.ToString()), 'N', "NULL", DateTime.Now);
                }
                signupmessage.Text = "You Are Signed Up Successfully :D ";
            }
        }
        protected void on_Click_Send_Btn(object sender, EventArgs e)
        {
            personal_Information p = new personal_Information();

            try
            {
                #region temp
                //string _connectionString = "Data source = orcl; User Id = hr; Password = hr;";
                ////personal_Information p = new personal_Information();
                //DataTable dt = new DataTable();
                //OracleConnection conn = new OracleConnection(_connectionString);
                // OracleCommand cmd = new OracleCommand("select * from stock_market where e_mail = :email", conn);

                // cmd.Parameters.Add("email", OracleDbType.Varchar2).Value = (string)Session["mail"];
                // conn.Open();
                // OracleDataAdapter adp = new OracleDataAdapter(cmd);


                //adp.Fill(dt);

                //if (dt.Rows.Count > 0)
                //{



                //    SendEmail((string)Session["mail"]);

                //    lbresult.Text = "successfully sent reset link on  your mail ,please check once! Thank you.";
                //    conn.Close();

                //    cmd.Dispose();

                //    email_txt.Value = "";
                //}
                //    else
                //    {

                //        lbresult.Text = "Please enter valid email ,please check once! Thank you.";
                //        conn.Close();

                //        cmd.Dispose();
                //    }

                //}

                //catch (Exception ex)
                //{

                //}

                #endregion

                if (p.ensure_Exsisting_E_Mail(email1_txt.Value.ToString()))
                {
                    DataAccessLayer.SendEmail(email1_txt.Value.ToString());
                    p.Update_Exp_Date(email1_txt.Value.ToString(), DateTime.Now);
                    lbresult.Text = "successfully sent reset link on  your mail ,please check once! Thank you.";
                    lbresult.BackColor.Equals("Green");
                    email1_txt.Value = "";
                }
                else
                {
                    lbresult.Text = "Please enter valid email ,please check once! Thank you." + email1_txt.Value.ToString();
                }
            }

            catch (Exception ex)
            {
                lbresult.Text = ex.Message;
            }
        }