Esempio n. 1
0
        public bool ifExistConfig(ConfiguracionesJSON item)
        {
            int       tn            = clsCommon.getIdentity().tenatId;
            genConfig ifexistconfig = (from c in db.genConfig where c.genConfigNameId == item.configNameid && c.tenantId == tn select c).FirstOrDefault();

            if (ifexistconfig != null)
            {
                ifexistconfig.parameter       = item.parameter;
                ifexistconfig.updatedById     = clsCommon.getIdentity().Id;
                ifexistconfig.modifyDateTime  = new DateTime(1900, 1, 1, 0, 0, 0);//por defecto o null
                db.Entry(ifexistconfig).State = EntityState.Modified;
                db.SaveChanges();
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        public genConfig BulkConfigs(ConfiguracionesJSON item)
        {
            genConfig config = new genConfig();

            config.parameter       = item.parameter;
            config.active          = true;
            config.genConfigNameId = item.configNameid;
            /****** Valores quemados de campos auditoria*****/
            config.tenantId       = clsCommon.getIdentity().tenatId;
            config.updatedById    = 0;                                 //por defecto o null
            config.createdById    = clsCommon.getIdentity().Id;
            config.modifyDateTime = new DateTime(1900, 1, 1, 0, 0, 0); //por defecto o null
            config.insertDateTime = DateTime.Now;
            ///****** Valores quemados de campos auditoria*****/

            return(config);
        }
Esempio n. 3
0
        public static string getSetting(string code)
        {
            TestProjectEntities db = new TestProjectEntities();

            try
            {
                int           currenttenant = getIdentity().tenatId;
                genConfigName config        = db.genConfigName.Where(x => x.code.ToLower() == code.ToLower()).FirstOrDefault();
                genConfig     configvalue   = db.genConfig.Where(c => c.tenantId == currenttenant && c.genConfigNameId == config.genConfigNameId).FirstOrDefault();
                //tenant tenant = db.tenant.Find(user.tenantId);
                //billingRefNumber = tenant.billingRefNumber;
                if (config != null)
                {
                    return(configvalue.parameter);
                }
            }
            catch (Exception e)
            {
            }


            return(null);
        }