Exemplo n.º 1
0
        public List<xlinkModel> getxlinkdetails()
        {
            try
            {
                db = new DatabaseEntities();
                var data = (from s in db.UtaxCrosslinkDetails
                            select s).ToList();

                var lst = (from s in data
                           select new xlinkModel
                           {
                               MasterId = s.Username,
                               Password = PasswordManager.DecryptText(s.Password),
                               CLAccountId = s.CLAccountId,
                               CLLogin = s.CLLogin,
                               CLAccountPassword = string.IsNullOrEmpty(s.CLAccountPassword) ? "" : PasswordManager.DecryptText(s.CLAccountPassword),
                               status = s.StatusCode == EMPConstants.Active ? "Active" : "Inactive",
                               Id = s.Id
                           }).ToList();
                return lst;

            }
            catch (Exception ex)
            {
                return new List<xlinkModel>();
            }
        }
Exemplo n.º 2
0
        public IQueryable <APIIntegrationDTO> GetAll()
        {
            db = new DatabaseEntities();
            var data = db.APIIntegrations.Select(o => new APIIntegrationDTO
            {
                Id         = o.Id,
                Name       = o.Name,
                URL        = o.URL,
                UserName   = o.UserName,
                Password   = o.Password, //o.Password,
                StatusCode = o.StatusCode
            }).DefaultIfEmpty();

            List <APIIntegrationDTO> APIIntegrationDTOs = new List <APIIntegrationDTO>();

            foreach (APIIntegrationDTO API in data)
            {
                APIIntegrationDTO APIInteg = new APIIntegrationDTO();
                APIInteg.Id         = API.Id;
                APIInteg.Id         = API.Id;
                APIInteg.Name       = API.Name;
                APIInteg.URL        = API.URL;
                APIInteg.UserName   = API.UserName;
                APIInteg.Password   = PasswordManager.DecryptText(API.Password); //o.Password,
                APIInteg.StatusCode = API.StatusCode;
                APIIntegrationDTOs.Add(APIInteg);
            }

            return(APIIntegrationDTOs.AsQueryable());
        }
Exemplo n.º 3
0
        public async Task <Guid> Save(APIIntegrationDTO _Dto, Guid Id, int EntityState)
        {
            APIIntegration _APIIntegration = new APIIntegration();

            if (_Dto != null)
            {
                _APIIntegration.Id         = Id;
                _APIIntegration.Name       = _Dto.Name;
                _APIIntegration.URL        = _Dto.URL;
                _APIIntegration.UserName   = _Dto.UserName;
                _APIIntegration.Password   = PasswordManager.DecryptText(_Dto.Password);
                _APIIntegration.StatusCode = EMPConstants.Active;
            }

            if (_Dto.Id != null)
            {
                _APIIntegration.CreatedBy       = _Dto.UserId;
                _APIIntegration.CreatedDate     = DateTime.Now;
                _APIIntegration.LastUpdatedBy   = _Dto.UserId;
                _APIIntegration.LastUpdatedDate = DateTime.Now;
            }
            else
            {
                _APIIntegration.LastUpdatedBy   = _Dto.UserId;
                _APIIntegration.LastUpdatedDate = DateTime.Now;
            }

            if (EntityState == (int)System.Data.Entity.EntityState.Modified)
            {
                db.Entry(_APIIntegration).State = System.Data.Entity.EntityState.Modified;
            }
            else
            {
                db.APIIntegrations.Add(_APIIntegration);
            }

            try
            {
                await db.SaveChangesAsync();

                return(_APIIntegration.Id);
            }

            catch (DbUpdateConcurrencyException)
            {
                if (!IsExists(_APIIntegration.Id))
                {
                    return(_APIIntegration.Id);
                }
                else
                {
                    throw;
                }
            }
        }
Exemplo n.º 4
0
        public async Task <APIIntegrationDTO> GetById(Guid Id)
        {
            var data = await db.APIIntegrations.Where(o => o.Id == Id).Select(o => new APIIntegrationDTO
            {
                Id         = o.Id,
                Name       = o.Name,
                URL        = o.URL,
                UserName   = o.UserName,
                Password   = PasswordManager.DecryptText(o.Password), //o.Password,
                StatusCode = o.StatusCode
            }).FirstOrDefaultAsync();

            return(data);
        }
Exemplo n.º 5
0
        public CustomerLoginInformationModel GetCustomerLoginInformation(Guid id)
        {
            try
            {
                CustomerLoginInformationModel model = new CustomerLoginInformationModel();
                var itm = (from e in db.emp_CustomerLoginInformation
                           join c in db.emp_CustomerInformation on e.CustomerOfficeId equals c.Id
                           where c.Id == id
                           select new { e, c }).FirstOrDefault();
                if (itm != null)
                {
                    model.CLAccountId       = itm.e.CLAccountId;
                    model.CLLogin           = itm.e.CLLogin;
                    model.CLAccountPassword = itm.e.CLAccountPassword;

                    model.SalesforceParentID = itm.c.SalesforceParentID != null?itm.c.SalesforceParentID.ToString() : "";

                    model.Id         = itm.e.Id.ToString();
                    model.EFIN       = itm.c.EFIN;
                    model.EntityId   = itm.c.EntityId;
                    model.EFINStatus = itm.c.EFINStatus;

                    model.MasterIdentifier       = !string.IsNullOrEmpty(itm.e.MasterIdentifier) ? itm.e.MasterIdentifier.ToString() : "";
                    model.CrossLinkUserId        = !string.IsNullOrEmpty(itm.e.CrossLinkUserId) ? itm.e.CrossLinkUserId.ToString() : "";
                    model.CrossLinkPassword      = !string.IsNullOrEmpty(itm.e.CrossLinkPassword) ? PasswordManager.DecryptText(itm.e.CrossLinkPassword.ToString()) : "";
                    model.OfficePortalUrl        = !string.IsNullOrEmpty(itm.e.OfficePortalUrl) ? itm.e.OfficePortalUrl.ToString() : "";
                    model.TaxOfficeUsername      = !string.IsNullOrEmpty(itm.e.TaxOfficeUsername) ? itm.e.TaxOfficeUsername.ToString() : "";
                    model.TaxOfficePassword      = !string.IsNullOrEmpty(itm.e.TaxOfficePassword) ? PasswordManager.DecryptText(itm.e.TaxOfficePassword.ToString()) : "";
                    model.CustomerOfficeId       = itm.e.CustomerOfficeId;
                    model.EMPPassword            = !string.IsNullOrEmpty(itm.e.EMPPassword) ? PasswordManager.DecryptText(itm.e.EMPPassword.ToString()) : "";
                    model.EMPUserId              = !string.IsNullOrEmpty(itm.e.EMPUserId) ? itm.e.EMPUserId.ToString() : "";
                    model.CompanyName            = !string.IsNullOrEmpty(itm.c.CompanyName) ? itm.c.CompanyName.ToString() : "";
                    model.BusinessOwnerFirstName = !string.IsNullOrEmpty(itm.c.BusinessOwnerFirstName) ? itm.c.BusinessOwnerFirstName.ToString() : "";
                    model.BusinessOwnerLastName  = !string.IsNullOrEmpty(itm.c.BusinesOwnerLastName) ? itm.c.BusinesOwnerLastName.ToString() : "";
                    model.PhysicalAddress1       = !string.IsNullOrEmpty(itm.c.PhysicalAddress1) ? itm.c.PhysicalAddress1.ToString() : "";
                    model.IsMSOUser              = itm.c.IsMSOUser ?? false;
                    model.CityStateZip           = ((itm.c.PhysicalCity != null) ? itm.c.PhysicalCity.ToString() : "") + ' ' + ((itm.c.PhysicalState != null) ? itm.c.PhysicalState.ToString() : "") + ", " + ((itm.c.PhysicalZipCode != null) ? itm.c.PhysicalZipCode.ToString() : "");
                    model.TransmitType           = "";
                    model.IsMSOUser              = itm.c.IsMSOUser ?? false;
                    var dbssb = db.SubSiteConfigurations.Where(a => a.emp_CustomerInformation_ID == id).FirstOrDefault();
                    if (dbssb != null)
                    {
                        if (dbssb.SubSiteTaxReturn == 1)
                        {
                            model.TransmitType = "All Sub-sites will transmit to the IRS (Transmitter) ";
                        }
                        else if (dbssb.SubSiteTaxReturn == 2)
                        {
                            model.TransmitType = "All Sub-sites will transmit to the Main Office (Feeder) ";
                        }
                        else
                        {
                            model.TransmitType = "Mixed – Some Sub-sites will transmit to the IRS and some will transmit to the Main Office ";
                        }
                    }

                    model.MSO = "";
                    string strBank = "";

                    var dbBank = (from ssb in db.SubSiteBankConfigs
                                  join bm in db.BankMasters on ssb.BankMaster_ID equals bm.Id
                                  where ssb.emp_CustomerInformation_ID == id
                                  select new { bm, ssb });


                    foreach (var bn in dbBank)
                    {
                        if (bn.bm.BankName == "TPG")
                        {
                            strBank += bn.bm.BankName + ": ";
                            var bankqu = db.BankSubQuestions.Where(a => a.Id == bn.ssb.SubQuestion_ID).Select(a => a.Questions).FirstOrDefault() + "<br/>";
                            strBank += bankqu;
                        }
                        else
                        {
                            strBank += bn.bm.BankName + "<br/>";
                        }
                    }


                    if (!string.IsNullOrEmpty(model.MasterIdentifier))
                    {
                        model.MasterIdentifierPassword = "******";
                        var UtaxCrosslinkDetail = db.UtaxCrosslinkDetails.Where(o => o.Username == model.MasterIdentifier).FirstOrDefault();
                        if (UtaxCrosslinkDetail != null)
                        {
                            model.MasterIdentifierPassword = !string.IsNullOrEmpty(UtaxCrosslinkDetail.Password) ? PasswordManager.DecryptText(UtaxCrosslinkDetail.Password) : "";
                        }
                    }

                    model.Bank = strBank;
                    int    EFIN     = model.EFIN ?? 0;
                    string EFINText = EFIN.ToString().PadLeft(6, '0');
                    if (model.EFINStatus == 16 || model.EFINStatus == 19)
                    {
                        model.EFINStatusText = EFINText;
                    }
                    else if (model.EFINStatus == 21)
                    {
                        model.EFINStatusText = (EFIN > 0) ? EFINText + "<u><b>S</b></u>".ToString() : "Sharing";
                    }
                    else if (model.EFINStatus == 17 || model.EFINStatus == 20)
                    {
                        model.EFINStatusText = "Applied";
                    }
                    else if (model.EFINStatus == 18)
                    {
                        model.EFINStatusText = "Not Required";
                    }
                    else
                    {
                        model.EFINStatusText = EFINText;
                    }
                }
                return(model);
            }
            catch (Exception ex)
            {
                EMPPortal.Core.Utilities.ExceptionLogger.LogException(ex.ToString(), "CustomerLoginInformationService/GetCustomerLoginInformation", id);
                throw;
            }
        }