示例#1
0
 public bool createOrUpdateMmodel(OInv.Common.Entities.Model model)
 {
     try
     {
         using (var db = new MainDatabaseEntities())
         {
             if (model.ModelId == 0)
             {
                 // db.Models.Add(new Model { Model_Id = model.ModelId, Model_Name = model.ModelName ,Model_SKU=model.ModelName, Model_Type=model.ModelType,Model_SubType=model.ModelSubType});
                 db.SaveChanges();
             }
             else
             {
                 Model manu = db.Models.Where(x => x.Model_Id == model.ModelId).FirstOrDefault();
                 manu.Model_Name    = model.ModelName;
                 manu.Model_SKU     = model.ModelSKU;
                 manu.Model_Type    = model.ModelSubTypeId;
                 manu.Model_SubType = model.ModelSubTypeId;
                 db.SaveChanges();
             }
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
示例#2
0
 public OInv.Common.Entities.Model addNewMmodel(OInv.Common.Entities.Model model)
 {
     throw new NotImplementedException();
 }