public HttpResponseMessage GetCityUserAcctEmpty() { HttpStatusCode ReturnCode = HttpStatusCode.OK; TranInfo <CityUserAccount_M> transaction = new TranInfo <CityUserAccount_M>(); ReturnResult <CityUserAccount_M> result = new ReturnResult <CityUserAccount_M>(); try { // ExtractClaimDetails(); CityUserAccount_M obj; obj = new CityUserAccount_M(); transaction.data = obj; transaction.status = true; } catch (Exception ex) { transaction.AddException(ex.Message); ReturnCode = HttpStatusCode.InternalServerError; result.status = _eHandler.HandleException(ex); _commonService.LogError(result.status); // LogHelper.Instance.Error(service.CorrelationId, Username, Request.GetRequestContext().VirtualPathRoot, ex.Message, InnerExceptionMessage, 0, ex); } return(Request.CreateResponse <TranInfo <CityUserAccount_M> >(ReturnCode, transaction)); }
public HttpResponseMessage CreateCityUserAccount([FromBody] CityUserAccount_M cityUserModel) { System.Diagnostics.EventLog.WriteEntry("Application", "Controller Save Customer started"); AccountManagementService accService = new AccountManagementService(); IEmailService emailService = new EmailService(); HttpStatusCode ReturnCode = HttpStatusCode.OK; TranInfo <CityUserAccount_M> transaction = new TranInfo <CityUserAccount_M>(); ReturnResult <CityUserAccount_M> result = new ReturnResult <CityUserAccount_M>(); try { result = accService.CreateCityUserAccount(cityUserModel); if (result.status.Status == StatusEnum.Success) { //emailService.SendEmail(getRegisterCustomerEmailModel(result.result)); transaction.status = true; } else { transaction.status = false; transaction.AddException(result.status.StatusMessage); } } catch (Exception ex) { transaction.status = false; transaction.AddException(ex.Message); ReturnCode = HttpStatusCode.InternalServerError; result.status = _eHandler.HandleException(ex); _commonService.LogError(result.status); } return(Request.CreateResponse <TranInfo <CityUserAccount_M> >(ReturnCode, transaction)); }
public ReturnResult <List <CityUserAccount_M> > GetAnalysts() { ReturnResult <List <CityUserAccount_M> > result = new ReturnResult <List <CityUserAccount_M> >(); try { List <CityUserAccount_M> Analysts = new List <CityUserAccount_M>(); using (AccountManagementDataContext db = new AccountManagementDataContext(_connString)) { var AnalystsDB = db.CityUserAccounts.Where(x => x.IsAnalyst == true).ToList(); foreach (var item in AnalystsDB) { CityUserAccount_M objAnalyst = new CityUserAccount_M(); objAnalyst.UserID = (int)item.CityUserID; objAnalyst.FirstName = item.FirstName; objAnalyst.LastName = item.LastName; objAnalyst.MobilePhoneNumber = item.MobilePhoneNumber; objAnalyst.OfficePhoneNumber = item.OfficePhoneNumber; objAnalyst.OfficeLocation = item.OfficeLocation; objAnalyst.Title = item.Title; objAnalyst.Department = item.Department; objAnalyst.CreatedDate = item.CreatedDate; objAnalyst.Email = item.Email; objAnalyst.EmployeeID = (int)item.EmployeeID; objAnalyst.IsAnalyst = item.IsAnalyst; objAnalyst.IsHearingOfficer = item.IsHearingOfficer; Analysts.Add(objAnalyst); } result.result = Analysts; result.status = new OperationStatus() { Status = StatusEnum.Success }; return(result); } } catch (Exception ex) { IExceptionHandler eHandler = new ExceptionHandler(); result.status = eHandler.HandleException(ex); commondbHandler.SaveErrorLog(result.status); return(result); } }
public ReturnResult <CityUserAccount_M> CreateCityUserAccount(CityUserAccount_M message) { ReturnResult <CityUserAccount_M> result = new ReturnResult <CityUserAccount_M>(); string _loginURL = ConfigurationManager.AppSettings["CityloginURL"]; bool bEdit = false; try { if (message.UserID != 0) { bEdit = true; } var dbResult = accDBHandler.CreateCityUserAccount(message); if (dbResult.status.Status != StatusEnum.Success) { result.status = dbResult.status; return(result); } if (bEdit == false) { EmailM emailMessage = new EmailM(); emailMessage.Subject = "RAP Account created Successfully"; emailMessage.MessageBody = NotificationMessage.ResourceManager.GetString("CityAccountCreatedMsg").Replace("LOGIN", _loginURL).Replace("NAME", dbResult.result.FirstName + " " + dbResult.result.LastName); if (dbResult.result.Email != null) { emailMessage.RecipientAddress.Add(dbResult.result.Email); } emailservice.SendEmail(emailMessage); } result.result = dbResult.result; result.status = new OperationStatus() { Status = StatusEnum.Success }; return(result); } catch (Exception ex) { result.status = _eHandler.HandleException(ex); // _commonService.LogError(result.status); return(result); } }
public HttpResponseMessage LoginCityUser([FromBody] CityUserAccount_M loginInfo) { //System.Diagnostics.EventLog.WriteEntry("Application", "LoginCust started"); AccountManagementService accService = new AccountManagementService(); HttpStatusCode ReturnCode = HttpStatusCode.OK; TranInfo <CityUserAccount_M> transaction = new TranInfo <CityUserAccount_M>(); ReturnResult <CityUserAccount_M> result = new ReturnResult <CityUserAccount_M>(); try { result = accService.GetCityUser(loginInfo); if (result.status.Status == StatusEnum.Success) { transaction.data = result.result; transaction.status = true; } else { // transaction.warnings.Add(result.status.StatusMessage); transaction.status = false; transaction.AddException(result.status.StatusMessage); //_commonService.LogError(result.status.StatusCode, result.status.StatusMessage, result.status.StatusDetails, 0, "LoginCust"); } } catch (Exception ex) { transaction.status = false; transaction.AddException(ex.Message); ReturnCode = HttpStatusCode.InternalServerError; result.status = _eHandler.HandleException(ex); _commonService.LogError(result.status); // transaction.AddException(ex.Message); //ReturnCode = HttpStatusCode.InternalServerError; //if (ex.InnerException != null) { InnerExceptionMessage = ex.InnerException.Message; } //LogHelper.Instance.Error(CorrelationID, Username, Request.GetRequestContext().VirtualPathRoot, ex.Message, InnerExceptionMessage, 0, ex); } return(Request.CreateResponse <TranInfo <CityUserAccount_M> >(ReturnCode, transaction)); }
public ReturnResult <CityUserAccount_M> GetCityUser(CityUserAccount_M message) { return(accDBHandler.GetCityUser(message)); }