Пример #1
0
 public string SaveUser(SaveUserClass user)
 {
     try
     {
         string constr = ConfigurationManager.ConnectionStrings["DB"].ConnectionString;
         using (SqlConnection conn = new SqlConnection(constr))
         {
             USERPROFILEMASTER rm = new USERPROFILEMASTER();
             rm.Registration_ID = USERPROFILEMASTER.MaxId() + 1;
             rm.First_Name      = user.Fname;
             rm.Last_Name       = user.Lname;
             rm.Email           = user.Email;
             rm.User_Name       = user.UserName;
             rm.User_ID         = "OM000000" + rm.Registration_ID;
             rm.Password        = user.Password;
             rm.DOB             = DateTime.Today;
             rm.ContactNumber   = user.ContactNo;
             rm.NomineeName     = "";
             rm.NomineeId       = "";
             rm.NomineeRelation = "";
             USERPROFILEMASTER um1 = USERPROFILEMASTER.GetByUser_Name(user.RefId);
             if (string.IsNullOrWhiteSpace(um1.Reference_Id))
             {
                 return("Reference Id is not available");
             }
             rm.Reference_Id         = user.RefId;
             rm.RegDate              = DateTime.Today.Date;
             rm.COUNTRY              = "India";
             rm.Individual_Company   = ""; rm.IdentificationType = ""; rm.TaxExempt = ""; rm.Commission = ""; rm.WFile = "";
             rm.AnniversaryDate      = DateTime.Today; rm.SmartDeliveryDate = DateTime.Today;
             rm.Website              = ""; rm.Address = ""; rm.AddressLine2 = ""; rm.City = 1; rm.State = 1; rm.StateOther = "";
             rm.ZipCode              = ""; rm.ShippingFirstName = ""; rm.ShippingLastName = ""; rm.ShippingAddress = "";
             rm.ShippingAddressLine2 = ""; rm.ShippingCity = 1; rm.ShippingState = 1; rm.ShippingZip = ""; rm.ShippingStateOther = "";
             rm.AlternativeNumber    = ""; rm.Fax = ""; rm.Co_Applicant = ""; rm.Language = ""; rm.Skype = ""; rm.Twitter = ""; rm.Facebook = ""; rm.AadharVerified = "";
             rm.AadharImage          = ""; rm.PanVerified = ""; rm.PanImage = ""; rm.ChequeVerified = ""; rm.ChequeImage = ""; rm.GstinVerified = "";
             rm.AddressVerified      = ""; rm.AddressImage = ""; rm.Image_Name = ""; rm.Status = "Active"; rm.BankName = ""; rm.AccountNo = "";
             rm.IFSCCode             = ""; rm.Branch = ""; rm.UserParentId = 0;
             rm.Save();
             // Sendmsg("Welcome to OMHRD " + " ", user.ContactNo.Trim());
         }
         return(string.Empty);
     }
     catch (Exception ex)
     {
         return("Username is not available");
     }
 }
Пример #2
0
 protected void linksignup_Click(object sender, EventArgs e)
 {
     try
     {
         List <USERPROFILEMASTER> um = USERPROFILEMASTERCollection.GetByUser_Name(txtReferenceId.Text);
         if (um.Count == 0)
         {
             ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<Script>alert('Reference Name Not Valid.');</Script>", false);
             //Response.Redirect("");
             return;
         }
         USERPROFILEMASTER rm = new USERPROFILEMASTER();
         if (linksignup.Text == "Submit")
         {
             rm.Registration_ID      = USERPROFILEMASTER.MaxId() + 1;
             rm.First_Name           = txtFirstname.Text.Trim();
             rm.Last_Name            = txtLastName.Text.Trim();
             rm.Email                = txtemail.Text.Trim();
             rm.User_Name            = txtuserName.Text.Trim();
             rm.User_ID              = "OM000000" + rm.Registration_ID;
             rm.Password             = txtpassword.Text.Trim();
             rm.DOB                  = DateTime.Today;
             rm.ContactNumber        = txtcontact.Text.Trim();
             rm.NomineeName          = "";
             rm.NomineeId            = "";
             rm.NomineeRelation      = "";
             rm.Reference_Id         = txtReferenceId.Text.Trim();
             rm.RegDate              = DateTime.Today.Date;
             rm.COUNTRY              = "India";
             rm.Individual_Company   = ""; rm.IdentificationType = ""; rm.TaxExempt = ""; rm.Commission = ""; rm.WFile = "";
             rm.AnniversaryDate      = DateTime.Today; rm.SmartDeliveryDate = DateTime.Today;
             rm.Website              = ""; rm.Address = ""; rm.AddressLine2 = ""; rm.City = 1; rm.State = 1; rm.StateOther = "";
             rm.ZipCode              = ""; rm.ShippingFirstName = ""; rm.ShippingLastName = ""; rm.ShippingAddress = "";
             rm.ShippingAddressLine2 = ""; rm.ShippingCity = 1; rm.ShippingState = 1; rm.ShippingZip = ""; rm.ShippingStateOther = "";
             rm.AlternativeNumber    = ""; rm.Fax = ""; rm.Co_Applicant = ""; rm.Language = ""; rm.Skype = ""; rm.Twitter = ""; rm.Facebook = ""; rm.AadharVerified = "";
             rm.AadharImage          = ""; rm.PanVerified = ""; rm.PanImage = ""; rm.ChequeVerified = ""; rm.ChequeImage = ""; rm.GstinVerified = "";
             rm.AddressVerified      = ""; rm.AddressImage = ""; rm.Image_Name = ""; rm.Status = "Active"; rm.BankName = ""; rm.AccountNo = "";
             rm.IFSCCode             = ""; rm.Branch = ""; rm.UserParentId = 0;
             rm.Save();
             ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<Script>alert('Sign Up Successfully...');</Script>", false);
         }
         ClearControls(this);
     }
     catch (Exception ex)
     {
     }
 }