예제 #1
0
        public static void AddMaintenanceWork(Guid idTechObj, MaintenanceWorks maintenanceWorks)
        {
            TechObject techObject = FindTechObjByID(idTechObj);

            techObject.MaintenanceWorks.Add(maintenanceWorks);
            model.SaveChanges();
        }
예제 #2
0
        public static TechObject FindTechObjByID(Guid id)
        {
            TechObject techObject = (from t in model.TechObjectSet
                                     where t.Id == id
                                     select t).First();

            return(techObject);
        }
예제 #3
0
        public static void AddNewTechObject(string name, string productionDate,
                                            string shippingDate, int warrantyPeriod)
        {
            TechObject techObject = new TechObject(name, productionDate,
                                                   shippingDate, warrantyPeriod);

            model.TechObjectSet.Add(techObject);
            model.SaveChanges();
        }
예제 #4
0
        public static void ChangeTechObj(Guid id, string name, string productionDate,
                                         string shippingDate, int warrantyPeriod)
        {
            TechObject techObject = FindTechObjByID(id);

            techObject.Name           = name;
            techObject.ProductionDate = productionDate;
            techObject.ShippingDate   = shippingDate;
            techObject.WarrantyPeriod = warrantyPeriod;

            model.SaveChanges();
        }
예제 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Guid       id         = new Guid(Request.Params["TechObjectID"]);
         TechObject techObject = MyModel.FindTechObjByID(id);
         Name.Text                        = techObject.Name;
         ProductionDate.Text              = techObject.ProductionDate;
         ShippingDate.Text                = techObject.ShippingDate;
         WarrantyPeriod.Text              = techObject.WarrantyPeriod.ToString();
         Session["TechObjectID"]          = id;
         MaintenanceWorksTable.DataSource = MyModel.GetListMaintWorksForTechObj(id);
         MaintenanceWorksTable.DataBind();
     }
 }