Exemplo n.º 1
0
		private void detach_tblInformatics(tblInformatic entity)
		{
			this.SendPropertyChanging();
			entity.tblUser = null;
		}
Exemplo n.º 2
0
 partial void DeletetblInformatic(tblInformatic instance);
Exemplo n.º 3
0
 partial void UpdatetblInformatic(tblInformatic instance);
Exemplo n.º 4
0
 partial void InserttblInformatic(tblInformatic instance);
Exemplo n.º 5
0
        /// <summary>
        /// Cập nhật bài viết
        /// </summary>
        /// <param name="update"></param>
        /// <returns></returns>
        public static Boolean updateInformatic(int _id, tblInformatic update)
        {
            LTDHDataContext DB = new LTDHDataContext(@strPathDB);
            try
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    var informatic = DB.tblInformatics.Single(info => info.ID == _id);
                    informatic.Title = update.Title;
                    informatic.Type = update.Type;
                    informatic.Chapeau = update.Chapeau;
                    informatic.Contents = update.Contents;
                    informatic.Author = update.Author;
                    informatic.Posted = update.Posted;
                    informatic.State = update.State;
                    informatic.Point = update.Point;
                    informatic.Tag = update.Tag;

                    DB.SubmitChanges();
                    ts.Complete();
                }
            }
            catch (Exception e)
            {
                return false;
            }
            return true;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Thêm bài mới
        /// </summary>
        /// <param name="record"></param>
        /// <returns></returns>
        public static Boolean insertInformatic(tblInformatic record)
        {
            LTDHDataContext DB = new LTDHDataContext(@strPathDB);

            try
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    DB.tblInformatics.InsertOnSubmit(record);

                    DB.SubmitChanges();

                    ts.Complete();
                }
            }
            catch (Exception e)
            {
                return false;
            }
            return true;
        }