예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.UrlReferrer == null)
            {
                base.AutoRedirect();
            }
            SessionValues svalue = new SessionValues();

            //  base.UsessionValue = svalue.FetchUsersAndComp(string.IsNullOrEmpty(Convert.ToString(Session["Visageuseridno"])) ? 0 : Convert.ToInt32(Session["Visageuseridno"]));
            // conString = ConfigurationManager.ConnectionStrings["VisageConnectionString"].ToString();
            svalue = null;
            if (!Page.IsPostBack)
            {
                this.Title = "Manage Freight Memo";
                this.BindDateRange();
                ddlDateRange.SelectedIndex = 0;
                ddlDateRange_SelectedIndexChanged(null, null);
                if (Convert.ToString(Session["Userclass"]) == "Admin")
                {
                    this.BindCity();
                }
                else
                {
                    this.BindCity(Convert.ToInt64(Session["UserIdno"]));
                }
                FreightMemoDAL objChallanDelverdDAL = new FreightMemoDAL();
                txtDateFrom.Attributes.Add("onkeypress", "return notAllowAnything(event);");
                txtDateTo.Attributes.Add("onkeypress", "return notAllowAnything(event);");
                Countall();
                ddlDateRange.Focus();
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionValues svalue = new SessionValues();

            if (Request.UrlReferrer == null)
            {
                base.AutoRedirect();
            }
            if (!Page.IsPostBack)
            {
                if (base.CheckUserRights(intFormId) == false)
                {
                    Response.Redirect("PermissionDenied.aspx");
                }
                if (base.ADD == false)
                {
                    lnkBtnSave.Visible = false;
                }
                if (base.View == false)
                {
                    lnkBtnSave.Visible = false;
                }
                if (Convert.ToString(Session["Userclass"]) == "Admin")
                {
                    this.BindCity();
                }
                else
                {
                    this.BindCity(Convert.ToInt64(Session["UserIdno"]));
                }
                BindDateRange();
            }
            svalue = null;
        }
        protected void Button1_Click1(object sender, EventArgs e)
        {
            if (!pageRefresh)
            {
                if (Request.QueryString["param1"] != null)
                {
                    for (int i = 0; i < test_method().Count(); i++)
                    {
                        if (test_method()[i].getProductID() == Convert.ToInt32(Request.QueryString["param1"]))
                        {
                            int id = Convert.ToInt32(Request.QueryString["param1"]);


                            SessionValues sv = new SessionValues();
                            sv.addToCart(id);

                            break;
                        }
                        else
                        {
                        }
                    }
                }
            }
        }
예제 #4
0
 protected void SetSessionValue(SessionValues key, string value)
 {
     if (!string.IsNullOrWhiteSpace(value))
     {
         HttpContext.Session.SetString(key.ToString(), value);
     }
 }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionValues svalue = new SessionValues();

            //  base.UsessionValue = svalue.FetchUsersAndComp(string.IsNullOrEmpty(Convert.ToString(Session["Visageuseridno"])) ? 0 : Convert.ToInt32(Session["Visageuseridno"]));
            if (Request.UrlReferrer == null)
            {
                base.AutoRedirect();
            }
            if (!Page.IsPostBack)
            {
                if (base.CheckUserRights(intFormId) == false)
                {
                    Response.Redirect("PermissionDenied.aspx");
                }
                if (base.ADD == false)
                {
                    lnkBtnSave.Visible = false;
                }
                if (base.View == false)
                {
                    lblViewList.Visible = false;
                }
                txtDate.Attributes.Add("onkeypress", "return notAllowAnything(event);");
                txtDate.Text = System.DateTime.Now.ToString("dd-MM-yyyy");
                this.BindDateRange();
                ddlDateRange.SelectedValue = Convert.ToString(base.UserDateRng);
                ddlDateRange.SelectedIndex = 0;
                ddlDateRange_SelectedIndexChanged(null, null);
                if (Convert.ToString(Session["Userclass"]) == "Admin")
                {
                    this.BidFromCity();
                }
                else
                {
                    this.BindCity(Convert.ToInt64(Session["UserIdno"]));
                }

                ChallanDelverdDAL objChallanDelverdDAL = new ChallanDelverdDAL();
                tblUserPref       obj = objChallanDelverdDAL.selectUserPref();
                ddlToCity.SelectedValue = Convert.ToString(base.UserFromCity);
                BindChlnNo();
                ViewState["dt"] = null;
                if (Request.QueryString["chlnrcptidno"] != null)
                {
                    lnkSubmit.Visible = false; ddlChallanDetl.Enabled = false; DivRcptNo.Visible = true; txtRcptNo.Visible = true; ddlToCity.Enabled = false;

                    this.Populate(Convert.ToInt32(Request.QueryString["chlnrcptidno"]));
                    this.Title        = "Edit Delivery Challan";
                    lnkBtnNew.Visible = true;
                }
                else
                {
                    lnkSubmit.Visible = true; ddlChallanDetl.Enabled = true; txtRcptNo.Visible = false; DivRcptNo.Visible = false; lblRcptDtNo.Text = "Receipt Date"; ddlToCity.Enabled = true;
                    lnkBtnNew.Visible = false;
                }
                ddlDateRange.Focus();
            }
            svalue = null;
        }
예제 #6
0
        private void succesfulLogIn()
        {
            Customer customer = databaseConnector.getCustomerObject(emailTextBox.Text);

            if (customer.getIsActive() == 1)
            {
                accountActivatedLabel.Visible = false;
                System.Diagnostics.Debug.WriteLine("logged in");
                SessionValues sessionValues = new SessionValues();
                sessionValues.setLoginSession(customer);
                // Session.Add("currentLogedInUserObject", customer);
                //Session.Add("logedInStatus", true);
                // Response.Redirect("ShoppingPage_WebForm.aspx");
                if (redirectToCart)
                {
                    Response.Redirect("ShoppingCart_WebForm.aspx");
                }
                else
                {
                    Response.Redirect("ShowAndEditProfile_WebForm.aspx");
                }
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("Customer is not activated");
                accountActivatedLabel.Visible = true;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.UrlReferrer == null)
            {
                base.AutoRedirect();
            }
            SessionValues svalue = new SessionValues();

            //  base.UsessionValue = svalue.FetchUsersAndComp(string.IsNullOrEmpty(Convert.ToString(Session["Visageuseridno"])) ? 0 : Convert.ToInt32(Session["Visageuseridno"]));
            // conString = ConfigurationManager.ConnectionStrings["VisageConnectionString"].ToString();
            svalue = null;
            if (!Page.IsPostBack)
            {
                this.Title = "Manage Delivery Register";
                this.BindDateRange();
                ddlDateRange.SelectedIndex = 0;
                ddlDateRange_SelectedIndexChanged(null, null);
                this.BidFromCity();
                ChallanDelverdDAL objChallanDelverdDAL = new ChallanDelverdDAL();
                tblUserPref       obj = objChallanDelverdDAL.selectUserPref();
                ddlTocity.SelectedValue = Convert.ToString(obj.BaseCity_Idno);
                txtDateFrom.Attributes.Add("onkeypress", "return notAllowAnything(event);");
                txtDateTo.Attributes.Add("onkeypress", "return notAllowAnything(event);");
                this.Countall();
                ddlDateRange.Focus();
            }
        }
예제 #8
0
 public ActionResult LogOut()
 {
     FormsAuthentication.SignOut();
     SessionValues.RemoveSession();
     Session.Clear();
     Session.RemoveAll();
     Session.Abandon();
     return(RedirectToAction("Login"));
 }
예제 #9
0
        protected void Button1_Command(object sender, CommandEventArgs e)
        {
            if (!pageRefresh)
            {
                int value = Int32.Parse(e.CommandArgument.ToString());

                //((List<FoodStoreV2.CSharpClasses.Cart>)Session["cartList"]).Add(new FoodStoreV2.CSharpClasses.Cart(value, 1000));
                int id = Convert.ToInt32(e.CommandArgument);
                // Do something with id
                //Response.Redirect("ProductPage_WebForm?param1=" + id.ToString() + "");

                SessionValues sv = new SessionValues();
                sv.addToCart(id);
            }
        }
예제 #10
0
        protected string getTotalAmount()
        {
            SessionValues sv = new SessionValues();

            sv.getCartSessionList();
            int totalAmount = 0;

            for (int i = 0; i < sv.getCartSessionList().Count; i++)
            {
                totalAmount += sv.getCartSessionList()[i].getProductAmount();
                System.Diagnostics.Debug.WriteLine("count total cart amount" + sv.getCartSessionList()[i].getProductAmount());
            }

            return(totalAmount.ToString());
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     sessionValues = new SessionValues();
     if (sessionValues.getCustomerSessionObject() == null)
     {
         Response.Redirect("ShoppingPage_WebForm");
     }
     else
     {
         // oldCustomerObject = (Customer)Session["currentLogedInUserObject"];
         oldCustomerObject  = sessionValues.getCustomerSessionObject();
         databaseConnecctor = new DatabaseConnector();
         if (!Page.IsPostBack)
         {
             fillTextBoxesWithOldInformation();
         }
     }
 }
예제 #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     sessionValues = new SessionValues();
     if (!Page.IsPostBack)
     {
         orderTable       = new DataTable();
         orderDetailTabel = new DataTable();
         createDataTables();
         addOrdersToGridView();
         gridViewDataBind();
     }
     else
     {
         orderTable       = (DataTable)ViewState["orderTable"];
         orderDetailTabel = (DataTable)ViewState["orderDetailTabel"];
         //orderDetailsList = (List<Order>)ViewState["orderDetailsList"];
         orderDetailsList = (List <Order>)HttpContext.Current.Session["orderDetailsList"];
     }
     ViewState["orderTable"]       = orderTable;
     ViewState["orderDetailTabel"] = orderDetailTabel;
 }
예제 #13
0
 public ClassRoom(SessionValues ob)
 {
     InitializeComponent();
     sv = ob;
 }
예제 #14
0
        protected List <Cart> callGetCartSessionListObject()
        {
            SessionValues sv = new SessionValues();

            return(sv.getCartSessionList());
        }
예제 #15
0
        protected Customer callGetCustomerSessionObject()
        {
            SessionValues sv = new SessionValues();

            return(sv.getCustomerSessionObject());
        }
예제 #16
0
        private void BLogin_Click(object sender, EventArgs e)
        {
            changeloadingtotrue();
            String Error = " "; ;
            if (IsValidEmail(EmailTB.Text) != true)
            {
                Error += "Please Enter correct Email!!\n ";
            }
            if (EmailTB.Text == "")
            {
                Error += "Please Enter Email Address !!\n";
            }
            if (PasswordTB.Text == "")
            {
                Error += " Please Enter Password !!";
            }
            if (Error != " ")
            {
                changeloadingtotrue();
                MessageBox.Show(Error);
                LoadingLabel.Visible = false;
            }
            else
            {

                changeloadingtotrue();
                //LoadingLabel.Visible = true;
                SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["AzureString"].ConnectionString);

                SqlCommand cmd = new SqlCommand("Select * from Senpai_Student where Email=@username and Password=@password", con);
                cmd.Parameters.AddWithValue("@username", EmailTB.Text);
                cmd.Parameters.AddWithValue("@password", PasswordTB.Text);
             //   try
             //   {
                    con.Open();
                    SqlDataAdapter adapt = new SqlDataAdapter(cmd);
                    DataSet ds = new DataSet();
                    adapt.Fill(ds);
                    con.Close();
                    int count = ds.Tables[0].Rows.Count;
                    //If count is equal to 1, than show frmMain form
                    MessageBox.Show(count.ToString());
                    if (count == 1)
                    {
                        MessageBox.Show("Login Successful!");
                        SqlCommand cmd1 = new SqlCommand("Select * from Senpai_Student where Email=@username and Password=@password", con);
                        cmd1.Parameters.AddWithValue("@username", EmailTB.Text);
                        cmd1.Parameters.AddWithValue("@password",PasswordTB.Text);
                        con.Open();
                        SqlDataAdapter adapt1 = new SqlDataAdapter(cmd1);
                        DataSet ds1 = new DataSet();
                        adapt1.Fill(ds1);
                        count = ds1.Tables[0].Columns.Count;

                        //MessageBox.Show(ds1.Tables[0].Rows[0]["Email"].ToString() + count);
                        SessionValues sv = new SessionValues();
                        sv.SenpaiID = ds1.Tables[0].Rows[0]["StudentSenpaiID"].ToString() ;
                        sv.Email = ds1.Tables[0].Rows[0]["Email"].ToString();
                        sv.UserName = ds1.Tables[0].Rows[0]["Name"].ToString();
                        sv.PhoneNumber = ds1.Tables[0].Rows[0]["PhoneNumber"].ToString();
                        sv.Gender = ds1.Tables[0].Rows[0]["Gender"].ToString();
                        sv.City = ds1.Tables[0].Rows[0]["City"].ToString();
                        sv.Stream = ds1.Tables[0].Rows[0]["Stream"].ToString();
                        sv.College = ds1.Tables[0].Rows[0]["College"].ToString();
                        sv.AboutYourself = ds1.Tables[0].Rows[0]["AboutYourself"].ToString();
                        Home ob = new Home(sv);
                        ob.Show();
                        this.Visible = false;
                    }
                    else
                    {
                        MessageBox.Show("Login Failed.");
                        LoadingLabel.Visible = false;

                    }
              //  }
               // catch
            //{
               //     MessageBox.Show("We are experiencing some technical difficulty. Kindly try again after some time.");
            //}

            }
        }
예제 #17
0
 public FindClassroom(SessionValues ob)
 {
     InitializeComponent();
     sv = ob;
 }
예제 #18
0
        protected string GetCookieValue(SessionValues key)
        {
            string value = CookieMgrService.Get(key.ToString());

            return(value);
        }
예제 #19
0
 protected void SetCookieValue(SessionValues key, string value, int?expireTime)
 {
     SetCookieValue(key, value, expireTime, false);
 }
예제 #20
0
 public Home(SessionValues temp)
 {
     InitializeComponent();
     sv = temp;
 }
예제 #21
0
 SymmetricAlgorithm PrepareAlgorithm()
 {
     SymmetricAlgorithm alg = cmbProviders.SelectedItem as SymmetricAlgorithm;
     int keyLength = (int)cmbKeySize.SelectedItem;
     alg.KeySize = keyLength;
     SessionValues sv = m_sessionValues.FirstOrDefault(p => p.ProviderType.Equals(alg.GetType()) && p.KeySize.Equals(keyLength));
     if (sv == null)
     {
         alg.GenerateKey();
         alg.GenerateIV();
         sv = new SessionValues()
         {
             Key = alg.Key,
             KeySize = alg.KeySize,
             ProviderType = alg.GetType(),
             IV = alg.IV
         };
         m_sessionValues.Add(sv);
     }
     else
     {
         alg.Key = sv.Key;
         alg.IV = sv.IV;
     }
     return alg;
 }
예제 #22
0
 protected void SetCookieValue(SessionValues key, string value, int?expireTime, bool isEssential)
 {
     CookieMgrService.Set(key.ToString(), value, expireTime, isEssential);
 }
예제 #23
0
        protected string GetSessionValue(SessionValues key)
        {
            string value = HttpContext.Session.GetString(key.ToString());

            return(value);
        }