public Pattern Insert(int? supplierId, string patternCode, string patternMaker,
     decimal? price, decimal? outerDiameter, decimal? innerDiameter, decimal? height,
     decimal? width, decimal? length, string modificationRemarks, DateTime? dateCreated,
     DateTime? dateModified, string createdBy, string modifiedBy, string remarks)
 {
     using (var ctx = new InventorySystemMaintenanceEntities())
     {
         Pattern item = new Pattern();
         if (supplierId != null)
         {
             item.SupplierId = supplierId;
         }
         if (!String.IsNullOrEmpty(patternCode))
         {
             item.PatternCode = patternCode;
         }
         if (!String.IsNullOrEmpty(patternMaker))
         {
             item.PatternMaker = patternMaker;
         }
         if (outerDiameter != null)
         {
             item.OuterDiameter = outerDiameter;
         }
         if (innerDiameter != null)
         {
             item.InnerDiameter = innerDiameter;
         }
         if (height != null)
         {
             item.Height = height;
         }
         if (width != null)
         {
             item.Width = width;
         }
         if (length != null)
         {
             item.Length = length;
         }
         if (!String.IsNullOrEmpty(modificationRemarks))
         {
             item.ModificationRemarks = modificationRemarks;
         }
         if (dateCreated != null)
         {
             item.DateCreated = dateCreated;
         }
         if (dateModified != null)
         {
             item.DateModified = dateModified;
         }
         if (!String.IsNullOrEmpty(createdBy))
         {
             item.CreatedBy = createdBy;
         }
         if (!String.IsNullOrEmpty(modifiedBy))
         {
             item.ModifiedBy = modifiedBy;
         }
         if (!String.IsNullOrEmpty(remarks))
         {
             item.Remarks = remarks;
         }
         ctx.AddToPattern(item);
         ctx.SaveChanges();
         return item;
     }
 }