Пример #1
0
 protected void btnSignUp_Click(object sender, EventArgs e)
 {
     if (btnSignUp.Text == "Submit Changes")
     {
         USERPROFILEMASTER um = new USERPROFILEMASTER();
         um.Registration_ID      = int.Parse(ViewState["MID"].ToString());
         um.First_Name           = txtFirstname.Text.Trim();
         um.Last_Name            = txtLastName.Text.Trim();
         um.User_Name            = txtuseraname.Text.Trim();
         um.Email                = txtemail.Text.Trim();
         um.ContactNumber        = txtcontact.Text;
         um.Reference_Id         = txtReferenceId.Text.Trim();
         um.User_ID              = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).User_ID;
         um.Password             = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Password;
         um.DOB                  = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).DOB;
         um.AlternativeNumber    = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).AlternativeNumber;
         um.NomineeName          = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).NomineeName;
         um.NomineeId            = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).NomineeId;
         um.NomineeRelation      = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).NomineeRelation;
         um.RegDate              = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).RegDate;
         um.COUNTRY              = "India";
         um.Individual_Company   = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Individual_Company;
         um.IdentificationType   = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).IdentificationType;
         um.TaxExempt            = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).TaxExempt;
         um.Commission           = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Commission;
         um.WFile                = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).WFile;
         um.AnniversaryDate      = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).AnniversaryDate;
         um.SmartDeliveryDate    = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).SmartDeliveryDate;
         um.Website              = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Website;
         um.Address              = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Address;
         um.AddressLine2         = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).AddressLine2;
         um.City                 = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).City;
         um.State                = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).State;
         um.StateOther           = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).StateOther;
         um.ZipCode              = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).ZipCode;
         um.ShippingFirstName    = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).ShippingFirstName;
         um.ShippingLastName     = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).ShippingLastName;
         um.ShippingAddress      = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).ShippingAddress;
         um.ShippingAddressLine2 = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).ShippingAddressLine2;
         um.ShippingCity         = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).ShippingCity;
         um.ShippingState        = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).ShippingState;
         um.ShippingStateOther   = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).ShippingStateOther;
         um.ShippingZip          = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).ShippingZip;
         um.Fax                  = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Fax;
         um.Co_Applicant         = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Co_Applicant;
         um.Language             = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Language;
         um.Skype                = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Skype;
         um.Twitter              = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Twitter;
         um.Facebook             = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Facebook;
         um.AadharVerified       = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).AadharVerified;
         um.PanVerified          = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).PanVerified;
         um.ChequeVerified       = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).ChequeVerified;
         um.GstinVerified        = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).GstinVerified;
         um.AddressVerified      = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).AddressVerified;
         um.Image_Name           = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Image_Name;
         um.Status               = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Status;
         um.UserParentId         = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).UserParentId;
         um.Save();
         ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Change Sucessfull...!!');</script>", false);
         // Response.Redirect("Default.aspx");
     }
 }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            #region
            if (btnUpdate.Text == "Submit Changes")
            {
                USERPROFILEMASTER um = new USERPROFILEMASTER();
                um.Registration_ID    = int.Parse(Session["loginid"].ToString());
                um.First_Name         = txtFname.Text.Trim();
                um.Last_Name          = txtLName.Text.Trim();
                um.Email              = txtEmail.Text.Trim();
                um.User_Name          = lblUsername.Text.Trim();
                um.User_ID            = lblUSerId.Text;
                um.Password           = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Password;
                um.DOB                = DateTime.Parse(txtDOB.Text);
                um.ContactNumber      = txtHomePhone.Text.Trim();
                um.NomineeName        = um.NomineeName;
                um.NomineeId          = um.NomineeId;
                um.NomineeRelation    = um.NomineeRelation;
                um.Reference_Id       = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Reference_Id;
                um.RegDate            = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).RegDate;
                um.COUNTRY            = "India";
                um.Individual_Company = txtIndividual.Text;
                um.IdentificationType = lblIdentiType.Text;
                um.TaxExempt          = lblTaxExempt.Text;
                um.Commission         = lblCommHoldExempt.Text;
                um.WFile              = lblW9File.Text;
                um.AnniversaryDate    = DateTime.Parse(txtAnniversaryDate.Text);
                um.SmartDeliveryDate  = DateTime.Parse(lblSmartDeliveryDate.Text);
                um.Website            = txtwebsite.Text;
                um.Address            = txtAddress.Text;
                um.AddressLine2       = txtAddressline2.Text;
                um.State              = int.Parse(DropState.SelectedValue);
                fillcity();
                um.City = int.Parse(DropCity.SelectedValue);

                um.StateOther           = txtStateOther.Text;
                um.ZipCode              = txtZipCode.Text;
                um.ShippingFirstName    = txtShipFname.Text;
                um.ShippingLastName     = txtShipLname.Text;
                um.ShippingAddress      = txtShipAdd.Text;
                um.ShippingAddressLine2 = txtShipAdd2.Text;
                um.ShippingState        = int.Parse(dropShipstate.SelectedValue);
                fillShippingCity();
                um.ShippingCity = int.Parse(dropShipCity.SelectedValue);

                um.ShippingZip        = txtShipZipCode.Text;
                um.ShippingStateOther = txtShipStateOther.Text;
                um.AlternativeNumber  = txtAlternetContact.Text;
                um.Fax          = txtFaxNumber.Text;
                um.Co_Applicant = lblCoApplicantName.Text;
                um.Language     = dropLanguage.Text;
                um.Skype        = txtSkype.Text;
                um.Twitter      = txtTwitter.Text;
                um.Facebook     = txtFacebook.Text;
                #region AadharVerified
                um.AadharVerified = txtadhar.Text;
                string exten1 = System.IO.Path.GetExtension(fileAdhar.FileName);
                if (fileAdhar.HasFile == true)
                {
                    fileAdhar.SaveAs(Server.MapPath("~/images/UsreVerifiedImages/" + um.User_Name + "AadharVerified" + exten1));
                    um.AadharImage = um.User_Name + "AadharVerified" + exten1;
                }
                else
                {
                    um.AadharImage = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).AadharImage;
                }
                #endregion
                #region PanVerified
                um.PanVerified = txtPancard.Text;
                string exten2 = System.IO.Path.GetExtension(filePan.FileName);
                if (filePan.HasFile == true)
                {
                    filePan.SaveAs(Server.MapPath("~/images/UsreVerifiedImages/" + um.User_Name + "PanVerified" + exten2));
                    um.PanImage = um.User_Name + "PanVerified" + exten2;
                }
                else
                {
                    um.PanImage = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).PanImage;
                }
                #endregion
                #region ChequeVerified
                um.ChequeVerified = txtCheque.Text;
                string exten3 = System.IO.Path.GetExtension(fileCheque.FileName);
                if (fileCheque.HasFile == true)
                {
                    fileCheque.SaveAs(Server.MapPath("~/images/UsreVerifiedImages/" + um.User_Name + "ChequeVerified" + exten3));
                    um.ChequeImage = um.User_Name + "ChequeVerified" + exten3;
                }
                else
                {
                    um.ChequeImage = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).ChequeImage;
                }
                #endregion
                um.GstinVerified = txtgst.Text;
                #region AddressVerified
                um.AddressVerified = txtaddProof.Text;
                string exten4 = System.IO.Path.GetExtension(fileAdd.FileName);
                if (fileAdd.HasFile == true)
                {
                    fileAdd.SaveAs(Server.MapPath("~/images/UsreVerifiedImages/" + um.User_Name + "AddressVerified" + exten4));
                    um.AddressImage = um.User_Name + "AddressVerified" + exten4;
                }
                else
                {
                    um.AddressImage = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).AddressImage;
                }
                #endregion
                #region ProfileImage
                string exten = System.IO.Path.GetExtension(fileImage.FileName);
                if (fileImage.HasFile == true)
                {
                    fileImage.SaveAs(Server.MapPath("~/images/ProfileImages/" + um.User_Name + exten));
                    um.Image_Name = um.User_Name + exten;
                }
                else
                {
                    um.Image_Name = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).Image_Name;
                }
                #endregion
                um.Status       = lblStatus.Text;
                um.BankName     = txtBankName.Text.Trim();
                um.AccountNo    = txtaccount.Text.Trim();
                um.IFSCCode     = txtifsc.Text.Trim();
                um.Branch       = txtbranch.Text.Trim();
                um.UserParentId = USERPROFILEMASTER.GetByRegistration_ID(um.Registration_ID).UserParentId;
                um.Save();
                SaveNewUserAssociation();
                ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Save Sucessfull...!!');</script>", false);
                Response.Redirect("AdminProfileShow.aspx");
            }
            #endregion
        }