Exemplo n.º 1
0
        public void RemoveAll(int barCodeConfigID)
        {
            var recordToRemove = context.BarCodeConfigSite.Where(_ => _.BarCodeConfigID == barCodeConfigID).ToList();

            context.BarCodeConfigSite.RemoveRange(recordToRemove);
            context.SaveChanges();
        }
 public void Insert(string UserName, Mode mode)
 {
     context.SystemConfig.Add(new SystemConfig()
     {
         UserName = UserName, Mode = mode
     });
     context.SaveChanges();
 }
Exemplo n.º 3
0
        public int Update(SLA sla)
        {
            var existingSLAConfig = context.SLA.Find(sla.ID);

            if (existingSLAConfig != null)
            {
                existingSLAConfig.Name        = sla.Name;
                existingSLAConfig.Description = sla.Description;
                existingSLAConfig.Target      = sla.Target;
                context.SaveChanges();
                return(existingSLAConfig.ID);
            }
            return(0);
        }
        public void Update(BarCodeConfig barCodeConfig)
        {
            var existingBarCodeConfig = context.BarCodeConfig.Find(barCodeConfig.ID);

            if (existingBarCodeConfig != null)
            {
                existingBarCodeConfig.ExportFileName     = barCodeConfig.ExportFileName;
                existingBarCodeConfig.UseDefaultFileName = barCodeConfig.UseDefaultFileName;
                existingBarCodeConfig.UseTimeInFileName  = barCodeConfig.UseTimeInFileName;
                existingBarCodeConfig.FileExportType     = barCodeConfig.FileExportType;
                existingBarCodeConfig.DelimiterType      = barCodeConfig.DelimiterType;
                existingBarCodeConfig.ExportSchedule     = barCodeConfig.ExportSchedule;
                existingBarCodeConfig.ExportScheduleTime = barCodeConfig.ExportScheduleTime;
                existingBarCodeConfig.SenderDetails      = barCodeConfig.SenderDetails;
                context.SaveChanges();
            }
        }
Exemplo n.º 5
0
        public void Insert(string description)
        {
            var client = new Client()
            {
                Description = description
            };

            context.Clients.Add(client);
            context.SaveChanges();
        }
Exemplo n.º 6
0
 public string Insert(SLAValues slaValues)
 {
     try
     {
         var SLAValuesObj = new SLAValues()
         {
             SLAID                = slaValues.SLAID,
             ReportingDate        = slaValues.ReportingDate,
             QuantityProcessed    = slaValues.QuantityProcessed,
             QuantityOutsideofSLA = slaValues.QuantityOutsideofSLA,
             UpdatedBy            = slaValues.UpdatedBy,
             UpdatedDate          = slaValues.UpdatedDate
         };
         context.SLAValues.Add(SLAValuesObj);
         context.SaveChanges();
         return("1");
     }
     catch (DbEntityValidationException ex)
     {
         return(ex.EntityValidationErrors.FirstOrDefault().ValidationErrors.FirstOrDefault().ErrorMessage + ":" + ex.EntityValidationErrors.FirstOrDefault().ValidationErrors.FirstOrDefault().PropertyName);
     }
 }
Exemplo n.º 7
0
        public void Insert(int clientId, string name, string description, string idPrefix)
        {
            var client = context.Clients.FirstOrDefault(_ => _.ID == clientId);

            if (client != null)
            {
                var profile = new Profile()
                {
                    Name        = name,
                    Description = description,
                    SLAIDPrefix = idPrefix,
                    ClientID    = client.ID
                };
                client.Profiles.Add(profile);
                context.SaveChanges();
            }
            ;
        }