/// <summary> /// Lấy danh sách theo dõi truyện /// Author : HoangNM - 22/04/2019 - create /// </summary> /// <returns>Danh sách theo dõi truyện của tài khoản. Exception nếu có lỗi</returns> public TheoDoi GetTheoDoiTruyen() { try { TheoDoi listBookMark = new TheoDoi(); int Id_TaiKhoan = Common.Common.GetAccount().Id; listBookMark.Id_TaiKhoan = Id_TaiKhoan; listBookMark.ListBookmark = context.TheoDoiTruyens.Where(x => x.Id_NguoiDoc == Id_TaiKhoan && !x.DelFlag) .Select(x => new BookMark { Id_BookMark = x.Id, Id_Truyen = x.Id_Truyen, TenTruyen = x.Truyen.TenTruyen, Id_NhomDich = x.Truyen.Id_Nhom, TenNhom = x.Truyen.NhomDich.TenNhomDich, Id_ChuongDanhDau = x.Id_ChuongDanhDau, TenChuongDanhDau = x.Truyen.Chuongs.FirstOrDefault(y => y.Id == x.Id_ChuongDanhDau).TenChuong, Id_ChuongMoiNhat = x.Truyen.Chuongs.OrderByDescending(y => y.Id).FirstOrDefault().Id, TenChuongMoiNhat = x.Truyen.Chuongs.OrderByDescending(y => y.Id).FirstOrDefault().TenChuong }).OrderBy(x => x.Id_BookMark).ToList(); return(listBookMark); } catch (Exception e) { throw e; } }
public static int UpdateTheoDoi(TheoDoi theoDoi) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@" + config.THEO_DOI_MANV, theoDoi.MaNV), new SqlParameter("@" + config.THEO_DOI_MATD, theoDoi.MaTD), new SqlParameter("@" + config.THEO_DOI_THOI_GIAN, theoDoi.NgayThang), new SqlParameter("@" + config.THEO_DOI_SU_KIEN, theoDoi.SuKien) }; return(DataProvider.ExecuteNonQuery(config.PROC_UPDATE_THEO_DOI, para)); }
protected void Page_Load(object sender, EventArgs e) { var ChieuCao = Request["ChieuCao"]; var CanNang = Request["CanNang"]; var P_ID = Request["P_ID"]; var NgayGhi = Request["NgayGhi"]; var LOAI_ID = Request["LOAI_ID"]; var LOAISUB_ID = Request["LOAISUB_ID"]; var ID = Request["ID"]; switch (subAct) { case "update": #region add if(!string.IsNullOrEmpty(ID)) { Item = TheoDoiDal.SelectById(new Guid(ID)); if (!string.IsNullOrEmpty(ChieuCao)) { Item.ChieuCao = Convert.ToInt32(ChieuCao); } if (!string.IsNullOrEmpty(CanNang)) { Item.CanNang = Convert.ToInt32(CanNang); } if (!string.IsNullOrEmpty(NgayGhi)) { Item.NgayGhi = Convert.ToDateTime(NgayGhi, new CultureInfo("vi-Vn")); } Item = TheoDoiDal.Update(Item); TheoDoiView1.Item = Item; TheoDoiView1.Visible = true; } break; #endregion case "get": #region get if (!string.IsNullOrEmpty(ID)) { EditTheoDoi1.Item = TheoDoiDal.SelectById(new Guid(ID)); EditTheoDoi1.Visible = true; } break; #endregion default: break; } }
public void UpdateTheoDoi() { TheoDoi theoDoi = GetDataFromFRM(); theoDoi.MaTD = maTDCurrent; int result = Bus.UpdateTheoDoi(theoDoi); if (result >= 0) { MessageBox.Show("Update thành công", "Thông báo", MessageBoxButtons.OK); LoadData(); isAction = false; } else { MessageBox.Show("Update không thành công", "Thông báo", MessageBoxButtons.OK); } }
public static int UpdateTheoDoi(TheoDoi theoDoi) { return(Dao.UpdateTheoDoi(theoDoi)); }
public static int InsertTheoDoi(TheoDoi theoDoi) { return(Dao.InsertTheoDoi(theoDoi)); }