Exemplo n.º 1
0
        public bool SaveCompany(Company modelData, string confirmationUrl, string mailContent)
        {
            bool IsNew    = false;
            bool bSuccess = false;

            try
            {
                ProCompany companyData;
                if (modelData.CompanyId > 0)
                {
                    companyData          = companyRepositry.GetCompany(modelData.CompanyId);
                    modelData.ModifiedOn = DateTime.Now;
                    modelData.ModifiedBy = userService.GetLoggdInUser().UserId;
                }
                else
                {
                    companyData         = new ProCompany();
                    modelData.CreatedOn = DateTime.Now;
                    modelData.CreatedBy = userService.GetLoggdInUser().UserId;
                    modelData.IsActive  = 1;
                    IsNew = true;
                }


                bSuccess = companyRepositry.SaveCompany(companyData);
            }
            catch (Exception ex)
            {
                logger.LogError(ex, ex.Message);
            }
            return(bSuccess);
        }
 public bool SaveCompany(ProCompany proCompany)
 {
     if (proCompany.CompanyId == 0)
     {
         dbContext.ProCompany.Add(proCompany);
     }
     return(dbContext.SaveChanges() > 0);
 }