public string SendInvitationRequest(string FirstName, string LastName, string SchoolEmail, string Gender)
 {
     string ResultsStatus = string.Empty;
      //string[] EmailVarify = SchoolEmail.Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
      string[] EmailVarify = SchoolEmail.Split(new char[] { '@' }, StringSplitOptions.RemoveEmptyEntries);
      //if (EmailVarify.Contains("edu"))
      if (EmailVarify.Contains(ConfigurationService.ConfigurationService.GetDomainForEmail()))
      {
          SendInvitationRequest objSendInvitationRequest = new SendInvitationRequest(FirstName, LastName, SchoolEmail, Gender, 0, true);
          ResultsStatus = objSendInvitationRequest.FinialResults;
          if (!string.IsNullOrEmpty(ResultsStatus) && ResultsStatus != "Error")
          {
              // send invitation request email to user.
              SendEmail objSendEmail = new SendEmail();
              Boolean btnIsMailSent = objSendEmail.SendRegistrationApprovalMail(SchoolEmail,ResultsStatus);
              InvitationRequestDAL objInvitationRequestDAL = new InvitationRequestDAL();
              objInvitationRequestDAL.UpdateEmailSent(ResultsStatus, btnIsMailSent);
          }
          return ResultsStatus;
      }
      else
      {
          SendInvitationRequest objSendInvitationRequest = new SendInvitationRequest(FirstName, LastName, SchoolEmail, Gender, 0, false);
          ResultsStatus = objSendInvitationRequest.FinialResults;
          return ResultsStatus;
      }
 }
예제 #2
0
        public String getPassword(String userId, String mailId)
        {
            string result = "false";
            string dpwd = "";
            AccountsDAL objLogin = new AccountsDAL();
            string pwd = "";
            string username = "";
            string mailid = "";
            DataSet objDS = new DataSet();
            objDS = objLogin.getPassword(userId, mailId);
            if (objDS.Tables.Count > 0)
            {
                if (objDS.Tables[0].Rows.Count > 0)
                {
                    pwd = objDS.Tables[0].Rows[0]["Password"].ToString();
                    username = objDS.Tables[0].Rows[0]["UserName"].ToString();
                    mailid = objDS.Tables[0].Rows[0]["PrimaryEmail"].ToString();
                    //decryption
                    dpwd = Cryptography.Cryptography.Decrypt(pwd);
                    SendEmail objSendEmail = new SendEmail();
                    Boolean btnIsMailSent = objSendEmail.sendRecoveredPasswordMail(username, mailid, dpwd);
                    if (btnIsMailSent == true)
                    {
                        result = "1";
                    }
                    else
                    {
                        result = "2";
                    }
                }
                else
                {
                    result = "0";
                }
            }
            else
            {
                return "0";
            }

            return result;
        }