예제 #1
0
        public void TissueBank_Add(string TissueBankName, string ContactPersonFirstName, string ContactPersonLastName, string ContactPersonNumber, string ContactPersonEmailId, string FaxNumber, string TissueBankEmailId, string BusinessURL, string TissueBankAddress, int CityId, string ZipCode, string TissueBankStateLicense, string AATBLicenseNumber, DateTime AATBExpirationDate, DateTime AATBAccredationDate, string CreditCardNumber, int CreditCardType, string ExpiryDate, string CardCode, string CustomerProfileId, string CustomerPaymentProfileIds, string BillingAddress, int BillingCityId, string BillingZipCode, string BillingFaxNumber, string BillingEmailId, string BillingContactNumber, string BillingCity, string BillingState, string State, string City, int UserId, int TissueBankId, int TransactionId, string AuthTransactionId, string AuthCode, int StatusId, DateTime TransactionCompleteDate, string ResponseBody, out TransactionalInformation transaction)
        {
            transaction = new TransactionalInformation();
            TissueBankBusinessRule tbBusinessRule = new TissueBankBusinessRule(tbDataService);

            try
            {
                tbDataService.TissueBank_Add(TissueBankName, ContactPersonFirstName, ContactPersonLastName, ContactPersonNumber, ContactPersonEmailId, FaxNumber, TissueBankEmailId, BusinessURL, TissueBankAddress, CityId, ZipCode, TissueBankStateLicense, AATBLicenseNumber, AATBExpirationDate, AATBAccredationDate, CreditCardNumber, CustomerProfileId, CustomerPaymentProfileIds, BillingAddress, BillingCityId, BillingZipCode, BillingFaxNumber, BillingEmailId, BillingContactNumber, UserId, TissueBankId, TransactionId, AuthTransactionId, AuthCode, StatusId, TransactionCompleteDate, ResponseBody, out transaction);

                if (transaction.ReturnStatus == true)
                {
                    SMTPEmail email = new SMTPEmail();
                    MailBody  mb    = new MailBody();
                    mb.ContactPersonName    = ContactPersonFirstName + " " + ContactPersonFirstName;
                    mb.ContactPersonEmailId = ContactPersonEmailId;
                    mb.MailType             = "TissueBank_Add";
                    email.sendMail(mb);
                }
            }
            catch (Exception ex)
            {
                transaction.ReturnMessage = new List <string>();
                string errorMessage = ex.Message;
                transaction.ReturnStatus = false;
                transaction.ReturnMessage.Add(errorMessage);
            }
            finally
            {
                tbDataService.CloseSession();
            }
        }
예제 #2
0
        public void TissueBank_User_Registration(string FullName, string UserName, string EmailId, string SecurityQuestion, string SecurityAnswer, out TransactionalInformation transaction)
        {
            transaction = new TransactionalInformation();
            TissueBankBusinessRule tbBusinessRule = new TissueBankBusinessRule(tbDataService);

            try
            {
                tbDataService.CreateSession();

                tbBusinessRule.ValidateTissueBankUserRegistration(FullName, UserName, EmailId, SecurityQuestion, SecurityAnswer);

                if (tbBusinessRule.ValidationStatus == true)
                {
                    string Password = Utilities.RandomAlphaNumeric(6);
                    int    UserId   = tbDataService.TissueBank_User_Registration(FullName, UserName, EmailId, SecurityQuestion, SecurityAnswer, Password, out transaction);

                    if (transaction.ReturnStatus == true)
                    {
                        SMTPEmail email = new SMTPEmail();
                        MailBody  mb    = new MailBody();
                        mb.Password             = Password;
                        mb.ContactPersonEmailId = EmailId;
                        mb.ContactPersonName    = FullName;
                        mb.UserId   = UserId;
                        mb.MailType = "VerifyUserRegistration";

                        email.sendMail(mb);
                    }
                }
                else
                {
                    transaction.ReturnStatus     = tbBusinessRule.ValidationStatus;
                    transaction.ReturnMessage    = tbBusinessRule.ValidationMessage;
                    transaction.ValidationErrors = tbBusinessRule.ValidationErrors;
                }
            }
            catch (Exception ex)
            {
                transaction.ReturnMessage = new List <string>();
                string errorMessage = ex.Message;
                transaction.ReturnStatus = false;
                transaction.ReturnMessage.Add(errorMessage);
            }
            finally
            {
                tbDataService.CloseSession();
            }
        }
예제 #3
0
        public void User_CreateUpdateDelete(int UserId, string UserName, string Password, string FullName, string MobileNumber, string EmailId, int CreatedBy, int LastModifiedBy, int InfoId, string OperationType, bool AllowLogin, DataTable TempUser_CUD, bool IsSendMail, string PasswordQuestion, string PasswordAnswer, string SecurityQuestion, string SecurityAnswer, out TransactionalInformation transaction)
        {
            transaction = new TransactionalInformation();
            UserBusinessRule userBusinessRule = new UserBusinessRule(userDataService);

            try
            {
                userDataService.CreateSession();

                userBusinessRule.ValidateUser_CUD(UserId, UserName, Password, FullName, MobileNumber, EmailId, CreatedBy, LastModifiedBy, InfoId, OperationType, AllowLogin, TempUser_CUD, IsSendMail, PasswordQuestion, PasswordAnswer, SecurityQuestion, SecurityAnswer);

                if (userBusinessRule.ValidationStatus == true)
                {
                    //  TempUser_CUD.Columns.Remove("Disable");

                    if (OperationType == "changePass" || OperationType == "UserUpdate")
                    {
                        if (TempUser_CUD == null)
                        {
                            DataTable dt = new DataTable();
                            dt.Columns.Add("RoleID", typeof(int));
                            dt.Columns.Add("UserID", typeof(int));
                            dt.Rows.Add(0, 0);
                            TempUser_CUD = dt;
                        }
                    }
                    else
                    {
                        TempUser_CUD.Columns.Remove("RoleName");
                        TempUser_CUD.Columns.Add("UserId", typeof(int));

                        if (OperationType == "insert")
                        {
                            Password = Utility.Utilities.RandomAlphaNumeric(6);
                            //BHASKAR SIR

                            for (int i = 0; i < TempUser_CUD.Rows.Count; ++i)
                            {
                                TempUser_CUD.Rows[i]["UserId"] = 0;
                            }
                        }
                        else
                        {
                            for (int i = 0; i < TempUser_CUD.Rows.Count; ++i)
                            {
                                TempUser_CUD.Rows[i]["UserId"] = UserId;
                            }
                        }
                    }
                    int EffectedUserId = userDataService.User_CreateUpdateDelete(UserId, UserName, Password, FullName, MobileNumber, EmailId, CreatedBy, LastModifiedBy, InfoId, OperationType, AllowLogin, TempUser_CUD, PasswordQuestion, PasswordAnswer, SecurityQuestion, SecurityAnswer, out transaction);

                    //send mail
                    if (OperationType == "changePass")
                    {
                        SMTPEmail email = new SMTPEmail();
                        MailBody  mb    = new MailBody();

                        if (IsSendMail == true)
                        {
                            TransactionalInformation tempTransction = new TransactionalInformation();
                            User user = userDataService.GetUserById(EffectedUserId, out tempTransction);
                            mb.Password             = Password;
                            mb.ContactPersonEmailId = user.EmailId;
                            mb.ContactPersonName    = user.FullName;
                            mb.UserId   = EffectedUserId;
                            mb.MailType = "changePass";

                            email.sendMail(mb);
                        }
                    }
                    else if (OperationType == "insert")
                    {
                        SMTPEmail email = new SMTPEmail();
                        MailBody  mb    = new MailBody();

                        mb.Password             = Password;
                        mb.ContactPersonEmailId = EmailId;
                        mb.ContactPersonName    = FullName;
                        mb.UserId   = EffectedUserId;
                        mb.MailType = "VerifyUserRegistration";

                        email.sendMail(mb);
                    }
                }
                else
                {
                    transaction.ReturnStatus     = userBusinessRule.ValidationStatus;
                    transaction.ReturnMessage    = userBusinessRule.ValidationMessage;
                    transaction.ValidationErrors = userBusinessRule.ValidationErrors;
                }
            }
            catch (Exception ex)
            {
                transaction.ReturnMessage = new List <string>();
                string errorMessage = ex.Message;
                transaction.ReturnStatus = false;
                transaction.ReturnMessage.Add(errorMessage);
            }
            finally
            {
                userDataService.CloseSession();
            }
        }