protected void btnRegister_Click(object sender, EventArgs e)
        {
            strErrorMessage = "";
            intVaidError = 0;
            CheckValidation();

            if (intVaidError == 0)
            {
                string path = string.Empty;
                string strImgFinalPath = "";
                string finalPath = string.Empty;
                string filePath = string.Empty;
                string sFilename = "";

                ServeAtDoorstepData.CustomerDetails objCusDetails = new ServeAtDoorstepData.CustomerDetails();
                objCusDetails.Address = txtAddress.Value.ToString();
                objCusDetails.CityId = Convert.ToInt32(ddlCity.SelectedItem.Value.ToString());
                objCusDetails.CountryId = Convert.ToInt32(ddlCountry.Value.ToString());
                objCusDetails.CustomerID = 0;
                objCusDetails.Email = txtEmail.Value.ToString();
                objCusDetails.FirstName = txtFirstname.Value.ToString();
                objCusDetails.LastName = txtLastname.Value.ToString();
                objCusDetails.Gender = Request.Form["rdoGender"].ToString();// rdoGender.Value.ToString();
                objCusDetails.LoginName = txtUsername.Value.ToString();
                objCusDetails.LoginPassword = txtPassword.Value.ToString();
                objCusDetails.Mobile = txtMobile.Value.ToString();
                objCusDetails.StateId = Convert.ToInt32(ddlState.SelectedItem.Value.ToString());
                objCusDetails.StreetName = txtStreet.Value.ToString();
                objCusDetails.ZipCode = txtZipcode.Value.ToString();
                objCusDetails.ImagePath = "";

                objService = new ServeAtDoorstepService();
                int intCusId = objService.AddCustomerRegister(objCusDetails);

                if (fileProfile.PostedFile != null)
                {
                    HttpPostedFile myFile = fileProfile.PostedFile;
                    int nFileLen = myFile.ContentLength;
                    if (nFileLen != 0)
                    {
                        DirectoryInfo dirInfo = null;
                        string fileSavePath = "/Data/SDCUS_"+intCusId.ToString()+"/Images/";
                        path = Server.MapPath("~" + fileSavePath);
                        if (!Directory.Exists(path))
                        {
                            dirInfo = Directory.CreateDirectory(path);
                        }
                        sFilename = System.IO.Path.GetFileName(myFile.FileName);
                        path = path + "/" + sFilename;
                        fileProfile.PostedFile.SaveAs(path);

                        finalPath = Path.Combine(fileSavePath, sFilename);
                    }
                }
                strImgFinalPath = finalPath;

                ServeAtDoorstepData.CustomerDetails cusDet = new ServeAtDoorstepData.CustomerDetails();
                cusDet.CustomerID = intCusId;
                cusDet.ImagePath = strImgFinalPath;
                objService.UpdateCustomerImage(cusDet);

                ServeAtDoorstepData.CusBankDetails objBankdet = new ServeAtDoorstepData.CusBankDetails();
                objBankdet.BankId = 0;
                objBankdet.CustomerId = intCusId;
                objBankdet.BankName = txtBankname.Value.ToString();
                objBankdet.CardHolderName = txtCardholdername.Value.ToString();
                objBankdet.CreditCardNumber = txtCredCardnumber.Value.ToString();
                objBankdet.CVCNumber = txtCVC.Value.ToString();

                int intCusBankId = objService.AddCustomerBankdet(objBankdet);

                SendMailtoUser(intCusId);

                lblEmailId.Text = txtEmail.Value.ToString();
                this.ModalPopupSuccess.Show();
                //Response.Redirect("Success.aspx?type=cus");
            }
            else
            {
                divErrorMessage.InnerHtml = strErrorMessage;

            }
        }
        protected void btnSavePic_Click(object sender, EventArgs e)
        {
            string path = string.Empty;
            string finalPath = string.Empty;
            string filePath = string.Empty;
            string sFilename = "";
            string strErrorMessage = "";
            int intVaidError = 0;

            if (FileUpload1.PostedFile != null)
            {
                if (FileUpload1.PostedFile.ContentLength > (50 * 1024))
                {
                    strErrorMessage += "<img src='image/warning.png' height='25px' width='25px' />&nbsp;&nbsp;Image size exceeds maximum limit 50 KB.<br />";
                    intVaidError++;
                }
            }

            if (intVaidError == 0)
            {
                if (FileUpload1.PostedFile != null)
                {
                    HttpPostedFile myFile = FileUpload1.PostedFile;
                    int nFileLen = myFile.ContentLength;
                    if (nFileLen != 0)
                    {
                        DirectoryInfo dirInfo = null;
                        string fileSavePath = "/Data/SDCUS_" + sLoginId.ToString() + "/Images/";
                        path = Server.MapPath("~" + fileSavePath);
                        if (!Directory.Exists(path))
                        {
                            dirInfo = Directory.CreateDirectory(path);
                        }
                        sFilename = System.IO.Path.GetFileName(myFile.FileName);
                        path = path + "/" + sFilename;
                        FileUpload1.PostedFile.SaveAs(path);

                        finalPath = Path.Combine(fileSavePath, sFilename);
                    }
                }

                ServeAtDoorstepData.CustomerDetails cusDet = new ServeAtDoorstepData.CustomerDetails();
                cusDet.CustomerID = Convert.ToInt32(sLoginId);
                cusDet.ImagePath = finalPath;

                objService = new ServeAtDoorstepService();
                objService.UpdateCustomerImage(cusDet);

                this.modalpopPicture.Hide();
                LoadProfile();
            }
            else
            {
                divErrorPic.InnerHtml = strErrorMessage;
                this.modalpopPicture.Show();
            }
        }