Ejemplo n.º 1
0
        public void Update(PropertyPricingTypesView model, int CoreSystemUserId)
        {
            try
            {
                using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext())
                {
                    DataAccess.PropertyListingPricingType table = db.PropertyListingPricingTypes.FirstOrDefault(x => x.PropertyListingPricingTypeId == model.PropertyListingPricingTypeId);

                    LoadEditLogDetails(table.PropertyListingPricingTypeId, CoreSystemUserId);

                    JazMax.BusinessLogic.ChangeLog.ChangeLogService.LogChange(table.TypeName, model.TypeName, "Property Price Type");

                    if (table != null)
                    {
                        table.IsActive = true;
                        table.TypeName = model.TypeName;
                        db.SaveChanges();
                    }
                }
            }
            catch (Exception e)
            {
                JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0);
            }
        }
Ejemplo n.º 2
0
 public void Create(PropertyPricingTypesView model)
 {
     try
     {
         using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext())
         {
             DataAccess.PropertyListingPricingType table = new DataAccess.PropertyListingPricingType()
             {
                 IsActive = true,
                 TypeName = model.TypeName
             };
             db.PropertyListingPricingTypes.Add(table);
             db.SaveChanges();
         }
     }
     catch (Exception e)
     {
         JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0);
     }
 }
Ejemplo n.º 3
0
        public void Activation(bool isAction, int PropertyListingPricingTypeId, int UserId)
        {
            try
            {
                using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext())
                {
                    DataAccess.PropertyListingPricingType table = db.PropertyListingPricingTypes.FirstOrDefault(x => x.PropertyListingPricingTypeId == PropertyListingPricingTypeId);
                    LoadEditLogDetails(table.PropertyListingPricingTypeId, UserId);

                    if (table != null)
                    {
                        if (isAction)
                        {
                            JazMax.BusinessLogic.ChangeLog.ChangeLogService.LogChange(
                                JazMax.BusinessLogic.ChangeLog.ChangeLogService.GetBoolString(table.IsActive),
                                JazMax.BusinessLogic.ChangeLog.ChangeLogService.GetBoolString(true), "Active Status");

                            table.IsActive = true;
                        }
                        else
                        {
                            JazMax.BusinessLogic.ChangeLog.ChangeLogService.LogChange(
                                JazMax.BusinessLogic.ChangeLog.ChangeLogService.GetBoolString(table.IsActive),
                                JazMax.BusinessLogic.ChangeLog.ChangeLogService.GetBoolString(false), "Active Status");

                            table.IsActive = false;
                        }
                    }
                    db.SaveChanges();
                }
            }
            catch (Exception e)
            {
                JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0);
            }
        }