예제 #1
0
        public static bool Delete(KhachHangGroup data)
        {
            try
            {
                if (data != null)
                {
                    dbContext.KhachHangGroups.DeleteOnSubmit(data);
                    dbContext.SubmitChanges();
                    return true;
                }

                return false;
            }
            catch
            {
                //log
            }

            NewConnection();
            return false;
        }
예제 #2
0
 private static bool Insert(KhachHangGroup data)
 {
     try
     {
         dbContext.KhachHangGroups.InsertOnSubmit(data);
         dbContext.SubmitChanges();
         return true;
     }
     catch
     {
         return false;
     }
 }
예제 #3
0
        public static bool Update(KhachHangGroup data)
        {
            try
            {
                if (data != null)
                {
                    dbContext.SubmitChanges();
                    return true;
                }

                return false;
            }
            catch
            {
                return false;
            }
        }
예제 #4
0
        /// <summary>
        /// Insert new data
        /// </summary>
        /// <param name="ten"></param>
        /// <param name="ghiChu"></param>
        /// <returns>Return id of the new data if success</returns>
        public static int? Insert(string ten, string ghiChu = "")
        {
            int? res = null;

            try
            {
                KhachHangGroup data = new KhachHangGroup();
                data.Ten = ten;
                data.GhiChu = ghiChu;

                if (Insert(data))
                {
                    res = data.Id;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return res;
        }
예제 #5
0
 partial void DeleteKhachHangGroup(KhachHangGroup instance);
예제 #6
0
 partial void UpdateKhachHangGroup(KhachHangGroup instance);
예제 #7
0
 partial void InsertKhachHangGroup(KhachHangGroup instance);