private void GetData() { StatisticsReportForReferenceServicesDataContext srfs = new StatisticsReportForReferenceServicesDataContext(); var qu = srfs.UsersSearch(userID).Single <UsersSearchResult>(); DateHG cal = new DateHG(); if (qu.User_Role.Equals("admin")) { var q = srfs.GeneralCollectionSearch(int.Parse(Request["num"].ToString()), null, null, null, null, null, null, null).Single <GeneralCollectionSearchResult>(); txtUserName.Value = q.Vistor_Name.ToString(); txtMobile.Value = q.MobileNo.ToString(); ddlCounter.SelectedValue = q.Counter_ID.ToString(); txtUserCode.Value = q.Vistor_ID.ToString(); txtNoOfBooks.Value = q.NoBooks.ToString(); //rblGender.SelectedValue = q.Customer_Gender.ToString(); if (q.Gender == 1) { lblGender.Text = "ذكر"; hfGender.Value = "1"; } else { lblGender.Text = "انثى"; hfGender.Value = "0"; } txtSearch.Value = q.Vistor_ID.ToString(); popupDatepicker.Value = cal.GregToHijri(q.Receive_Date.ToString()); //popupDatepickerEnd.Value = cal.GregToHijri(q.Finsh_date.ToString()); hfVistorID.Value = q.Vistor_ID.ToString(); hfName.Value = q.Vistor_Name; hfMobile.Value = q.MobileNo; } else { var q = srfs.GeneralCollectionSearchWithUsers(int.Parse(Request["num"].ToString()), userID, null, null, null, null, null, null).Single <GeneralCollectionSearchWithUsersResult>(); txtUserName.Value = q.Vistor_Name.ToString(); txtMobile.Value = q.MobileNo.ToString(); ddlCounter.SelectedValue = q.Counter_ID.ToString(); txtUserCode.Value = q.Vistor_ID.ToString(); txtNoOfBooks.Value = q.NoBooks.ToString(); if (q.Gender == 1) { lblGender.Text = "ذكر"; } else { lblGender.Text = "انثى"; } //rblGender.SelectedValue = q.Customer_Gender.ToString(); popupDatepicker.Value = cal.GregToHijri(q.Receive_Date.ToString()); //popupDatepickerEnd.Value = cal.GregToHijri(q.Finsh_date.ToString()); hfName.Value = q.Vistor_Name; hfMobile.Value = q.MobileNo; } }
private void GetData() { StatisticsReportForReferenceServicesDataContext srfs = new StatisticsReportForReferenceServicesDataContext(); var qu = srfs.UsersSearch(userID).Single <UsersSearchResult>(); DateHG cal = new DateHG(); if (qu.User_Role.Equals("admin")) { var q = srfs.BooksReceivedSerach(int.Parse(Request["num"].ToString()), null, null) .Single <BooksReceivedSerachResult>(); popupDatepicker.Value = new DateHG().GregToHijri(q.Receive_Date.ToString()); txtTitles.Value = q.NoTitle.ToString(); txtCopies.Value = q.NoCopy.ToString(); //rblGender.SelectedValue = q.Customer_Gender.ToString(); // popupDatepicker.Value = cal.GregToHijri(q.Receive_Date.ToString()); //popupDatepickerEnd.Value = cal.GregToHijri(q.Finsh_date.ToString()); } else { var q = srfs .BooksReceivedSerachWithusers(int.Parse(Request["num"].ToString()), userID, null) .Single <BooksReceivedSerachWithusersResult>(); txtTitles.Value = q.NoTitle.ToString(); txtCopies.Value = q.NoCopy.ToString(); popupDatepicker.Value = cal.GregToHijri(q.Receive_Date.ToString()); } }
protected void dlUsers_ItemDataBound(object sender, DataListItemEventArgs e) { Label lblDate = (Label)e.Item.FindControl("lblDate"); DateTime date = DateTime.Parse(lblDate.Text); String day = string.Empty; switch (date.DayOfWeek.ToString()) { case "Sunday": day = "الأحد"; break; case "Monday": day = "الإثنين"; break; case "Tuesday": day = "الثلاثاء"; break; case "Wednesday": day = "الإربعاء"; break; case "Thursday": day = "الخميس"; break; case "Friday": day = "الجمعة"; break; case "Saturday": day = "السبت"; break; } DateHG cal = new DateHG(); lblDate.Text = cal.GregToHijri(date.ToString()) + " " + day; }
private void GetData() { StatisticsReportForReferenceServicesDataContext srfs = new StatisticsReportForReferenceServicesDataContext(); var qu = srfs.UsersSearch(userID).Single <UsersSearchResult>(); DateHG cal = new DateHG(); if (qu.User_Role.Equals("admin")) { var q = srfs.SortingAndOrgnizeSearch(int.Parse(Request["num"].ToString()), null, null) .Single <SortingAndOrgnizeSearchResult>(); popupDatepicker.Value = new DateHG().GregToHijri(q.Receive_Date.ToString()); txtBinding.Value = q.NoBinding.ToString(); txtExclude.Value = q.NoExclude.ToString(); txtReindex.Value = q.NoReindex.ToString(); txtRelabel.Value = q.NoRelabel.ToString(); //rblGender.SelectedValue = q.Customer_Gender.ToString(); // popupDatepicker.Value = cal.GregToHijri(q.Receive_Date.ToString()); //popupDatepickerEnd.Value = cal.GregToHijri(q.Finsh_date.ToString()); } else { var q = srfs .SortingAndOrgnizeSearchWithUsers(int.Parse(Request["num"].ToString()), userID, null) .Single <SortingAndOrgnizeSearchWithUsersResult>(); txtBinding.Value = q.NoBinding.ToString(); txtExclude.Value = q.NoExclude.ToString(); txtReindex.Value = q.NoReindex.ToString(); txtRelabel.Value = q.NoRelabel.ToString(); popupDatepicker.Value = cal.GregToHijri(q.Receive_Date.ToString()); } }
protected void dlUsers_ItemDataBound(object sender, ListViewItemEventArgs e) { DateHG cal = new DateHG(); string startDate; if (DataBinder.Eval(e.Item.DataItem, "Receive_Date") != null) { startDate = cal.GregToHijri(DataBinder.Eval(e.Item.DataItem, "Receive_Date").ToString()); } else { startDate = ""; } string endDate; if (DataBinder.Eval(e.Item.DataItem, "Finsh_date") != null) { endDate = cal.GregToHijri(DataBinder.Eval(e.Item.DataItem, "Finsh_date").ToString()); } else { endDate = ""; } ((Label)e.Item.FindControl("lblReceiveDate")).Text = startDate; ((Label)e.Item.FindControl("lblFinshDate")).Text = endDate; int Degree = int.Parse(DataBinder.Eval(e.Item.DataItem, "Degree").ToString()); if (Degree == 0) { ((Label)e.Item.FindControl("lblDegree")).Text = "دكتوراه"; } else if (Degree == 1) { ((Label)e.Item.FindControl("lblDegree")).Text = "ماجستير"; } else if (Degree == 2) { ((Label)e.Item.FindControl("lblDegree")).Text = "جامعي"; } else if (Degree == 3) { ((Label)e.Item.FindControl("lblDegree")).Text = "اخرى"; } int Send_Method = int.Parse(DataBinder.Eval(e.Item.DataItem, "Send_Method").ToString()); if (Send_Method == 0) { ((Label)e.Item.FindControl("lblSendMethod")).Text = "مناولة"; } else if (Send_Method == 1) { ((Label)e.Item.FindControl("lblSendMethod")).Text = "بريد"; } else if (Send_Method == 2) { ((Label)e.Item.FindControl("lblSendMethod")).Text = "بريد الكتروني"; } else if (Send_Method == 3) { ((Label)e.Item.FindControl("lblSendMethod")).Text = "خدمة ذاتية"; } else if (Send_Method == 4) { ((Label)e.Item.FindControl("lblSendMethod")).Text = "هاتف"; } int Period = int.Parse(DataBinder.Eval(e.Item.DataItem, "Period").ToString()); if (Period == 0) { ((Label)e.Item.FindControl("lblPeriod")).Text = "الصباحية"; } else if (Period == 1) { ((Label)e.Item.FindControl("lblPeriod")).Text = "المسائية"; } int Language = int.Parse(DataBinder.Eval(e.Item.DataItem, "Language").ToString()); if (Language == 0) { ((Label)e.Item.FindControl("lblLanguage")).Text = "عربي"; } else if (Language == 1) { ((Label)e.Item.FindControl("lblLanguage")).Text = "انجليزي"; } int Gender = int.Parse(DataBinder.Eval(e.Item.DataItem, "Customer_Gender").ToString()); if (Gender == 0) { ((Label)e.Item.FindControl("lblCustomerGender")).Text = "انثي"; } else if (Gender == 1) { ((Label)e.Item.FindControl("lblCustomerGender")).Text = "ذكر"; } int SearchType = int.Parse(DataBinder.Eval(e.Item.DataItem, "Search_Type").ToString()); if (SearchType == 0) { ((Label)e.Item.FindControl("lblSearchType")).Text = "الفهرس"; } else if (SearchType == 1) { ((Label)e.Item.FindControl("lblSearchType")).Text = "مصادر المعلومات"; } }
protected void dlUsers_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType != ListItemType.Footer) { //start filling footer data _totalPer1 += int.Parse(DataBinder.Eval(e.Item.DataItem, "per1").ToString()); _totalPer2 += int.Parse(DataBinder.Eval(e.Item.DataItem, "per2").ToString()); _totalPer3 += int.Parse(DataBinder.Eval(e.Item.DataItem, "per3").ToString()); _totalPer4 += int.Parse(DataBinder.Eval(e.Item.DataItem, "per4").ToString()); _totalPer5 += int.Parse(DataBinder.Eval(e.Item.DataItem, "per5").ToString()); _totalPer6 += int.Parse(DataBinder.Eval(e.Item.DataItem, "per6").ToString()); _totalPer7 += int.Parse(DataBinder.Eval(e.Item.DataItem, "per7").ToString()); _totalPer8 += int.Parse(DataBinder.Eval(e.Item.DataItem, "per8").ToString()); _totalPer9 += int.Parse(DataBinder.Eval(e.Item.DataItem, "per9").ToString()); _totalPer10 += int.Parse(DataBinder.Eval(e.Item.DataItem, "per10").ToString()); _totalPer11 += int.Parse(DataBinder.Eval(e.Item.DataItem, "per11").ToString()); _sumTotal += int.Parse(DataBinder.Eval(e.Item.DataItem, "Total").ToString()); _sumMale += int.Parse(DataBinder.Eval(e.Item.DataItem, "Male").ToString()); _sumFemale += int.Parse(DataBinder.Eval(e.Item.DataItem, "Female").ToString()); //end filling footer data Label lblDate = (Label)e.Item.FindControl("lblDate"); DateTime date = DateTime.Parse(lblDate.Text); String day = string.Empty; switch (date.DayOfWeek.ToString()) { case "Sunday": day = "الأحد"; break; case "Monday": day = "الإثنين"; break; case "Tuesday": day = "الثلاثاء"; break; case "Wednesday": day = "الإربعاء"; break; case "Thursday": day = "الخميس"; break; case "Friday": day = "الجمعة"; break; case "Saturday": day = "السبت"; break; } DateHG cal = new DateHG(); lblDate.Text = cal.GregToHijri(date.ToString()) + " " + day; } else { ((Label)e.Item.FindControl("lblTotalPer1")).Text = _totalPer1.ToString(); ((Label)e.Item.FindControl("lblTotalPer2")).Text = _totalPer2.ToString(); ((Label)e.Item.FindControl("lblTotalPer3")).Text = _totalPer3.ToString(); ((Label)e.Item.FindControl("lblTotalPer4")).Text = _totalPer4.ToString(); ((Label)e.Item.FindControl("lblTotalPer5")).Text = _totalPer5.ToString(); ((Label)e.Item.FindControl("lblTotalPer6")).Text = _totalPer6.ToString(); ((Label)e.Item.FindControl("lblTotalPer7")).Text = _totalPer7.ToString(); ((Label)e.Item.FindControl("lblTotalPer8")).Text = _totalPer8.ToString(); ((Label)e.Item.FindControl("lblTotalPer9")).Text = _totalPer9.ToString(); ((Label)e.Item.FindControl("lblTotalPer10")).Text = _totalPer10.ToString(); ((Label)e.Item.FindControl("lblTotalPer11")).Text = _totalPer11.ToString(); ((Label)e.Item.FindControl("lblSumTotal")).Text = _sumTotal.ToString(); ((Label)e.Item.FindControl("lblSumMale")).Text = _sumMale.ToString(); ((Label)e.Item.FindControl("lblSumFemale")).Text = _sumFemale.ToString(); } }
private void GetData() { StatisticsReportForReferenceServicesDataContext srfs = new StatisticsReportForReferenceServicesDataContext(); var qu = srfs.UsersSearch(userID).Single <UsersSearchResult>(); DateHG cal = new DateHG(); 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 = srfs.ItemsSearchWithUsers(int.Parse(Request["num"].ToString()), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null).Single <ItemsSearchWithUsersResult>(); txtUserName.Value = q.Customer_Name.ToString(); txtMobile.Value = q.Mobile.ToString(); rblDegree.SelectedValue = q.Degree.ToString(); //rblGender.SelectedValue = q.Customer_Gender.ToString(); if (q.Customer_Gender == 1) { lblGender.Text = "ذكر"; } else { lblGender.Text = "انثى"; } txtSearch.Value = q.Vistor_ID.ToString(); rblLang.SelectedValue = q.Language.ToString(); rblMethod.SelectedValue = q.Send_Method.ToString(); rblPreiod.SelectedValue = q.Period.ToString(); rblSearchType.SelectedValue = q.Search_Type.ToString(); popupDatepicker.Value = cal.GregToHijri(q.Receive_Date.ToString()); //popupDatepickerEnd.Value = cal.GregToHijri(q.Finsh_date.ToString()); hfVistorID.Value = q.Vistor_ID.ToString(); txtNumberOfItems.Value = q.NumOfItems.ToString(); txtNumberOfPages.Value = q.NumOfPages.ToString(); ckItemType.Items[0].Selected = q.IsBook; ckItemType.Items[1].Selected = q.IsArticle; ckItemType.Items[2].Selected = q.IsThesis; ckItemType.Items[3].Selected = q.IsDocument; ckItemType.Items[4].Selected = q.IsImage; ckItemType.Items[5].Selected = q.IsManuscript; } else { var q = srfs.ItemsSearchWithUsers(int.Parse(Request["num"].ToString()), userID, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null).Single <ItemsSearchWithUsersResult>(); txtUserName.Value = q.Customer_Name.ToString(); txtMobile.Value = q.Mobile.ToString(); rblDegree.SelectedValue = q.Degree.ToString(); if (q.Customer_Gender == 1) { lblGender.Text = "ذكر"; } else { lblGender.Text = "انثى"; } //rblGender.SelectedValue = q.Customer_Gender.ToString(); rblLang.SelectedValue = q.Language.ToString(); rblMethod.SelectedValue = q.Send_Method.ToString(); rblPreiod.SelectedValue = q.Period.ToString(); rblSearchType.SelectedValue = q.Search_Type.ToString(); popupDatepicker.Value = cal.GregToHijri(q.Receive_Date.ToString()); //popupDatepickerEnd.Value = cal.GregToHijri(q.Finsh_date.ToString()); txtNumberOfItems.Value = q.NumOfItems.ToString(); txtNumberOfPages.Value = q.NumOfPages.ToString(); ckItemType.Items[0].Selected = q.IsBook; ckItemType.Items[1].Selected = q.IsArticle; ckItemType.Items[2].Selected = q.IsThesis; ckItemType.Items[3].Selected = q.IsDocument; ckItemType.Items[4].Selected = q.IsImage; ckItemType.Items[5].Selected = q.IsManuscript; } }