protected void Page_Load(object sender, EventArgs e) { HttpCookie ck = Request.Cookies["MaGDV"]; if (ck == null) { Response.Redirect("~/Pages/Login.aspx"); } else { lblThongBao.Text = ""; txtNgayDang.Text = DateTime.Today.ToString(); if (Session["IDQUITRINH"] != null) { ma = int.Parse(Session["IDQUITRINH"].ToString()); if (ma > 0) { qtdto = qtdao.Lay(ma); txtNgayDang.Text = qtdto.NgayDang.ToString(); txtTieuDe.Text = qtdto.TieuDe.ToString(); txtTomTat.Text = qtdto.TomTat.ToString(); ckNoiDung.Text = qtdto.NoiDung.ToString(); } } } }
public bool CapNhat(QuiTrinhDTO qt) { string sql= "sp_QuiTrinh_CapNhat"; List<SqlParameter> ds = new List<SqlParameter>(); SqlParameter tieude = new SqlParameter("@tieude", SqlDbType.NVarChar); tieude.Value = qt.TieuDe; ds.Add(tieude); SqlParameter tomtat = new SqlParameter("@tomtat", SqlDbType.NVarChar); tomtat.Value = qt.TomTat; ds.Add(tomtat); SqlParameter noidung = new SqlParameter("@noidung", SqlDbType.NVarChar); noidung.Value = qt.NoiDung; ds.Add(noidung); SqlParameter magdv = new SqlParameter("@nguoipost", SqlDbType.Int); magdv.Value = qt.MaNguoiDang; ds.Add(magdv); SqlParameter maquitrinh = new SqlParameter("@maquitrinh", SqlDbType.Int); maquitrinh.Value = qt.MaQuiTrinh; ds.Add(maquitrinh); return SqlDataAcessHelper.exNonStoreParas(sql,ds); }
public bool CapNhat(QuiTrinhDTO qt) { string sql = "sp_QuiTrinh_CapNhat"; List <SqlParameter> ds = new List <SqlParameter>(); SqlParameter tieude = new SqlParameter("@tieude", SqlDbType.NVarChar); tieude.Value = qt.TieuDe; ds.Add(tieude); SqlParameter tomtat = new SqlParameter("@tomtat", SqlDbType.NVarChar); tomtat.Value = qt.TomTat; ds.Add(tomtat); SqlParameter noidung = new SqlParameter("@noidung", SqlDbType.NVarChar); noidung.Value = qt.NoiDung; ds.Add(noidung); SqlParameter magdv = new SqlParameter("@nguoipost", SqlDbType.Int); magdv.Value = qt.MaNguoiDang; ds.Add(magdv); SqlParameter maquitrinh = new SqlParameter("@maquitrinh", SqlDbType.Int); maquitrinh.Value = qt.MaQuiTrinh; ds.Add(maquitrinh); return(SqlDataAcessHelper.exNonStoreParas(sql, ds)); }
public bool ThemMoi(QuiTrinhDTO qt) { string sql = "sp_QuiTrinh_Them"; List <SqlParameter> ds = new List <SqlParameter>(); SqlParameter tieude = new SqlParameter("@tieude", SqlDbType.NVarChar); tieude.Value = qt.TieuDe; ds.Add(tieude); SqlParameter tomtat = new SqlParameter("@tomtat", SqlDbType.NVarChar); tomtat.Value = qt.TomTat; ds.Add(tomtat); SqlParameter noidung = new SqlParameter("@noidung", SqlDbType.NVarChar); noidung.Value = qt.NoiDung; ds.Add(noidung); SqlParameter magdv = new SqlParameter("@nguoipost", SqlDbType.NVarChar); magdv.Value = qt.MaNguoiDang; ds.Add(magdv); SqlParameter ngaydang = new SqlParameter("@ngaydang", SqlDbType.DateTime); ngaydang.Value = qt.NgayDang; ds.Add(ngaydang); return(SqlDataAcessHelper.exNonStoreParas(sql, ds)); }
protected void btnUpdate_Click(object sender, EventArgs e) { if (this.IsPostBack) { qtdto = new QuiTrinhDTO(); qtdto.TieuDe = txtTieuDe.Text; qtdto.TomTat = txtTomTat.Text; qtdto.NoiDung = ckNoiDung.Text; qtdto.MaQuiTrinh = int.Parse(lblID.Text); qtdto.MaNguoiDang = int.Parse(Request.Cookies["MaGDV"].Value); bool up = qtdao.CapNhat(qtdto); if (up == true) Response.Redirect("~/Manage/QuanLyMeMo.aspx"); } }
protected void btnUpdate_Click(object sender, EventArgs e) { if (this.IsPostBack) { qtdto = new QuiTrinhDTO(); qtdto.TieuDe = txtTieuDe.Text; qtdto.TomTat = txtTomTat.Text; qtdto.NoiDung = ckNoiDung.Text; qtdto.MaQuiTrinh = int.Parse(lblID.Text); qtdto.MaNguoiDang = int.Parse(Request.Cookies["MaGDV"].Value); bool up = qtdao.CapNhat(qtdto); if (up == true) { Response.Redirect("~/Manage/QuanLyMeMo.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { HttpCookie ck = Request.Cookies["MaGDV"]; if (ck == null) Response.Redirect("~/Pages/Login.aspx"); else if (Session["IDQT"] != null) { int id = int.Parse(Session["IDQT"].ToString()); qtdto = qtdao.Lay(id); txtTieuDe.Text = qtdto.TieuDe; txtTomTat.Text = qtdto.TomTat; ckNoiDung.Text = qtdto.NoiDung; lblID.Text = id.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { HttpCookie ck = Request.Cookies["MaGDV"]; if (ck == null) { Response.Redirect("~/Pages/Login.aspx"); } else if (Session["IDQT"] != null) { int id = int.Parse(Session["IDQT"].ToString()); qtdto = qtdao.Lay(id); txtTieuDe.Text = qtdto.TieuDe; txtTomTat.Text = qtdto.TomTat; ckNoiDung.Text = qtdto.NoiDung; lblID.Text = id.ToString(); } } }
public QuiTrinhDTO Lay(int ma) { QuiTrinhDTO qt = new QuiTrinhDTO(); DataTable dt = new DataTable(); string sql= "sp_QuiTrinh_Lay"; List<SqlParameter> ds= new List<SqlParameter>(); SqlParameter idqt = new SqlParameter("@maquitrinh", SqlDbType.Int); idqt.Value = ma; ds.Add(idqt); dt = SqlDataAcessHelper.exStoreParas(sql,ds); if (dt.Rows.Count == 1) { DataRow dr = dt.Rows[0]; qt.MaQuiTrinh = ma; qt.TieuDe = dr[0].ToString(); qt.TomTat = dr[1].ToString(); qt.NoiDung = dr[2].ToString(); } return qt; }
public QuiTrinhDTO Lay(int ma) { QuiTrinhDTO qt = new QuiTrinhDTO(); DataTable dt = new DataTable(); string sql = "sp_QuiTrinh_Lay"; List <SqlParameter> ds = new List <SqlParameter>(); SqlParameter idqt = new SqlParameter("@maquitrinh", SqlDbType.Int); idqt.Value = ma; ds.Add(idqt); dt = SqlDataAcessHelper.exStoreParas(sql, ds); if (dt.Rows.Count == 1) { DataRow dr = dt.Rows[0]; qt.MaQuiTrinh = ma; qt.TieuDe = dr[0].ToString(); qt.TomTat = dr[1].ToString(); qt.NoiDung = dr[2].ToString(); } return(qt); }
protected void Page_Load(object sender, EventArgs e) { HttpCookie ck = Request.Cookies["MaGDV"]; if (ck == null) Response.Redirect("~/Pages/Login.aspx"); else { lblThongBao.Text = ""; txtNgayDang.Text = DateTime.Today.ToString(); if (Session["IDQUITRINH"] != null) { ma = int.Parse(Session["IDQUITRINH"].ToString()); if (ma > 0) { qtdto = qtdao.Lay(ma); txtNgayDang.Text = qtdto.NgayDang.ToString(); txtTieuDe.Text = qtdto.TieuDe.ToString(); txtTomTat.Text = qtdto.TomTat.ToString(); ckNoiDung.Text = qtdto.NoiDung.ToString(); } } } }
public bool ThemMoi(QuiTrinhDTO qt) { string sql="sp_QuiTrinh_Them"; List<SqlParameter> ds = new List<SqlParameter>(); SqlParameter tieude = new SqlParameter("@tieude", SqlDbType.NVarChar); tieude.Value = qt.TieuDe; ds.Add(tieude); SqlParameter tomtat = new SqlParameter("@tomtat", SqlDbType.NVarChar); tomtat.Value = qt.TomTat; ds.Add(tomtat); SqlParameter noidung = new SqlParameter("@noidung", SqlDbType.NVarChar); noidung.Value = qt.NoiDung; ds.Add(noidung); SqlParameter magdv = new SqlParameter("@nguoipost", SqlDbType.NVarChar); magdv.Value = qt.MaNguoiDang; ds.Add(magdv); SqlParameter ngaydang = new SqlParameter("@ngaydang",SqlDbType.DateTime); ngaydang.Value = qt.NgayDang; ds.Add(ngaydang); return SqlDataAcessHelper.exNonStoreParas(sql,ds); }