using System; using System.Collections; using System.Configuration; using System.Data; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; public partial class Activity_Search : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //string xadmin = Session["dawa"].ToString(); //if (xadmin == "True") //{ // grdtbl0.DataBind(); //} //else // Response.Redirect("Home.aspx"); } protected void btnreturn_Click(object sender, EventArgs e) { try { string xadmin = Session["admin"].ToString(); if (xadmin == "True") { grdtbl0.DataBind(); } else { SDtbl0.SelectCommand = "SELECT Sum(Act_Design) AS Act_Design,Sum(Act_Montag) AS Act_Montag,Sum(Act_Prepair) AS Act_Prepair,Sum(Act_Cat) "+ "AS Act_Cat,Sum(Act_Review) AS Act_Review,Sum(Act_Search) AS Act_Search,Sum(Act_Edit) AS Act_Edit,Sum(Act_Write) AS Act_Write,"+ "Sum(Act_Select) AS Act_Select,Sum(Act_other) AS Act_other, Le_Month ,Sum(Act_Meeting) AS Act_Meeting,Sum(Act_Visitor) AS Act_Visitor FROM tbl_Activity GROUP BY Le_Year, Le_Month, Le_User" + " HAVING (Le_Year = @year)and (Le_User=@User) ORDER BY Le_Month " + " "; SDtbl0.SelectParameters.Add("User", Session["User"].ToString()); SDtbl0.SelectParameters["year"].DefaultValue = txtYear.Text; grdtbl0.DataBind(); } } catch (Exception ex) { Response.Write(ex.ToString()); ; throw; } } protected void grdDocs_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { //------------------ Have Document or Not --------------------- String Month = (String)e.Row.Cells[0].Text; if ((Month == "01") ||(Month == "1")) e.Row.Cells[0].Text = "محرم"; else if ((Month == "02") || (Month == "2")) e.Row.Cells[0].Text = "صفر"; else if ((Month == "03") || (Month == "3")) e.Row.Cells[0].Text = "ربيع الأول"; else if ((Month == "04") || (Month == "4")) e.Row.Cells[0].Text = "ربيع الأخر"; else if ((Month == "05") || (Month == "5")) e.Row.Cells[0].Text = "جمادي الأول"; else if ((Month == "06") || (Month == "6")) e.Row.Cells[0].Text = "جمادي الأخر"; else if ((Month == "07") || (Month == "7")) e.Row.Cells[0].Text = "رجـــب"; else if ((Month == "08") || (Month == "8")) e.Row.Cells[0].Text = "شعبــان"; else if ((Month == "09") || (Month == "9")) e.Row.Cells[0].Text = "رمضــان"; else if (Month == "10") e.Row.Cells[0].Text = "شـــوال"; else if (Month == "11") e.Row.Cells[0].Text = "ذو القعدة"; else if (Month == "12") e.Row.Cells[0].Text = "ذو الحجة"; else e.Row.Cells[0].Text = "لم نتمكن من القراءة"; } } }