예제 #1
0
 public SysDMPublicModel(SysDMPublic SysDMPublic)
 {
     this.TypeId = SysDMPublic.TypeId;
     this.Code = SysDMPublic.Code;
     this.Name = SysDMPublic.Name;
     if (SysDMPublic.IsLock == 1)
     {
         this.bLock = true;
     }
     else this.bLock = false;
     this.IsLock = SysDMPublic.IsLock;
     this.Description = SysDMPublic.Description;
 }
예제 #2
0
        public SysDMPublic toSysDMPublic()
        {
            SysDMPublic result = new SysDMPublic();
            result.TypeId = string.IsNullOrEmpty(this.TypeId.ToString()) ? Int32.Parse(Guid.NewGuid().ToString()) : this.TypeId;
            result.Code = this.Code;
            result.Name = this.Name;
            if (this.bLock == true) {
                result.IsLock = 1;
            }
            else
            {
                result.IsLock = 0;
            }

            result.Description = this.Description;
            return result;
        }
예제 #3
0
 /// <summary>
 /// Thêm mơi SysDMPublic vào database
 /// </summary>
 /// <param name="SysDMPublic"></param>
 /// <returns></returns>
 /// <modify>
 /// Author  date    comment
 /// Anhhn   10/6/15 create
 /// </modify>
 public int Add(SysDMPublic SysDMPublic)
 {
     db.SysDMPublics.Add(SysDMPublic);
     return db.SaveChanges();
 }
예제 #4
0
 /// <summary>
 /// Cập nhập SysDMPublic vào database
 /// </summary>
 /// <param name="SysDMPublic"></param>
 /// <returns></returns>
 /// <modify>
 /// Author  date    comment
 /// Anhhn   10/6/15 create
 /// </modify>
 public int Update(SysDMPublic SysDMPublic)
 {
     db.Entry(SysDMPublic).State = EntityState.Modified;
     return db.SaveChanges();
 }