Exemplo n.º 1
0
        // public  bool ChangePasswordSetIsNewAfterLogin(LoginInfo login)
        // {
        //     IManagerCredential crd = new ManagerCredential();
        //     ILayoutManager layoutManager = new LayoutManager();
        //     IManagerRole roleManager = new ManagerRole();

        //     if (string.IsNullOrEmpty(login.TenantCode) || string.IsNullOrEmpty(login.UserName))
        //     return false;
        //     //Get tenant id with code
        //     Guid tenantId = layoutManager.GetTenantId(InfoType.Tenant, login.TenantCode);
        //     if (tenantId == Guid.Empty)
        //     return false;
        //     //Validate UserName
        //     var userId = crd.GetUserName(tenantId, login.UserName);
        //     if (userId == Guid.Empty)
        //     return false;
        //     var userDetails = roleManager.GetUserDetails(tenantId, userId);
        //     if (userDetails.Id == Guid.Empty)
        //     return fase;
        //     var credentialData=crd.GetCredential(tenantId,userDetails.Id);
        //   return  crd.SetIsNew(tenantId, new CredentialInfo
        //     {
        //     CredentialId = credentialData.CredentialId,
        //     // ParentId=new Guid("E6C7AA71-3C94-46BF-A392-260A14667F95"),
        //     ParentId = userDetails.Id,
        //     UserName = "",
        //     PasswordHash = "",
        //     PasswordSalt = "",
        //     IsNew = true
        //     });
        // }

        //  private void SendMail(string parampass,Email emailTemplate,JObject data,Guid tenantId, Guid userId)
        //  {
        //      IMetadataManager _iMetadataManager = new VPC.Framework.Business.MetadataManager.Contracts.MetadataManager ();
        //     var emailSubType = _iMetadataManager.GetSubTypes ("email");
        //      IEntityResourceManager _iEntityResourceManager = new VPC.Framework.Business.EntityResourceManager.Contracts.EntityResourceManager ();
        //     dynamic jsonObject = new JObject ();
        //     jsonObject.Body = emailTemplate.Body.Value;
        //     jsonObject.Sender = "";
        //     jsonObject.Recipient = data["ContactInformation_Email"];
        //     jsonObject.Date = HelperUtility.GetCurrentUTCDate();
        //     jsonObject.Subject = emailTemplate.Subject;
        //      var superAdminId = _iEntityResourceManager.SaveResult (tenantId, userId, "email", jsonObject, emailSubType[0].Name.ToString ());

        public User UserInfo(ChangePasswordInfo changepassword)
        {
            IManagerCredential crd           = new ManagerCredential();
            ILayoutManager     layoutManager = new LayoutManager();
            IManagerRole       roleManager   = new ManagerRole();
            Guid tenantId    = layoutManager.GetTenantId(InfoType.Tenant, changepassword.TenantCode);
            var  userId      = crd.GetUserName(tenantId, changepassword.UserName);
            var  queryFilter = new List <QueryFilter>();

            queryFilter.Add(new QueryFilter {
                FieldName = "TenantId", Operator = "Equal", Value = tenantId.ToString()
            });
            queryFilter.Add(new QueryFilter {
                FieldName = "InternalId", Operator = "Equal", Value = userId.ToString()
            });
            var queryContext = new QueryContext {
                Fields = "FirstName,LastName", Filters = queryFilter, PageSize = 100, PageIndex = 1, MaxResult = 1
            };
            IEntityResourceManager _iEntityResourceManager = new VPC.Framework.Business.EntityResourceManager.Contracts.EntityResourceManager();
            User      userinfo = null;
            DataTable user     = _iEntityResourceManager.GetResult(tenantId, "User", queryContext);

            if (user.Rows.Count > 0)
            {
                userinfo = EntityMapper <User> .Mapper(user);
            }
            return(userinfo);
        }
        void IOperationFlowEngine.FirstOperation(Guid tenantId, WorkFlowProcessProperties properties)
        {
            var entityId = iMetadataManager.GetEntityContextByEntityName(properties.EntityName);
            var workFlow = _managerWorkFlow.GetWorkFlow(tenantId, entityId, properties.SubTypeCode);

            if (workFlow != null)
            {
                var steps = _managerWorkFlowStep.GetWorkFlowSteps(tenantId, workFlow.WorkFlowId).ToList();
                if (steps.Count > 0)
                {
                    transactionHistory.CreateTransitionHistory(tenantId, new WorkFlowTransition
                    {
                        TransitionHistoryId = Guid.NewGuid(),
                        RefId          = properties.resultId,
                        EntityId       = entityId,
                        WorkFlowStepId = steps[0].WorkFlowStepId,
                        StartTime      = DateTime.UtcNow,
                        EndTime        = DateTime.UtcNow,
                        AssignedUserId = Guid.Empty,
                        AuditInfo      = new Entities.Common.AuditDetail {
                            CreatedBy = properties.UserId
                        }
                    });

                    dynamic jsonObject = new JObject();
                    jsonObject.CurrentWorkFlowStep = steps[0].TransitionType.Id;

                    IEntityResourceManager _iEntityResourceManager = new VPC.Framework.Business.EntityResourceManager.Contracts.EntityResourceManager();
                    _iEntityResourceManager.UpdateSpecificField(tenantId, properties.EntityName, properties.resultId, "CurrentWorkFlowStep", steps[0].TransitionType.Id.ToString());
                    // var resultId = _iEntityResourceManager.UpdateResult (tenantId, properties.UserId,properties.resultId,properties.EntityName, jsonObject, properties.SubTypeCode);
                }
            }
        }
Exemplo n.º 3
0
        public static Guid SaveEmail(Guid tenantId, Guid userId, EmailTemplate template, string emailRecipient, string name, string referenceEntity)
        {
            IManagerScheduler _schedulerManager = new ManagerScheduler();

            if (template.Body != null && !string.IsNullOrEmpty(template.Body.Value))
            {
                ISettingManager        _iSettingManager        = new SettingManager();
                IEntityResourceManager _iEntityResourceManager = new VPC.Framework.Business.EntityResourceManager.Contracts.EntityResourceManager();
                IMetadataManager       _iMetadataManager       = new VPC.Framework.Business.MetadataManager.Contracts.MetadataManager();
                IManagerBatchItem      _managerBatchItem       = new ManagerBatchItem();
                IManagerBatchType      _managerBatchType       = new ManagerBatchType();
                var emailSubType = _iMetadataManager.GetSubTypes("email");
                var sendername   = _iSettingManager.GetSenderNameByContext(tenantId, SettingContextTypeEnum.EMAIL);

                dynamic jsonObject = new JObject();
                jsonObject.Body      = template.Body.Value.Replace("'", "''");
                jsonObject.Sender    = sendername;
                jsonObject.Recipient = emailRecipient;
                jsonObject.Date      = HelperUtility.GetCurrentUTCDate();
                jsonObject.Subject   = template.Title.Value;
                var batchType = _managerBatchType.GetBatchTypeByContext(tenantId, BatchTypeContextEnum.Email);
                if (batchType != null)
                {
                    var myObj = new JObject();
                    myObj.Add("email", jsonObject);
                    //Save Email
                    var returnId = _iEntityResourceManager.SaveResult(tenantId, userId, "email", myObj, emailSubType[0].Name.ToString());
                    //Save Batch item
                    var batchItemId = Guid.NewGuid();
                    _managerBatchItem.BatchItemCreate(tenantId, (!string.IsNullOrEmpty(batchType.ItemTimeout.Value) ? Convert.ToInt32(batchType.ItemTimeout.Value) : (int?)null)
                                                      , new BatchItem
                    {
                        BatchItemId = batchItemId,
                        BatchTypeId = Guid.Parse(batchType.InternalId.Value),
                        Name        = string.Format("{0}-{1}{2}{3}", name, DateTime.UtcNow.Year, DateTime.UtcNow.Month, DateTime.UtcNow.Day),
                        Priority    = (!string.IsNullOrEmpty(batchType.Priority.Value) ? Convert.ToInt32(batchType.Priority.Value) : (int?)null),
                        RetryCount  = 0,
                        EntityId    = referenceEntity,
                        ReferenceId = returnId,
                        Status      = EmailEnum.ReadyToSend,
                        NextRunTime = Convert.ToInt32(batchType.Type.Value) == (int)BatchTypeEnum.Scheduled ? _schedulerManager.GetNextRunDateTime(tenantId, new Guid(batchType.Scheduler.InternalId.Value)) : DateTime.MinValue,
                        // NextRunTime=   CalCulateNextRunTime(tenantId,new Guid("57AAB7B8-326E-431B-890A-56D099CB429F")),
                        AuditDetails = new AuditDetail
                        {
                            CreatedBy = userId
                        }
                    });
                    return(batchItemId);
                }
            }
            return(Guid.Empty);
        }
Exemplo n.º 4
0
        private WorkFlowResultMessage <WorkFlowTransition> Transition(Guid tenantId, TransitionWapper operationWapper)
        {
            var resM = new WorkFlowResultMessage <WorkFlowTransition>();

            //-------Update  last active step endtime
            var transactionHistories = _managerTrasition.GetTransitionHistoryByRefId(tenantId, operationWapper.RefId);

            if (transactionHistories.Count > 0)
            {
                var currentTrasitionTypes = (from transactionHistorie in transactionHistories where transactionHistorie.TransitionType.Id == operationWapper.CurrentTransitionType
                                             select transactionHistorie).OrderByDescending(p => p.StartTime).ToList();
                if (currentTrasitionTypes.Count > 0)
                {
                    var transitionLast = new WorkFlowTransition {
                        TransitionHistoryId = currentTrasitionTypes[0].TransitionHistoryId, EndTime = DateTime.UtcNow
                    };
                    _managerTrasition.UpdateTransitionHistory(tenantId, transitionLast);
                }

                dynamic jsonObject = new JObject();
                jsonObject.CurrentWorkFlowStep = operationWapper.NextTransitionType;

                var myObj = new JObject();
                myObj.Add(operationWapper.EntityName, jsonObject);

                IEntityResourceManager _iEntityResourceManager = new VPC.Framework.Business.EntityResourceManager.Contracts.EntityResourceManager();
                var resultId = _iEntityResourceManager.UpdateResultWithoutWorkFlow(tenantId, operationWapper.UserId, operationWapper.RefId,
                                                                                   operationWapper.EntityName, myObj, operationWapper.SubTypeName);

                //----- Insert into history table
                var entityId    = iMetadataManager.GetEntityContextByEntityName(operationWapper.EntityName);
                var subTypeCode = iMetadataManager.GetSubTypeId(operationWapper.EntityName, operationWapper.SubTypeName);
                var workFlow    = _reviewWorkFlow.GetWorkFlow(tenantId, entityId, subTypeCode);
                if (workFlow == null)
                {
                    throw new CustomWorkflowException <WorkFlowMessage>(WorkFlowMessage.NoOperationActivity);
                }
                var itsCurrentStep = _managerWorkFlowStep.GetWorkFlowSteps(tenantId, workFlow.WorkFlowId).FirstOrDefault(x => x.TransitionType.Id == operationWapper.NextTransitionType);
                var transitionNew  = new WorkFlowTransition();
                transitionNew.TransitionHistoryId = Guid.NewGuid();
                transitionNew.StartTime           = DateTime.UtcNow;
                transitionNew.WorkFlowStepId      = itsCurrentStep.WorkFlowStepId;
                transitionNew.EntityId            = entityId;
                transitionNew.RefId = operationWapper.RefId;
                _managerTrasition.CreateTransitionHistory(tenantId, transitionNew);
                resM.Result = transitionNew;
            }


            return(resM);
        }
Exemplo n.º 5
0
        public dynamic getPasswordPolicy(Guid tenantId, bool ConvertToEntity)
        {
            var queryFilter = new List <QueryFilter>();

            queryFilter.Add(new QueryFilter {
                FieldName = "TenantId", Operator = "Equal", Value = tenantId.ToString()
            });
            var queryContext = new QueryContext {
                Fields = "LockoutAttempt,LockoutDuration,PreviousPasswordDifference,ResetOnFirstLogin,IsUppercase,IsLowercase,IsNumber,IsNonAlphaNumeric,CanUserChangeOwnPassword,AllowFirstLastName,PasswordLength,PasswordAge,AllowRecoveryViaMail", Filters = queryFilter, PageSize = 100, PageIndex = 1, MaxResult = 1
            };
            IEntityResourceManager _iEntityResourceManager = new VPC.Framework.Business.EntityResourceManager.Contracts.EntityResourceManager();
            DataTable data1 = _iEntityResourceManager.GetResult(tenantId, "passwordpolicy", queryContext);

            if (data1.Rows.Count == 0)
            {
                return(null);
            }
            // if (data1.Rows[0]["AllowRecoveryViaMail"] == System.DBNull.Value)
            // {
            //     data1.Rows[0]["AllowRecoveryViaMail"] = true;
            // }
            // data1.Rows[0]["AllowRecoveryViaMail"] = ConvertToTrue(data1.Rows[0]["AllowRecoveryViaMail"]);
            // data1.Rows[0]["isLowercase"] = ConvertToTrue(data1.Rows[0]["isLowercase"]);
            // data1.Rows[0]["isUppercase"] = ConvertToTrue(data1.Rows[0]["isUppercase"]);
            // data1.Rows[0]["allowFirstLastName"] = ConvertToTrue(data1.Rows[0]["allowFirstLastName"]);
            // data1.Rows[0]["isNumber"] = ConvertToTrue(data1.Rows[0]["isNumber"]);
            // data1.Rows[0]["isNonAlphaNumeric"] = ConvertToTrue(data1.Rows[0]["isNonAlphaNumeric"]);
            // if (data1.Rows[0]["PreviousPasswordDifference"] == System.DBNull.Value)
            // {
            //     data1.Rows[0]["PreviousPasswordDifference"] = false;
            // }
            // else
            // {
            //     data1.Rows[0]["PreviousPasswordDifference"] = (bool)data1.Rows[0]["PreviousPasswordDifference"];
            // }
            dynamic passwordpolicy = null;

            if (ConvertToEntity)
            {
                passwordpolicy = EntityMapper <PasswordPolicy> .Mapper(data1);
            }
            else
            {
                passwordpolicy = data1;
            }
            return(passwordpolicy);
        }
Exemplo n.º 6
0
        WorkFlowProcessMessage IOperation.Execute(dynamic obj)
        {
            IMetadataManager       iMetadataManager        = new MetadataManager.Contracts.MetadataManager();
            IEntityQueryManager    _queryManager           = new EntityQueryManager();
            IEntityResourceManager _iEntityResourceManager = new VPC.Framework.Business.EntityResourceManager.Contracts.EntityResourceManager();
            var objWorkFlowProcessMessage = new WorkFlowProcessMessage();

            try
            {
                objWorkFlowProcessMessage = new WorkFlowProcessMessage {
                    Success = true
                };
                var workFlowProcessProperties = (WorkFlowProcessProperties)obj[0];
                var jObject  = (JObject)obj[1];
                var tenantId = (Guid)obj[2];

                var userObj     = jObject.Children().FirstOrDefault(t => t.Path.ToLower().Equals("user"));
                var userJObject = userObj.First().ToObject <JObject> ();

                var userInfo = EntityMapper <VPC.Entities.EntityCore.Metadata.User> .MapperJObject(userJObject);

                var tenantCode = _queryManager.GetSpecificIdByQuery(tenantId, workFlowProcessProperties.EntityName, workFlowProcessProperties.resultId, "Code");
                userJObject.Add(new JProperty("TenantCode", tenantCode));
                var template  = _iEntityResourceManager.GetWellKnownTemplate(tenantId, "Emailtemplate", "Tenant", (int)ContextTypeEnum.NewTenantCredential, userJObject);
                var returnVal = DataUtility.SaveEmail(tenantId, workFlowProcessProperties.UserId, template, userInfo.UserCredential.Username.Value, "NewTenantCredential", InfoType.Tenant);
                return(objWorkFlowProcessMessage);
            }
            catch (System.Exception ex)
            {
                _log.Error("TenantEmailPostProcess  having exception message" + ex.Message);

                objWorkFlowProcessMessage.Success      = false;
                objWorkFlowProcessMessage.ErrorMessage = new ErrorMessage
                {
                    Code        = WorkFlowMessage.ApplicationError,
                    Description = ex.Message
                };
                return(objWorkFlowProcessMessage);
            }
        }
Exemplo n.º 7
0
        public User UserInfo(Guid userId, Guid tenantId)
        {
            var queryFilter = new List <QueryFilter>();

            queryFilter.Add(new QueryFilter {
                FieldName = "TenantId", Operator = "Equal", Value = tenantId.ToString()
            });
            queryFilter.Add(new QueryFilter {
                FieldName = "InternalId", Operator = "Equal", Value = userId.ToString()
            });
            var queryContext = new QueryContext {
                Fields = "FirstName,LastName", Filters = queryFilter, PageSize = 100, PageIndex = 1, MaxResult = 1
            };
            IEntityResourceManager _iEntityResourceManager = new VPC.Framework.Business.EntityResourceManager.Contracts.EntityResourceManager();
            User      userinfo = null;
            DataTable user     = _iEntityResourceManager.GetResult(tenantId, "User", queryContext);

            if (user.Rows.Count > 0)
            {
                userinfo = EntityMapper <User> .Mapper(user);
            }
            return(userinfo);
        }
Exemplo n.º 8
0
        void IBatchTypes.OnExecute(dynamic obj)
        {
            VPC.Entities.BatchType.BatchType batchType = (VPC.Entities.BatchType.BatchType)obj[0];
            var tenantId = Guid.Parse(batchType.TenantId.Value);

            try
            {
                ISettingManager        _iSettingManager        = new SettingManager();
                IEntityResourceManager _iEntityResourceManager = new VPC.Framework.Business.EntityResourceManager.Contracts.EntityResourceManager();
                IManagerBatchItem      _managerBatchItem       = new ManagerBatchItem();

                var result = _iSettingManager.GetSettingsByContext(tenantId, SettingContextTypeEnum.EMAIL);
                if (result != null)
                {
                    EmailSenderOptions options = Newtonsoft.Json.JsonConvert.DeserializeObject <EmailSenderOptions>(result.Content);
                    //Get Batch Item
                    var allBatchItems = _managerBatchItem.GetBatchItems(tenantId, new Guid(batchType.InternalId.Value), (batchType.ItemRetryCount.Value.Length > 0 ? (int?)Int32.Parse(batchType.ItemRetryCount.Value) : (int?)null));
                    foreach (var allBatchItem in allBatchItems)
                    {
                        try
                        {
                            var queryContext = new QueryContext {
                                Fields = "Body,Sender,Recipient,Subject,Id"
                            };
                            DataTable templatedt = _queryManager.GetResultById(tenantId, "email", allBatchItem.ReferenceId, queryContext);

                            _managerBatchItem.BatchItemUpdateStartTime(tenantId, allBatchItem.BatchItemId);
                            var email = EntityMapper <Email> .Mapper(templatedt);

                            SendEmail(tenantId, allBatchItem, email.Recipient.Value, email.Subject.Value, email.Body.Value, options);

                            //Update batch History
                            _managerBatchItem.BatchHistoryCreate(tenantId, new BatchItemHistory {
                                BatchHistoryId = Guid.NewGuid(),
                                BatchItemId    = allBatchItem.BatchItemId,
                                EntityId       = allBatchItem.EntityId,
                                ReferenceId    = allBatchItem.ReferenceId,
                                Status         = EmailEnum.Send,
                                RunTime        = allBatchItem.NextRunTime
                            });
                            //Update Email Status
                            _iEntityResourceManager.UpdateSpecificField(tenantId, "email", allBatchItem.ReferenceId, "Status", ((int)EmailEnum.Send).ToString());
                        }
                        catch (System.Exception ex)
                        {
                            _log.Error("An error has occurred while sending email", ex.Message);

                            //Update batch History
                            _managerBatchItem.BatchHistoryCreate(tenantId, new BatchItemHistory {
                                BatchHistoryId = Guid.NewGuid(),
                                BatchItemId    = allBatchItem.BatchItemId,
                                EntityId       = allBatchItem.EntityId,
                                ReferenceId    = allBatchItem.ReferenceId,
                                Status         = EmailEnum.Fail,
                                RunTime        = allBatchItem.NextRunTime,
                                FailedReason   = ex.Message
                            });
                            //Update Batch item status
                            _managerBatchItem.BatchItemUpdate(tenantId, (batchType.ItemRetryCount.Value.Length > 0 ? (int?)Int32.Parse(batchType.ItemRetryCount.Value) : (int?)null),
                                                              new BatchItem {
                                BatchItemId  = allBatchItem.BatchItemId,
                                Status       = EmailEnum.Fail,
                                FailedReason = ex.Message
                            });
                            //Update Email Status
                            _iEntityResourceManager.UpdateSpecificField(tenantId, "email", allBatchItem.ReferenceId, "Status", ((int)EmailEnum.Fail).ToString());
                            throw ex;
                        }

                        //Update Batch item status
                        _managerBatchItem.BatchItemUpdateStatus(tenantId, new BatchItem {
                            Status = EmailEnum.Send, BatchItemId = allBatchItem.BatchItemId
                        });
                    }
                }
                else
                {
                    _log.Error("Email gateway not configured");
                }
            }
            catch (System.Exception ex)
            {
                _log.Error("Email send failed", ex.Message);
            }
        }
Exemplo n.º 9
0
        public bool ForgetPasswordUpdateCredential(LoginInfo login, PasswordPolicy passwordpolicy)
        {
            IManagerCredential crd           = new ManagerCredential();
            ILayoutManager     layoutManager = new LayoutManager();
            IManagerRole       roleManager   = new ManagerRole();

            if (string.IsNullOrEmpty(login.TenantCode) || string.IsNullOrEmpty(login.UserName))
            {
                return(false);
            }
            //Get tenant id with code
            Guid tenantId = layoutManager.GetTenantId(InfoType.Tenant, login.TenantCode);

            if (tenantId == Guid.Empty)
            {
                return(false);
            }
            //Validate UserName
            var userId = crd.GetUserName(tenantId, login.UserName);

            if (userId == Guid.Empty)
            {
                return(false);
            }
            byte[] passwordHash, passwordSalt;
            Random random = new Random();
            int    pass   = random.Next(1000000);

            //pass = 111;
            CreatePasswordHash(pass.ToString(), out passwordHash, out passwordSalt);
            var userDetails = roleManager.GetUserDetails(tenantId, userId);

            if (userDetails.Id == Guid.Empty)
            {
                return(false);
            }
            var credentialData = crd.GetCredential(tenantId, userDetails.Id);


            IMetadataManager iMetadataManager = new MetadataManager.Contracts.MetadataManager();
            var queryFilter = new List <QueryFilter>();

            queryFilter.Add(new QueryFilter {
                FieldName = "TenantId", Operator = "Equal", Value = tenantId.ToString()
            });
            queryFilter.Add(new QueryFilter {
                FieldName = "InternalId", Operator = "Equal", Value = userDetails.Id.ToString()
            });
            var queryContext = new QueryContext {
                Fields = "FirstName,LastName,MiddleName,ContactInformation.WorkEmail1", Filters = queryFilter, PageSize = 100, PageIndex = 1
            };
            //  var queryContext = new QueryContext { Fields = "FirstName,LastName", Filters = queryFilter, PageSize = 100, PageIndex = 1 };
            IEntityResourceManager _iEntityResourceManager = new VPC.Framework.Business.EntityResourceManager.Contracts.EntityResourceManager();
            var dataTableUser = _iEntityResourceManager.GetResultById(tenantId, "user", userDetails.Id, queryContext);
            var userEntity    = EntityMapper <VPC.Entities.EntityCore.Metadata.User> .Mapper(dataTableUser);

            var            jObject            = DataUtility.ConvertToJObjectList(dataTableUser);
            CredentialInfo usercredentialinfo = UserCredentailInfo(login);

            jObject[0].Add(new JProperty("UserCredential.Username", usercredentialinfo.UserName.ToString()));
            jObject[0].Add(new JProperty("UserCredential.Password", pass.ToString()));
            jObject[0].Add(new JProperty("TenantCode", login.TenantCode.ToString()));

            var emailTemplate = _iEntityResourceManager.GetWellKnownTemplate(tenantId, "emailtemplate", "user", (int)ContextTypeEnum.Forgotpassword, jObject[0]);

            if (emailTemplate != null && emailTemplate.Body != null)
            {
                var isnew = false;
                if (passwordpolicy != null)
                {
                    isnew = passwordpolicy.ResetOnFirstLogin.Value;
                }

                crd.Update(tenantId, new CredentialInfo
                {
                    CredentialId = credentialData.CredentialId,
                    ParentId     = userDetails.Id,
                    PasswordHash = Convert.ToBase64String(passwordHash),
                    PasswordSalt = Convert.ToBase64String(passwordSalt),
                    IsNew        = isnew
                });
                var returnVal = DataUtility.SaveEmail(tenantId, userDetails.Id, emailTemplate, usercredentialinfo.UserName.ToString(), "ForgetPassword", InfoType.User);
                // SendMail(pass.ToString(),emailTemplate,jdata[0],tenantId,userDetails.Id);
            }
            else
            {
                return(false);
            }

            return(true);
        }