コード例 #1
0
        public void Setsysdiagrams(sysdiagrams sysdiagramsUp)
        {
            MaderaEntities MaderaEntities = new MaderaEntities();

            MaderaEntities.sysdiagrams.Add(sysdiagramsUp);
            MaderaEntities.SaveChanges();
        }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            sysdiagrams sysdiagrams = db.sysdiagrams.Find(id);

            db.sysdiagrams.Remove(sysdiagrams);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
        /// <summary>
        /// Create a new sysdiagrams object.
        /// </summary>
        /// <param name="name">Initial value of name.</param>
        /// <param name="principal_id">Initial value of principal_id.</param>
        /// <param name="diagram_id">Initial value of diagram_id.</param>
        public static sysdiagrams Createsysdiagrams(string name, int principal_id, int diagram_id)
        {
            sysdiagrams sysdiagrams = new sysdiagrams();

            sysdiagrams.name         = name;
            sysdiagrams.principal_id = principal_id;
            sysdiagrams.diagram_id   = diagram_id;
            return(sysdiagrams);
        }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "name,principal_id,diagram_id,version,definition")] sysdiagrams sysdiagrams)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sysdiagrams).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sysdiagrams));
 }
コード例 #5
0
        public ActionResult Create([Bind(Include = "name,principal_id,diagram_id,version,definition")] sysdiagrams sysdiagrams)
        {
            if (ModelState.IsValid)
            {
                db.sysdiagrams.Add(sysdiagrams);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sysdiagrams));
        }
コード例 #6
0
 public ActionResult Update(sysdiagrams sysdiagrams)
 {
     if (sysdiagramsService.Update(sysdiagrams))
     {
         return(Redirect("sysdiagrams"));
     }
     else
     {
         return(Content("no"));
     }
 }
コード例 #7
0
 public void InsertSysdiagrams(sysdiagrams sysdiagrams)
 {
     if ((sysdiagrams.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(sysdiagrams, EntityState.Added);
     }
     else
     {
         this.ObjectContext.sysdiagrams.AddObject(sysdiagrams);
     }
 }
コード例 #8
0
        /// <summary>
        /// dohvati jedan po primary key-u
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        public sysdiagrams Get(int Id)
        {
            sysdiagrams item = null;

            using (Entities data = new Entities())
            {
                item = data.sysdiagrams.Where(r => r.Id == Id).FirstOrDefault();
            }

            return(item);
        }
コード例 #9
0
        // POST: odata/sysdiagrams
        public IHttpActionResult Post(sysdiagrams sysdiagrams)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.sysdiagrams.Add(sysdiagrams);
            db.SaveChanges();

            return(Created(sysdiagrams));
        }
コード例 #10
0
 public void DeleteSysdiagrams(sysdiagrams sysdiagrams)
 {
     if ((sysdiagrams.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(sysdiagrams, EntityState.Deleted);
     }
     else
     {
         this.ObjectContext.sysdiagrams.Attach(sysdiagrams);
         this.ObjectContext.sysdiagrams.DeleteObject(sysdiagrams);
     }
 }
コード例 #11
0
        // GET: sysdiagrams/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            sysdiagrams sysdiagrams = db.sysdiagrams.Find(id);

            if (sysdiagrams == null)
            {
                return(HttpNotFound());
            }
            return(View(sysdiagrams));
        }
コード例 #12
0
        // DELETE: odata/sysdiagrams(5)
        public IHttpActionResult Delete([FromODataUri] int key)
        {
            sysdiagrams sysdiagrams = db.sysdiagrams.Find(key);

            if (sysdiagrams == null)
            {
                return(NotFound());
            }

            db.sysdiagrams.Remove(sysdiagrams);
            db.SaveChanges();

            return(StatusCode(HttpStatusCode.NoContent));
        }
コード例 #13
0
 public static Common.Business.sysdiagrams Fetch(sysdiagrams data)
 {
     Common.Business.sysdiagrams item = (Common.Business.sysdiagrams)Activator.CreateInstance(typeof(Common.Business.sysdiagrams));
     //using (ObjectFactory.BypassPropertyChecks(item))
     {
         item.name         = data.name;
         item.principal_id = data.principal_id;
         item.diagram_id   = data.diagram_id;
         item.version      = data.version;
         item.definition   = data.definition;
     }
     ObjectFactory.MarkAsChild(item);
     ObjectFactory.MarkOld(item);
     return(item);
 }
コード例 #14
0
        /// <summary>
        /// obriši item
        /// nije brisanje već postavljanje Deleted polja na true
        /// </summary>
        /// <param name="item">instanca entity objekta</param>
        /// <returns></returns>
        public bool Delete(sysdiagrams item)
        {
            bool uspjelo = false;

            using (KaFotkaEntities data = new KaFotkaEntities())
            {
                item.Deleted = true;
                data.Entry <sysdiagrams>(item).State = System.Data.EntityState.Modified;
                data.SaveChanges();

                uspjelo = true;
            }

            return(uspjelo);
        }
コード例 #15
0
        /// <summary>
        /// spremi item
        /// insert ako nema Id
        /// update ako ima Id
        /// </summary>
        /// <param name="item">instanca entity objekta</param>
        /// <returns></returns>
        public bool Save(sysdiagrams item)
        {
            bool uspjelo = false;

            using (Entities data = new Entities())
            {
                data.sysdiagrams.Add(item);
                //ako ima Id onda je update
                if (item.Id != null)
                {
                    data.Entry <sysdiagrams>(item).State = System.Data.EntityState.Modified;
                }

                data.SaveChanges();

                uspjelo = true;
            }

            return(uspjelo);
        }
コード例 #16
0
        public IHttpActionResult Patch([FromODataUri] int key, Delta <sysdiagrams> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            sysdiagrams sysdiagrams = db.sysdiagrams.Find(key);

            if (sysdiagrams == null)
            {
                return(NotFound());
            }

            patch.Patch(sysdiagrams);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!sysdiagramsExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(sysdiagrams));
        }
コード例 #17
0
        public IQueryable <sysdiagrams> GetList(List <string> searchKeys, sysdiagrams model, Dictionary <string, object> searchParams, int?pageIndex, int?rowCount)
        {
            var modelQuery = MwtsEntities.sysdiagramss.AsQueryable();

            if (searchKeys.Contains("name"))
            {
                modelQuery = modelQuery.Where(item => item.name == model.name);
            }
            if (searchKeys.Contains("principal_id"))
            {
                modelQuery = modelQuery.Where(item => item.principal_id == model.principal_id);
            }
            if (searchKeys.Contains("diagram_id"))
            {
                modelQuery = modelQuery.Where(item => item.diagram_id == model.diagram_id);
            }
            if (searchKeys.Contains("version"))
            {
                modelQuery = modelQuery.Where(item => item.version == model.version);
            }
            if (searchKeys.Contains("definition"))
            {
                modelQuery = modelQuery.Where(item => item.definition == model.definition);
            }
            if (pageIndex != null && rowCount != null)
            {
                int skip = ((int)pageIndex - 1) * (int)rowCount;
                int take = (int)rowCount;
                modelQuery = modelQuery.OrderBy(item => item.diagram_id).Skip(skip > 0?skip:0).Take(take);
            }
            if (searchParams.Count > 0)
            {
                //扩展查询条件
            }
            return(modelQuery);
        }
コード例 #18
0
 public sysdiagrams SelectByKey(sysdiagrams entity)
 {
     object[] parameters = new object[] { entity.diagram_id };
     return(Context.Database.SqlQuery <sysdiagrams>("dbo.usp_sysdiagramsSelect @diagram_id={0}", parameters).FirstOrDefault());
 }
コード例 #19
0
 public void UpdateSysdiagrams(sysdiagrams currentsysdiagrams)
 {
     this.ObjectContext.sysdiagrams.AttachAsModified(currentsysdiagrams, this.ChangeSet.GetOriginal(currentsysdiagrams));
 }
コード例 #20
0
 public bool Delete(sysdiagrams entity)
 {
     object[] parameters = new object[] { entity.diagram_id };
     return(Context.Database.ExecuteSqlCommand("dbo.usp_sysdiagramsDelete @diagram_id={0}", parameters) == -1 ? true : false);
 }
コード例 #21
0
 /// <summary>
 /// There are no comments for sysdiagrams in the schema.
 /// </summary>
 public void AddTosysdiagrams(sysdiagrams sysdiagrams)
 {
     base.AddObject("sysdiagrams", sysdiagrams);
 }
コード例 #22
0
 /// <summary>
 /// Create a new sysdiagrams object.
 /// </summary>
 /// <param name="name">Initial value of name.</param>
 /// <param name="principal_id">Initial value of principal_id.</param>
 /// <param name="diagram_id">Initial value of diagram_id.</param>
 public static sysdiagrams Createsysdiagrams(string name, int principal_id, int diagram_id)
 {
     sysdiagrams sysdiagrams = new sysdiagrams();
     sysdiagrams.name = name;
     sysdiagrams.principal_id = principal_id;
     sysdiagrams.diagram_id = diagram_id;
     return sysdiagrams;
 }
コード例 #23
0
 public void MarkAsModified(sysdiagrams item)
 {
 }
コード例 #24
0
 public IQueryable <sysdiagrams> GetList(List <string> searchKeys, sysdiagrams model, Dictionary <string, object> searchParams)
 {
     return(GetList(searchKeys, model, searchParams, null, null));
 }
コード例 #25
0
 /// <summary>
 /// There are no comments for sysdiagrams in the schema.
 /// </summary>
 public void AddTosysdiagrams(sysdiagrams sysdiagrams)
 {
     base.AddObject("sysdiagrams", sysdiagrams);
 }
コード例 #26
0
 partial void Deletesysdiagrams(sysdiagrams instance);
コード例 #27
0
 partial void Updatesysdiagrams(sysdiagrams instance);
コード例 #28
0
 partial void Insertsysdiagrams(sysdiagrams instance);
コード例 #29
0
 public void Add(sysdiagrams model)
 {
     MwtsEntities.sysdiagramss.AddObject(model);
     Save();
 }
コード例 #30
0
 public sysdiagrams Insert(sysdiagrams entity)
 {
     object[] parameters = new object[] { entity.name, entity.principal_id, entity.version, entity.definition };
     return(Context.Database.SqlQuery <sysdiagrams>("dbo.usp_sysdiagramsInsert @name={0}, @principal_id={1}, @version={2}, @definition={3}", parameters).FirstOrDefault());
 }