void LoadUserInfo()
 {
     YardeCartData.UserDetails ud = new YardeCartData.UserDetails();
     ud.UserId = Convert.ToInt32(Session["UserId"].ToString());
     DataTable dt = oy.SelectUserProfile(ud);
     if (dt.Rows.Count > 0)
     {
         lblBankName.Text = dt.Rows[0]["BankName"].ToString();
         lblCardHoldername.Text = dt.Rows[0]["CardHolderName"].ToString();
         lblCardNumber.Text = dt.Rows[0]["CreditCardNumber"].ToString();
         lblCVCNumber.Text = dt.Rows[0]["CVCNumber"].ToString();
     }
 }
        public void ProcessRequest(HttpContext context)
        {
            string s = context.Request.QueryString["uid"].ToString();
            string sRem = context.Request.QueryString["rem"].ToString();
            //if (context.Session["UserId"] == null)
            context.Session.RemoveAll();
            context.Session.Add("UserId", s);
            YardeCartData.UserDetails ou= new YardeCartData.UserDetails();
            ou.UserId=Convert.ToInt32(s);
            YardeCartServiceApp.YardeCartServices oy = new YardeCartServices();
            DataTable dt = oy.SelectUserProfile(ou);
            string stype = "";
            string UserName = "";
            string Password = "";
            if (dt.Rows.Count > 0)
            {
                stype = dt.Rows[0]["UserStatus"].ToString();
                UserName = dt.Rows[0]["UserName"].ToString();
                Password = dt.Rows[0]["UserPassword"].ToString();
            }
            context.Session.Add("UserType", stype);

            HttpCookie cUserId = new HttpCookie("UserId", s.ToString().Trim());
            HttpCookie cUsertype = new HttpCookie("UserType", stype);
            cUserId.Expires = DateTime.Now.AddDays(5);
            cUsertype.Expires = DateTime.Now.AddDays(5);
            context.Response.Cookies.Add(cUserId);
            context.Response.Cookies.Add(cUsertype);

            if (sRem == "true")
            {
                //Response.Cookies.Clear();
                HttpCookie cUsername = new HttpCookie("UserName", UserName.ToString().Trim());
                HttpCookie cPassword = new HttpCookie("Password", Password.ToString().Trim());
                cUsername.Expires = DateTime.Now.AddDays(5);
                cPassword.Expires = DateTime.Now.AddDays(5);

                context.Response.Cookies.Add(cUsername);
                context.Response.Cookies.Add(cPassword);
            }
            else
            {
                context.Request.Cookies.Remove("UserName");
                context.Request.Cookies.Remove("Password");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            strServicePath = ConfigurationManager.AppSettings["ServicePath"].ToString();
            if (Request.Cookies["UserType"] != null)
            {
                Session.Add("UserType", Request.Cookies["UserType"].Value.ToString());
            }
            if (Request.QueryString.Count == 1)
            {
                //if (this.Page.Title.Contains("Activa") == false)
                {
                    //if (Session["UserId"] == null)
                        //Session.Add("UserId", Request.QueryString["uid"].ToString());
                }
            }
            else if (Request.Cookies["UserId"] != null)
            {
                Session.Add("UserId", Request.Cookies["UserId"].Value.ToString());
            }

            if ((Session["UserId"] != null && Session["UserType"] != null && Session["UserType"].ToString() == "2"))
            {
                welcomeMessage.InnerText = "Welcome Admin";
                isShowHideControl = "2";
            }
            else if (Session["UserId"] == null)
            {
                welcomeMessage.InnerText = "Welcome Guest";
                isShowHideControl = "0";
            }
            else
            {
                YardeCartServiceApp.YardeCartServices ySer=new YardeCartServices();

                YardeCartData.UserDetails yData = new YardeCartData.UserDetails();
                yData.UserId = Convert.ToInt32(Session["UserId"].ToString());
                //DataTable dt = ySer.SelectUserProfile(yData);
                //Array[] user = JsonConvert.DeserializeObject<Array[]>(dt);
                //if (dt.Rows.Count > 0)
                {
                   // welcomeMessage.InnerText = "Welcome " + dt.Rows[0]["UserName"].ToString();
                }
                isShowHideControl = "1";
            }
        }
 void LoadUserInfo()
 {
     YardeCartData.UserDetails ud = new YardeCartData.UserDetails();
     ud.UserId = Convert.ToInt32(Session["UserId"].ToString());
     DataTable dt = oy.SelectUserProfile(ud);
     if (dt.Rows.Count > 0)
     {
         lblName.Text = dt.Rows[0]["FirstName"].ToString() + " "+dt.Rows[0]["LastName"].ToString();
         if (dt.Rows[0]["Gender"].ToString() == "1")
             lblGender.Text = "Male";
         else if (dt.Rows[0]["Gender"].ToString() == "2")
             lblGender.Text = "Female";
         else if (dt.Rows[0]["Gender"].ToString() == "0")
             lblGender.Text = "Rather not say";
         lblEmail.Text = dt.Rows[0]["Email"].ToString();
         lblMobile.Text = dt.Rows[0]["Mobile"].ToString();
         lblAddress.Text = dt.Rows[0]["Address"].ToString();
         lblStreetname.Text = dt.Rows[0]["StreetName"].ToString();
         lblCountry.Text = dt.Rows[0]["CountryName"].ToString();
         lblCity.Text = dt.Rows[0]["CityName"].ToString();
         lblState.Text = dt.Rows[0]["StateName"].ToString();
         lblZipcode.Text = dt.Rows[0]["ZipCode"].ToString();
     }
 }
        protected void btnSaveAd_Click(object sender, EventArgs e)
        {
            //string str = fileuploadImg.PostedFile.FileName;
            HttpFileCollection fileCollection = Request.Files;
            for (int i = 0; i < fileCollection.Count; i++)
            {
                HttpPostedFile uploadfile = fileCollection[i];
                string fileName = Path.GetFileName(uploadfile.FileName);
            }
            YardeCartData.UserDetails usr = new YardeCartData.UserDetails();
            usr.UserId = Convert.ToInt32(strUserId);
            dt = objYser.SelectUserProfile(usr); // userid
            try
            {

                #region .. CREATE AD POST ..
                YardeCartData.AdPostDetails ad = new YardeCartData.AdPostDetails();
                ad.AdPostId = Convert.ToInt32(strAdpostId);
                ad.AdPostTitle = txtTitle.Text.ToString();
                ad.Description = txtDesc.Text.ToString();
                ad.Keywords = txtKeywords.Text.ToString();
                ad.UserId = Convert.ToInt32(strUserId);
                ad.CategoryId = Convert.ToInt32(ddlCategory.SelectedItem.Value.ToString());
                ad.Price = txtPrice.Text.ToString();
                ad.StateId = Convert.ToInt32(dt.Rows[0]["StateId"].ToString());
                ad.CityId = Convert.ToInt32(dt.Rows[0]["CityId"].ToString());
                ad.CountryId = Convert.ToInt32(dt.Rows[0]["CountryId"].ToString());
                ad.ZipCode = dt.Rows[0]["ZipCode"].ToString();
                ad.AdTillDate = txtShowDate.Value;
                ad.AdStatus = "NEW";
                ad.PaidStatus = 0;
                int intAdpostId = objYser.AddAdPost(ad);

                #endregion

                YardeCartData.AdImageDetails adimg=new YardeCartData.AdImageDetails();
                adimg.AdPostId=Convert.ToInt32(strAdpostId);
                adimg.ImageId= Convert.ToInt32(strImageId);
                adimg.ImagePath=strAllImgPath;
                adimg.VideoLink = txtVidolink.Text.ToString();
                objYser.AddAdImageDetails(adimg);

                if (dt.Rows[0]["UserStatus"].ToString()=="1")
                    Response.Redirect("MyHome.aspx?page=adpost");
                else if (dt.Rows[0]["UserStatus"].ToString() == "2")
                    Response.Redirect("MyAdminHome.aspx?page=adpost");

            }
            catch (System.Threading.ThreadAbortException th)
            {
            }
            catch (Exception ex)
            {
            }
        }