Пример #1
0
    private void bindRowOne()
    {
        int totalBooks     = 0;
        int totalVitistors = 0;

        DateHG   cal = new DateHG();
        DateTime?startDate;
        DateTime?endDate;

        if (!string.IsNullOrEmpty(popupDatepicker.Value))
        {
            startDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepicker.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        }
        else
        {
            startDate = null;
        }
        if (!string.IsNullOrEmpty(popupDatepickerEnd.Value))
        {
            endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        }
        else
        {
            endDate = null;
        }

        var q = new StatisticsReportForReferenceServicesDataContext().BooksReceivedStat(startDate, endDate).ToArray <BooksReceivedStatResult>();

        foreach (var item in q)
        {
            lblNoCopies.Text = string.IsNullOrEmpty(item.Count_Copies.ToString()) ? "0" : item.Count_Copies.ToString();
            lblNoTitles.Text = string.IsNullOrEmpty(item.Count_Titles.ToString()) ? "0" : item.Count_Titles.ToString();
        }
    }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                DateHG   cal = new DateHG();
                DateTime?startDate;
                DateTime?endDate;

                if (popupDatepicker.Value != null && !string.IsNullOrEmpty(popupDatepicker.Value.ToString()))
                {
                    startDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepicker.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
                }
                else
                {
                    startDate = null;
                }
                if (popupDatepickerEnd.Value != null && !string.IsNullOrEmpty(popupDatepickerEnd.Value.ToString()))
                {
                    endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
                }
                else
                {
                    endDate = null;
                }


                dlUsers.DataSource = new VisitorsDataContext().VistorTacking(null, endDate, startDate).ToList <VistorTackingResult>();
                dlUsers.DataBind();
            }
            catch (Exception ex)
            {
                Helper.LogError(ex);
                Response.Redirect("/Visitors/Error.aspx");
            }
        }
Пример #3
0
    private int?edit()
    {
        int?     result    = null;
        int      gender    = 1;
        DateHG   cal       = new DateHG();
        DateTime startDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepicker.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //DateTime? endDate;
        //if (!string.IsNullOrEmpty(popupDatepickerEnd.Value))
        //{
        //     endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //}else
        //{
        //    endDate = null;
        //}

        int?numOfbooks = ToNullableInt(txtNoOfBooks.Value.ToString());
        int?numOfPages = ToNullableInt(txtNoOfPages.Value.ToString());

        if (hfGender.Value.Equals("1"))
        {
            gender = 1;
        }
        else
        {
            gender = 0;
        }
        new StatisticsReportForReferenceServicesDataContext().PhotocopyEdit(int.Parse(Request["num"].ToString()), userID, int.Parse(hfVistorID.Value.ToString()), hfName.Value.ToString(), numOfPages, startDate, numOfbooks, gender, hfMobile.Value.ToString(), ref result);
        return(result);
    }
Пример #4
0
    private int?[] insert()
    {
        int?result = null;
        int?itemID = null;

        DateHG   cal       = new DateHG();
        DateTime startDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepicker.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //DateTime? endDate;
        //if (!string.IsNullOrEmpty(popupDatepickerEnd.Value))
        //{
        //    endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //}
        //else
        //{
        //    endDate = null;
        //}
        int?numOfbooks = ToNullableInt(txtNoOfBooks.Value.ToString());
        int?numOfPages = ToNullableInt(txtNoOfPages.Value.ToString());


        var q = new StatisticsReportForReferenceServicesDataContext().PhotocopyAdd(userID, int.Parse(hfVistorID.Value.ToString()),
                                                                                   hfName.Value.ToString(), numOfPages, startDate, numOfbooks, int.Parse(hfGender.Value.ToString()),
                                                                                   hfMobile.Value.ToString(),
                                                                                   ref result).Single <PhotocopyAddResult>();

        int?[] arr = { result, q.ID };
        return(arr);
    }
Пример #5
0
    private int?edit()
    {
        int?     result    = null;
        int      gender    = 1;
        DateHG   cal       = new DateHG();
        DateTime startDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepicker.Value.ToString())),
                                                 "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //DateTime? endDate;
        //if (!string.IsNullOrEmpty(popupDatepickerEnd.Value))
        //{
        //     endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //}else
        //{
        //    endDate = null;
        //}

        int?numOfReindex   = ToNullableInt(txtReindex.Value.ToString());
        int?numOfRebinding = ToNullableInt(txtBinding.Value.ToString());
        int?numOfLabel     = ToNullableInt(txtRelabel.Value.ToString());
        int?numOfExclude   = ToNullableInt(txtExclude.Value.ToString());


        new StatisticsReportForReferenceServicesDataContext().SortingAndOrgnizeEdit(
            int.Parse(Request["num"].ToString()), userID,
            startDate, numOfReindex, numOfLabel, numOfRebinding, numOfExclude, ref result);
        return(result);
    }
Пример #6
0
    private int?[] insert()
    {
        int?     result    = null;
        DateHG   cal       = new DateHG();
        DateTime startDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepicker.Value.ToString())),
                                                 "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //DateTime? endDate;
        //if (!string.IsNullOrEmpty(popupDatepickerEnd.Value))
        //{
        //    endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //}
        //else
        //{
        //    endDate = null;
        //}
        int?numOfReindex   = ToNullableInt(txtReindex.Value.ToString());
        int?numOfRebinding = ToNullableInt(txtBinding.Value.ToString());
        int?numOfLabel     = ToNullableInt(txtRelabel.Value.ToString());
        int?numOfExclude   = ToNullableInt(txtExclude.Value.ToString());


        var q = new StatisticsReportForReferenceServicesDataContext().SortingAndOrgnizeAdd(
            userID, startDate,
            numOfReindex, numOfLabel, numOfRebinding,
            numOfExclude,
            ref result).Single <SortingAndOrgnizeAddResult>();

        int?[] arr = { result, q.ID };
        return(arr);
    }
Пример #7
0
    private int?edit()
    {
        int?     result    = null;
        int      gender    = 1;
        DateHG   cal       = new DateHG();
        DateTime startDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepicker.Value.ToString())),
                                                 "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //DateTime? endDate;
        //if (!string.IsNullOrEmpty(popupDatepickerEnd.Value))
        //{
        //     endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //}else
        //{
        //    endDate = null;
        //}

        int?numOfCopies = ToNullableInt(txtCopies.Value.ToString());
        int?numOfTitles = ToNullableInt(txtTitles.Value.ToString());


        new StatisticsReportForReferenceServicesDataContext().BooksReceivedEdit(
            int.Parse(Request["num"].ToString()), userID,
            startDate, numOfCopies, numOfCopies, ref result);
        return(result);
    }
Пример #8
0
    private int?[] insert()
    {
        int?     result    = null;
        DateHG   cal       = new DateHG();
        DateTime startDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepicker.Value.ToString())),
                                                 "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //DateTime? endDate;
        //if (!string.IsNullOrEmpty(popupDatepickerEnd.Value))
        //{
        //    endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //}
        //else
        //{
        //    endDate = null;
        //}
        int?numOfCopies = ToNullableInt(txtCopies.Value.ToString());
        int?numOfTitles = ToNullableInt(txtTitles.Value.ToString());



        var q = new StatisticsReportForReferenceServicesDataContext().BooksReceivedAdd(
            userID, startDate,
            numOfCopies, numOfTitles, ref result).Single <BooksReceivedAddResult>();

        int?[] arr = { result, q.ID };
        return(arr);
    }
    private void bindRowOne()
    {
        int totalBooks     = 0;
        int totalVitistors = 0;

        DateHG   cal = new DateHG();
        DateTime?startDate;
        DateTime?endDate;

        if (!string.IsNullOrEmpty(popupDatepicker.Value))
        {
            startDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepicker.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        }
        else
        {
            startDate = null;
        }
        if (!string.IsNullOrEmpty(popupDatepickerEnd.Value))
        {
            endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        }
        else
        {
            endDate = null;
        }

        var q = new StatisticsReportForReferenceServicesDataContext().GeneralCollectionStat(startDate, endDate, null).ToArray <GeneralCollectionStatResult>();

        if (!string.IsNullOrEmpty(ddlCounter.SelectedValue.ToString()))
        {
            q = new StatisticsReportForReferenceServicesDataContext().GeneralCollectionStat(startDate, endDate, int.Parse(ddlCounter.SelectedValue.ToString())).ToArray <GeneralCollectionStatResult>();
        }
        foreach (var item in q)
        {
            lblTotalBooks.Text    = string.IsNullOrEmpty(item.Count_Books.ToString())?"0": item.Count_Books.ToString();
            lblTotalVisitors.Text = string.IsNullOrEmpty(item.Count_Visitors.ToString())?"0": item.Count_Visitors.ToString();
        }
    }
Пример #10
0
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         DateHG   cal = new DateHG();
         DateTime?startDate;
         if (!string.IsNullOrEmpty(popupDatepicker.Value))
         {
             startDate          = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepicker.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat);
             dlUsers.DataSource = new VisitorsDataContext().GetDaysTransctions(startDate, startDate.Value.AddDays(1));// week after  selected date
             dlUsers.DataBind();
         }
     }
     catch (Exception ex)
     {
         Helper.LogError(ex);
         Response.Redirect("/Visitors/Error.aspx");
     }
 }
Пример #11
0
    private int?[] Insert()
    {
        int?result = null;
        int?itemID = null;

        DateHG   cal       = new DateHG();
        DateTime startDate = DateTime.ParseExact(cal.HijriToGreg(InvertDate(popupDatepicker.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //DateTime? endDate;
        //if (!string.IsNullOrEmpty(popupDatepickerEnd.Value))
        //{
        //    endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //}
        //else
        //{
        //    endDate = null;
        //}
        int?numberOfItems = ToNullableInt(txtNumberOfItems.Value.ToString());
        int?numberOfPages = ToNullableInt(txtNumberOfPages.Value.ToString());



        new StatisticsReportForReferenceServicesDataContext().ItemsAdd(userID, int.Parse(hfVistorID.Value.ToString()),
                                                                       hfName.Value.ToString(), int.Parse(hfGender.Value.ToString()),
                                                                       startDate, null,
                                                                       int.Parse(rblPreiod.SelectedValue.ToString()),
                                                                       int.Parse(rblMethod.SelectedValue.ToString()),
                                                                       int.Parse(rblLang.SelectedValue.ToString()),
                                                                       int.Parse(rblSearchType.SelectedValue.ToString()),
                                                                       int.Parse(rblDegree.SelectedValue.ToString()),
                                                                       hfMobile.Value.ToString(),
                                                                       ckItemType.Items[0].Selected,
                                                                       ckItemType.Items[1].Selected,
                                                                       ckItemType.Items[2].Selected,
                                                                       ckItemType.Items[3].Selected,
                                                                       ckItemType.Items[4].Selected,
                                                                       ckItemType.Items[5].Selected,
                                                                       numberOfItems,
                                                                       numberOfPages,
                                                                       ref result, ref itemID);
        int?[] arr = { result, itemID };
        return(arr);
    }
Пример #12
0
    private int?Edit()
    {
        int?     result    = null;
        int      gender    = 1;
        DateHG   cal       = new DateHG();
        DateTime startDate = DateTime.ParseExact(cal.HijriToGreg(InvertDate(popupDatepicker.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //DateTime? endDate;
        //if (!string.IsNullOrEmpty(popupDatepickerEnd.Value))
        //{
        //     endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        //}else
        //{
        //    endDate = null;
        //}
        int?numberOfItems = ToNullableInt(txtNumberOfItems.Value.ToString());
        int?numberOfPages = ToNullableInt(txtNumberOfPages.Value.ToString());

        if (lblGender.Text.Equals("ذكر"))
        {
            gender = 1;
        }
        else
        {
            gender = 0;
        }
        new StatisticsReportForReferenceServicesDataContext().ItemsEdit(int.Parse(Request["num"].ToString()), int.Parse(hfVistorID.Value.ToString()), txtUserName.Value.ToString(), gender, startDate, null, int.Parse(rblPreiod.SelectedValue.ToString()), int.Parse(rblMethod.SelectedValue.ToString()), int.Parse(rblLang.SelectedValue.ToString()), int.Parse(rblSearchType.SelectedValue.ToString()), int.Parse(rblDegree.SelectedValue.ToString()), txtMobile.Value.ToString(),
                                                                        ckItemType.Items[0].Selected,
                                                                        ckItemType.Items[1].Selected,
                                                                        ckItemType.Items[2].Selected,
                                                                        ckItemType.Items[3].Selected,
                                                                        ckItemType.Items[4].Selected,
                                                                        ckItemType.Items[5].Selected,
                                                                        numberOfItems,
                                                                        numberOfPages, ref result);
        return(result);
    }
Пример #13
0
    private void bindData()
    {
        var qu = new StatisticsReportForReferenceServicesDataContext().UsersSearch(userID).Single();

        DateHG   cal = new DateHG();
        DateTime?startDate;
        DateTime?endDate;

        if (!string.IsNullOrEmpty(popupDatepicker.Value))
        {
            startDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepicker.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        }
        else
        {
            startDate = null;
        }
        if (!string.IsNullOrEmpty(popupDatepickerEnd.Value))
        {
            endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        }
        else
        {
            endDate = null;
        }

        bool isAdmin    = false;
        var  userGroups = new StatisticsReportForReferenceServicesDataContext().GetGroupsByUserID(userID).ToList();

        foreach (var item in userGroups)
        {
            if (item.Group_ID == (int)Helper.GroupsEnum.Admin || item.Group_ID == (int)Helper.GroupsEnum.ItemsAdmin)
            {
                isAdmin = true;
                break;
            }
        }
        if (isAdmin)
        {
            var q = new StatisticsReportForReferenceServicesDataContext().ItemsSearchWithUsers(null, null, txtCustomerName.Text.Trim(), null, startDate, endDate, null, null, null, txtUserName.Text.Trim(), null, null, null, null, null, null, null, null, null, null).ToList <ItemsSearchWithUsersResult>();;
            if (!string.IsNullOrEmpty(ddlDepartment.SelectedValue.ToString()))
            {
                q = new StatisticsReportForReferenceServicesDataContext().ItemsSearchWithUsers(null, null, txtCustomerName.Text.Trim(), null, startDate, endDate, null, null, null, txtUserName.Text.Trim(), int.Parse(ddlDepartment.SelectedValue.ToString()), null, null, null, null, null, null, null, null, null).ToList <ItemsSearchWithUsersResult>();
            }

            divNotifi.Visible = true;
            divNotifi.Attributes.Add("class", "alert alert-block alert-success fade in");
            lblDivNotifiTitle.Text   = "تم !";
            pDivNotifiDesc.InnerText = " مجموع العناصر التي تم العثور عليها  " + q.Count;

            dlItems.DataSource = q;
            dlItems.DataBind();
        }
        else
        {
            divUserName.Visible = false;
            divpopupDatepicker.Attributes.Add("class", "span4");
            divpopupDatepickerEnd.Attributes.Add("class", "span4");
            divCustomerName.Attributes.Add("class", "span4");


            var q = new StatisticsReportForReferenceServicesDataContext().ItemsSearchWithUsers(null, userID, txtCustomerName.Text.Trim(), null, startDate, endDate, null, null, null, txtUserName.Text.Trim(), null, null, null, null, null, null, null, null, null, null).ToList <ItemsSearchWithUsersResult>();
            dlItems.DataSource = q;
            dlItems.DataBind();
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["UserWebsiteId"] == null)
            {
                Response.Redirect("~/Login.aspx?page=" + Request.RawUrl);
            }

            if (!IsPostBack)
            {
                var q = new VisitorsDataContext().UsersSearch(Request.Cookies["UserWebsiteId"].Value.ToString()).ToList <UsersSearchResult>();
                foreach (var item in q)
                {
                    if (item.UserRole.Equals("admin"))
                    {
                        //liItemsAdd.Visible = true;
                        //liItemsSearch.Visible = true;
                        //liUsersManagement.Visible = true;
                        //liStatistics.Visible = true;
                    }
                    else if (item.UserRole.Equals("user"))
                    {
                        //liItemsAdd.Visible = true;
                        //liItemsSearch.Visible = true;
                        //liUsersManagement.Visible = false;
                        //liStatistics.Visible = false;
                    }
                    if (Request.RawUrl.Contains("Statistics.aspx") || Request.RawUrl.Contains("UsersManagement.aspx"))
                    {
                        if (item.UserRole.Equals("user"))
                        {
                            Response.Redirect("~/Default.aspx?page=" + Request.RawUrl);
                        }
                    }
                }

                DateHG   cal = new DateHG();
                DateTime?startDate;
                try
                {
                    if (!string.IsNullOrEmpty(Request["date"].ToString()))
                    {
                        lbldate.Text       = Request["date"].ToString();
                        startDate          = DateTime.ParseExact(cal.HijriToGreg(invertDate(Request["date"].ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
                        dlUsers.DataSource = new VisitorsDataContext().GetDaysTransctions(startDate, startDate.Value.AddDays(30));// week after selected date
                        dlUsers.DataBind();
                    }
                    else
                    {
                        Response.Redirect("VistorsWeeklyReport.aspx");
                    }
                }
                catch (NullReferenceException)
                {
                    Response.Redirect("VistorsWeeklyReport.aspx");
                }
                catch (Exception ex)
                {
                    Helper.LogError(ex);
                    Response.Redirect("/Visitors/Error.aspx");
                }
            }
        }
Пример #15
0
    private void bindRowOne()
    {
        int      total      = 0;
        int      male       = 0;
        int      female     = 0;
        int      ar         = 0;
        int      eng        = 0;
        int      monawla    = 0;
        int      mail       = 0;
        int      email      = 0;
        int      phone      = 0;
        int      fax        = 0;
        int      am         = 0;
        int      pm         = 0;
        int      index      = 0;
        int      infoDb     = 0;
        int      Phd        = 0;
        int      master     = 0;
        int      Bac        = 0;
        int      Othor      = 0;
        int      book       = 0;
        int      article    = 0;
        int      thesis     = 0;
        int      document   = 0;
        int      image      = 0;
        int      manuscript = 0;
        int      numOfItems = 0;
        int      numOfPages = 0;
        DateHG   cal        = new DateHG();
        DateTime?startDate;
        DateTime?endDate;

        if (!string.IsNullOrEmpty(popupDatepicker.Value))
        {
            startDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepicker.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        }
        else
        {
            startDate = null;
        }
        if (!string.IsNullOrEmpty(popupDatepickerEnd.Value))
        {
            endDate = DateTime.ParseExact(cal.HijriToGreg(invertDate(popupDatepickerEnd.Value.ToString())), "yyyy/MM/dd", cal.enCul.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);
        }
        else
        {
            endDate = null;
        }

        var q = new StatisticsReportForReferenceServicesDataContext().StatisticsSearch(startDate, endDate, txtUserName.Text.Trim(), 1, null).ToArray <StatisticsSearchResult>();

        if (!string.IsNullOrEmpty(ddlDepartment.SelectedValue.ToString()))
        {
            q = new StatisticsReportForReferenceServicesDataContext().StatisticsSearch(startDate, endDate, txtUserName.Text.Trim(), 1, int.Parse(ddlDepartment.SelectedValue.ToString())).ToArray <StatisticsSearchResult>();
        }
        foreach (var item in q)
        {
            total++;
            if (item.Send_Method == 0)
            {
                monawla++;
            }
            else if (item.Send_Method == 1)
            {
                mail++;
            }
            else if (item.Send_Method == 2)
            {
                email++;
            }
            else if (item.Send_Method == 3)
            {
                fax++;
            }
            else if (item.Send_Method == 4)
            {
                phone++;
            }
            if (item.Period == 0)
            {
                am++;
            }
            else if (item.Period == 1)
            {
                pm++;
            }

            if (item.Language == 0)
            {
                ar++;
            }
            else if (item.Language == 1)
            {
                eng++;
            }
            if (item.Customer_Gender == 0)
            {
                female++;
            }
            else if (item.Customer_Gender == 1)
            {
                male++;
            }
            if (item.Search_Type == 0)
            {
                index++;
            }
            else if (item.Search_Type == 1)
            {
                infoDb++;
            }

            if (item.Degree == 0)
            {
                Phd++;
            }
            else if (item.Degree == 1)
            {
                master++;
            }
            else if (item.Degree == 2)
            {
                Bac++;
            }
            else if (item.Degree == 3)
            {
                Othor++;
            }

            if (item.IsBook)
            {
                book++;
            }
            if (item.IsArticle)
            {
                article++;
            }
            if (item.IsThesis)
            {
                thesis++;
            }
            if (item.IsDocument)
            {
                document++;
            }
            if (item.IsImage)
            {
                image++;
            }
            if (item.IsManuscript)
            {
                manuscript++;
            }
            int tempNumOfPages = int.TryParse(item.NumOfPages.ToString(), out tempNumOfPages) ? tempNumOfPages : 0;
            int tempNumOfItems = int.TryParse(item.NumOfItems.ToString(), out tempNumOfItems) ? tempNumOfItems : 0;
            numOfPages += tempNumOfPages;
            numOfItems += tempNumOfItems;
        }
        lblTotal.Text       = total.ToString();
        lblAr.Text          = ar.ToString();
        lblEng.Text         = eng.ToString();
        lblMonawla.Text     = monawla.ToString();
        lblMail.Text        = mail.ToString();
        lblEmail.Text       = email.ToString();
        lblFax.Text         = fax.ToString();
        lblPhone.Text       = phone.ToString();
        lblAM.Text          = am.ToString();
        lblPM.Text          = pm.ToString();
        lblIndex.Text       = index.ToString();
        lblInfoDB.Text      = infoDb.ToString();
        lblPhd.Text         = Phd.ToString();
        lblmaster.Text      = master.ToString();
        lblBac.Text         = Bac.ToString();
        lblOthor.Text       = Othor.ToString();
        lblBooks.Text       = book.ToString();
        lblArticle.Text     = article.ToString();
        lblThesis.Text      = thesis.ToString();
        lblDocuments.Text   = document.ToString();
        lblImages.Text      = image.ToString();
        lblManuscripts.Text = manuscript.ToString();
        lblNumOfPages.Text  = numOfPages.ToString();
        lblNumOfItems.Text  = numOfItems.ToString();
    }