Exemplo n.º 1
0
 private void savedcode()
 {
     try
     {
         if (valid())
         {
             if (hd.Value == "false")
             {
                 if (hde.Value == "false")
                 {
                     //UserRol r = new UserRol();
                     //r.user_name = txtUserEmail.Text;
                     //r.first_name = txtFirstName.Text;
                     //r.last_name = txtLastname.Text;
                     //r.user_mobieno = txtContactNo.Text;
                     //r.user_Emai = txtUserEmail.Text;
                     //string enPswd = GetSwcSHA1(txtPassword.Text);
                     //r.password = enPswd;
                     //r.role_id = Convert.ToInt32(ddlRole.SelectedValue);
                     //r.branch_id = Convert.ToInt32(ddlBranch.SelectedValue);
                     //r.status = true;
                     ////r.created_by = "admin";
                     //r.created_by = User_id;
                     //r.created_date = DateTime.Now;
                     //r.company_id = companyId;
                     ////Shakeeb
                     ////r.Insert(r);
                     context.sp_AddUser2(txtUserEmail.Text, txtUserEmail.Text, txtContactNo.Text,
                                         EncryptionHelper.GetSwcSHA1(txtPassword.Text), Convert.ToInt32(ddlRole.SelectedValue)
                                         , branchId, companyId, true, User_id, DateTime.Now, txtFirstName.Text, txtLastname.Text);
                     gridbind();
                     divalert.Visible   = true;
                     lblAlert.ForeColor = System.Drawing.Color.Green;
                     lblAlert.Text      = "User Saved Successfully ";
                     clr();
                 }
                 else
                 {
                     lblcheck.ForeColor = System.Drawing.Color.Red;
                     lblcheck.Text      = "Mobile No is already exists";
                 }
             }
             else
             {
                 lblcheckDoubleError.ForeColor = System.Drawing.Color.Red;
                 lblcheckDoubleError.Text      = "Email-ID already exists";
             }
         }
     }
     catch (Exception ex)
     {
         ErrorLog.saveerror(ex);
     }
 }
Exemplo n.º 2
0
 private void savedcode()
 {
     try
     {
         if (valid())
         {
             if (hd.Value == "false")
             {
                 if (hde.Value == "false")
                 {
                     context.sp_AddUser2(txtUserEmail.Text, txtUserEmail.Text, txtContactNo.Text,
                                         GetSwcSHA1(txtPassword.Text), Convert.ToInt32(ddlRole.SelectedValue)
                                         , branchId, companyId, true, User_id, DateTime.Now, txtFirstName.Text, txtLastname.Text);
                     gridbind();
                     divalert.Visible   = true;
                     lblAlert.ForeColor = System.Drawing.Color.Green;
                     lblAlert.Text      = "User Saved Successfully ";
                     clr();
                 }
                 else
                 {
                     lblcheck.ForeColor = System.Drawing.Color.Red;
                     lblcheck.Text      = "Mobile No is already exists";
                 }
             }
             else
             {
                 lblcheckDoubleError.ForeColor = System.Drawing.Color.Red;
                 lblcheckDoubleError.Text      = "Email-ID already exists";
             }
         }
     }
     catch (Exception ex)
     {
         ErrorLog.saveerror(ex);
     }
 }