コード例 #1
0
 public void Edit([FromBody] TrayType trayType)
 {
     if (ModelState.IsValid)
     {
         objtraytype.UpdateTrayType(trayType);
     }
 }
コード例 #2
0
 public void Create([FromBody] TrayType trayType)
 {
     if (ModelState.IsValid)
     {
         objtraytype.AddTrayType(trayType);
     }
 }
コード例 #3
0
 //Get the details of a particular tray
 public TrayType GetTrayTypeData(int id)
 {
     try
     {
         TrayType trayType = db.tblTrayType.Find(id);
         return(trayType);
     }
     catch
     {
         throw;
     }
 }
コード例 #4
0
 //To Update the records of a particluar tray
 public void UpdateTrayType(TrayType trayType)
 {
     try
     {
         db.Entry(trayType).State = EntityState.Modified;
         db.SaveChanges();
     }
     catch
     {
         throw;
     }
 }
コード例 #5
0
 //To Add new tray record
 public void AddTrayType(TrayType trayType)
 {
     try
     {
         db.tblTrayType.Add(trayType);
         db.SaveChanges();
     }
     catch
     {
         throw;
     }
 }
コード例 #6
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 4, Configuration.FieldSeparator),
                       Id,
                       TrayType?.ToDelimitedString(),
                       ServicePeriod != null ? string.Join(Configuration.FieldRepeatSeparator, ServicePeriod.Select(x => x.ToDelimitedString())) : null,
                       TextInstruction
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
コード例 #7
0
 //To Delete the record of a particular tray
 public void DeleteTrayType(int id)
 {
     try
     {
         TrayType trayType = db.tblTrayType.Find(id);
         db.tblTrayType.Remove(trayType);
         db.SaveChanges();
     }
     catch
     {
         throw;
     }
 }