protected int LayTuanMoiNhat(string donvi) { string abc = ""; int nam = System.DateTime.Now.Year; BaoCao_Tuan.ServiceQuanLyMatDien ob = new ServiceQuanLyMatDien(); DataSet ds = ob.get_BAOCAO_TUAN(nam, 0, donvi, ref abc); int result = Convert.ToInt32(ds.Tables[0].Rows[0]["Max_Tuan"].ToString()); return result; }
protected void LayThongTinTuanMoiNhat(int tuan) { string abc = ""; string donvi = "LAYTUAN"; int namht = System.DateTime.Now.Year; BaoCao_Tuan.ServiceQuanLyMatDien ob = new ServiceQuanLyMatDien(); DataSet ds = ob.get_BAOCAO_TUAN(namht, tuan, donvi, ref abc); string maxtuan = ds.Tables[0].Rows[0]["MA_TUAN"].ToString(); string nam = ds.Tables[0].Rows[0]["NAM"].ToString(); DateTime tungay = Convert.ToDateTime(ds.Tables[0].Rows[0]["TU_NGAY"].ToString()); DateTime denngay = Convert.ToDateTime(ds.Tables[0].Rows[0]["DEN_NGAY"].ToString()); Label8.Text = "Tuần " + maxtuan + "/" + nam + " (Từ ngày " + tungay.ToString("dd/MM/yyyy") + " đến ngày " + denngay.ToString("dd/MM/yyyy") + ")"; }
protected void BindDuLieu(int tuan, string donvi) { try { string abc = ""; int namht = System.DateTime.Now.Year; BaoCao_Tuan.ServiceQuanLyMatDien ob = new ServiceQuanLyMatDien(); DataSet ds = ob.get_BAOCAO_TUAN(namht, tuan, donvi, ref abc); gvLichCatDien.DataSource = ds; gvLichCatDien.DataBind(); int count = gvLichCatDien.Rows.Count; //Merge Cell Ngày cắt for (int i = 1; i < count; i++) { if (gvLichCatDien.Rows[i].Cells[0].Text.Equals(gvLichCatDien.Rows[i - 1].Cells[0].Text) == true) { string abc1 = gvLichCatDien.Rows[i - 1].Cells[0].Text; for (int j = i; j < count; j++) { if (gvLichCatDien.Rows[j].Cells[0].Text.Equals(abc1)) { gvLichCatDien.Rows[j].Cells[0].Text = ""; gvLichCatDien.Rows[j].Cells[0].Style["border-top"] = "none"; gvLichCatDien.Rows[j - 1].Cells[0].Style["border-bottom"] = "none"; } } } } } catch (Exception ex) { lbMessage.Text = ex.Message; } }