protected void showData()
 {
     try
     {
         mobileClass mob = new mobileClass();
         DataSet ds = mob.fillData(ddDonVi.SelectedValue, "EXEC mobile_LichTuan2 " + ddTuan.SelectedValue);
         DataView dv = ds.Tables[1].DefaultView;
         dlNgayThang.DataSource = ds.Tables[0];
         dlNgayThang.DataBind();
         string cmdTxt;
         foreach (DataListItem li in dlNgayThang.Items)
         {
             cmdTxt = string.Format("NgayThang = '{0}'", ((Label)li.FindControl("lbNgayThang")).Text);
             dv.RowFilter = cmdTxt;
             DataList myDL = (DataList)li.FindControl("dlNoiDung");
             myDL.DataSource = dv;
             myDL.DataBind();
         }
     }
     catch
     {
         dlNgayThang.DataSource = null;
         dlNgayThang.DataBind();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack) return;
     try
     {
         mobileClass ob=new mobileClass();
         DataSet ds = ob.fillData("EOFFICE_ICT", "EXEC Mobile.CV_GetCV 47");
         dlCongVan.DataSource = ds.Tables[0];
         dlCongVan.DataBind();
     }
     catch { }
 }
 public void showData()
 {
     try
     {
         mobileClass mob = new mobileClass();
         dataLichTuan.DataSource = mob.fillData(ddDonVi.SelectedValue, "EXEC mobile_getLichTuan " + ddTuan.SelectedValue);
         dataLichTuan.DataBind();
     }
     catch
     {
         dataLichTuan.DataSource = null;
         dataLichTuan.DataBind();
     }
 }
 protected void showData()
 {
     string year, month, day;
     if (Request["yy"] != null) year = Request["yy"];
     else year = DateTime.Today.Year.ToString();
     if (Request["mm"] != null) month = Request["mm"];
     else month = DateTime.Today.Month.ToString();
     if (Request["dd"] != null) day = Request["dd"];
     else day = "32";
     try
     {
         mobileClass mob = new mobileClass();
         DataSet ds = mob.fillDataset(string.Format("EXEC mobile_getCV_CongVan {0}, {1}, {2}, {3}", UserId, year, month, day));
         DataColumn dc = new DataColumn("fileName");
         ds.Tables[0].Columns.Add(dc);
         dc = new DataColumn("fileLink");
         ds.Tables[0].Columns.Add(dc);
         dc = new DataColumn("bpPhongBan");
         ds.Tables[0].Columns.Add(dc);
         DataSet dsTemp;
         ds.Tables[0].AcceptChanges();
         foreach (DataRow dr in ds.Tables[0].Rows)
         {
             dr.BeginEdit();
             try
             {
                 dsTemp = mob.fillDataset(string.Format("EXEC mobile_getCV_Shared {0}, {1}, {2}", UserId, dr[0], dr[1]));
                 dr["fileName"] = dsTemp.Tables[0].Rows[0][2].ToString();
                 dr["fileLink"] = string.Format("{0}?ID={1}&CV={2}", ResolveUrl("viewfile.aspx"), dsTemp.Tables[0].Rows[0][0], dsTemp.Tables[0].Rows[0][1]);
                 dr["bpPhongBan"] = dsTemp.Tables[1].Rows[0][0].ToString();
             }
             catch { }
             if (dr["ButPheLD"].ToString() != "") dr["ButPheLD"] = "<img src='/ICT/images/icon_hostusers_16px.gif' /> " + dr["ButPheLD"];
             if (dr["bpPhongBan"].ToString() != "") dr["bpPhongBan"] = "<img src='/ICT/images/edit.gif' /> " + dr["bpPhongBan"];
             if (dr["TenNoiTHChinh"].ToString() != "") dr["TenNoiTHChinh"] = "<img src='/ICT/images/icon_solutions_16px.gif' /> " + dr["TenNoiTHChinh"];
             dr.EndEdit();
         }
         dataCongVan.DataSource = ds;
         dataCongVan.DataBind();
     }
     catch
     {
         dataCongVan.DataSource = null;
         dataCongVan.DataBind();
     }
 }
Exemplo n.º 5
0
 protected void bindData()
 {
     mobileClass mob = new mobileClass();
     DataSet ds = mob.fillData("EOFFICE_ICT", "EXEC mobile_getCV_CapSo 47");
     HtmlGenericControl divYear = new HtmlGenericControl("div");
     HtmlGenericControl divMonth = new HtmlGenericControl("div");
     HtmlGenericControl divTemp = new HtmlGenericControl("div");
     string newMonth = "", htmMonth = "";
     foreach (DataRow dr in ds.Tables[0].Rows)
     {
         if (dr[1].ToString() == "13")
         {
             if (newMonth != "")
             {
                 divMonth.InnerHtml += string.Format("<ul data-role=\"listview\">{0}</ul>", htmMonth);
                 divTemp.Controls.Add(divMonth);
             }
             // Tạo năm mới
             divYear = newDIV(dr[0].ToString());
             placeHolder.Controls.Add(divYear);
             divTemp = newDIV("");
             divYear.Controls.Add(divTemp);
         }
         else
         {
             if (dr[2].ToString() == "32")
             {
                 if (newMonth != "")
                 {
                     divMonth.InnerHtml += string.Format("<ul data-role=\"listview\">{0}</ul>", htmMonth);
                     divTemp.Controls.Add(divMonth);
                 }
                 // Tạo tháng mới
                 divMonth = newDIV(dr[1].ToString());
                 htmMonth = "";
                 newMonth = dr[1].ToString();
             }
             else
             {
                 htmMonth += string.Format("<li><a href=\"{0}\">{1}</a></li>", dr[3], dr[2]);
             }
         }
     }
 }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack) return;
     if (Request["ID"] == null) return;
     if (Request["CV"] == null) return;
     try
     {
         mobileClass ob = new mobileClass();
         DataSet ds = ob.fillDataset(string.Format("EXEC mobile_getCV_Files {0}, {1}", Request["ID"], Request["CV"]));
         Response.Buffer = true;
         Response.Clear();
         Response.ClearHeaders();
         Response.ClearContent();
         if (Request.UserAgent.Contains("Android")) Response.AddHeader("content-disposition", "attachment; filename=" + ds.Tables[0].Rows[0]["FileName"].ToString());
         Response.ContentType = ds.Tables[0].Rows[0]["FileType"].ToString();
         Byte[] pdfData = (byte[])ds.Tables[0].Rows[0]["FileData"];
         Response.BinaryWrite(pdfData);
         Response.End();
     }
     catch (Exception ex) { Response.Write(ex.Message); }
 }