protected void Page_Load(object sender, EventArgs e) { CheckAccount(); App_Code.Base db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); _workers = db.GetWorkers(); _hollidaysType = db.GetWorkTypes(); if (!IsPostBack) { SaveOrClear.DataSource = _soc; SaveOrClear.DataBind(); SaveOrClear.SelectedIndex = 0; HollidaysType.DataSource = _hollidaysType; HollidaysType.DataBind(); HollidaysType.SelectedIndex = 0; Base.UserInfo ui = db.GetUserInfo(_workers[0].UserName); From.Text = ui.HourBeg.ToString(); To.Text = ui.HourEnd.ToString(); Lunch.Text = ui.Lunch.ToString(); DataTable data = db.GetWorkTime(); List <Data> ls = new List <Data>(); foreach (DataRow dr in data.Rows) { ls.Add(new Data() { Name = dr["Family"].ToString() + " " + dr["IO"].ToString(), From = dr["HourBeg"].ToString(), To = dr["HourEnd"].ToString(), Lunch = dr["Lunch"].ToString() }); } Graf.DataSource = ls; Graf.DataBind(); WorkerName.DataSource = _workers; WorkerName.DataBind(); WorkerName.SelectedIndex = 0; List <string> s = db.GetIdU(); IdU.DataSource = s; IdU.DataBind(); if (s.Count > 0) { IdU.SelectedIndex = 0; } IdU_SelectedIndexChanged(sender, e); //Beg.SelectedDate = DateTime.Now.Date; //End.SelectedDate = DateTime.Now.Date.AddMonths(1); Calendar1.SelectedDate = DateTime.Now.Date; Calendar2.SelectedDate = DateTime.Now.Date.AddMonths(1); Calendar3.SelectedDate = DateTime.Now.Date; DHStart.SelectedDate = DateTime.Now.Date; DHEnd.SelectedDate = DateTime.Now.Date.AddMonths(1); Base.PersonData pd = _workers.Find(delegate(Base.PersonData i) { return(i.Title == WorkerName.SelectedValue); }); List <Base.UserLift> ul = db.GetUserLift(pd.Id); AllList.DataSource = ul; AllList.DataBind(); } }
public void OkClient() { //Cleans up errors messages that may be left hanging around. ErrorCleanup(); //Check if all client entries are okay. if (CheckClientEntries()) { clientName = new ClientName { Name = NewClient.Name, Address = NewClient.Address, PhoneNumber = NewClient.PhoneNumber, FormattedPhone = string.Format("{0:(###) ###-####}", Convert.ToDouble(NewClient.PhoneNumber)), Email = NewClient.Email, }; AllList.Add(clientName); database.Insert(clientName); ClientList.Add(clientName); ItIsVisible = false; SearchBarVisible(); Navigation.PushAsync(new EditPage(clientName.Id, "client")); } }
void CreateList(int n) { for (int i = 0; i < n; i++) { Levels[i] = new AllList(); } }
void IBackend.Initialize(IPreferences preferences) { if (preferences == null) { throw new ArgumentNullException("preferences"); } database = new Database(); database.Open(); allList = new AllList(preferences); taskListRepo = new SqliteTaskListRepository(this, database); taskRepo = new SqliteTaskRepository(this, database); noteRepo = new SqliteNoteRepository(database); Factory = new TasqueObjectFactory( taskListRepo, taskRepo, noteRepo); IsInitialized = true; if (Initialized != null) { Initialized(this, EventArgs.Empty); } }
private void Search_OnDropDownClosed(object sender, RoutedPropertyChangedEventArgs <bool> e) { var autoCompleteBox = ((AutoCompleteBox)sender); var key = autoCompleteBox.Text; if (ViewModel.PackagesDictionary.TryGetValue(key, out var package)) { Dispatcher.Invoke(() => { ViewModel.SelectedPackage = package; if (package.PackageVersions.Count == 1) { ViewModel.SelectedPackageVersion = package.PackageVersions.Single(); } autoCompleteBox.Text = string.Empty; }); if (sender == Active) { ActiveList.ScrollIntoView(package); } else if (sender == All) { AllList.ScrollIntoView(package); } //else if (sender == AllCache) //{ // CacheList.ScrollIntoView(package); //} } }
protected void ShowAllConnections_Click(object sender, EventArgs e) { AllConnections.Visible = !AllConnections.Visible; if (AllConnections.Visible) { AllList.FindControl("SelectAll").Focus(); } }
private void FillData() { this.busyIndicator.IsRunning = true; selChapterId = NavigationContext.QueryString["chapterId"]; selChapterName = NavigationContext.QueryString["chapterName"]; selType = NavigationContext.QueryString["type"]; selEnName = NavigationContext.QueryString["enName"]; try { selVerseId = NavigationContext.QueryString["verseId"]; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Exception: " + ex.ToString()); selVerseId = "0"; } pageTitle.Text = selChapterId + ". " + selChapterName + " (" + selEnName + ") " + selType; transName.Text = AppSettings.TransNameSetting; App.ViewModel.LoadChapterRec(int.Parse(selChapterId)); Chapter chapter = App.ViewModel.ChapterRec; if ((Application.Current as App).db.GetVerseCount(int.Parse(AppSettings.TransSetting), chapter.chapter_id) < chapter.verse_count) { DownloadTranslations(int.Parse(AppSettings.TransSetting), chapter.chapter_id); } else { Dispatcher.BeginInvoke(() => { App.ViewModel.LoadVerses(int.Parse(selChapterId)); AllList.DataContext = App.ViewModel; AllList.ItemsSource = App.ViewModel.Verses; try { if (AllList.ItemCount > 0) { //object position = this.AllList.pagItems[Config.GPositionID]; //AllList.SelectedItem = selVerseId; AllList.BringIntoView(App.ViewModel.Verses.ElementAt(int.Parse(selVerseId) - 1)); //this.AllList.UpdateLayout(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Exception: " + ex.ToString()); //MessageBox.Show("Exception: " + ex.ToString()); } this.busyIndicator.IsRunning = false; }); } }
public PackageCacheControl() { InitializeComponent(); Messenger.Default.Register <IPackage>(this, SelectPackage); ActiveList.Loaded += (sender, args) => ActiveList.RegisterSort(nameof(IPackage.Name)); AllList.SortBy(nameof(IPackage.Name)); }
/// <summary> /// Handles the ListView event of the SelectedItem control. /// Navigates to the movie that was clicked on. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ItemClickEventArgs"/> instance containing the event data.</param> private async void SelectedItem_ListView(object sender, ItemClickEventArgs e) { //Getting the clicked item AllList clickedItem = e.ClickedItem as AllList; try { var param = clickedItem.ListId as int?; //Navigate to the selected list Frame.Navigate(typeof(MovieListPage), param); } catch { await new MessageDialog(clickedItem.ListName, "Could not open list").ShowAsync(); //Display message } }
void FinishInitialization() { allList = new AllList(preferences); TaskListRepo = new RtmTaskListRepository(this); taskRepo = new RtmTaskRepository(this); noteRepo = new RtmNoteRepository(this); Factory = new TasqueObjectFactory( TaskListRepo, taskRepo, noteRepo); IsInitialized = true; if (Initialized != null) { Initialized(null, null); } }
protected void IdM_SelectedIndexChanged(object sender, EventArgs e) { App_Code.Base db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); Base.PersonData pd = _workers.Find(delegate(Base.PersonData i) { return(i.Title == WorkerName.SelectedValue); }); List <Base.UserLift> data = db.GetUserLift(pd.UserName, IdU.SelectedValue, IdM.SelectedValue); IdL.DataSource = data; IdL.DataBind(); List <Base.UserLift> ul = db.GetUserLift(pd.Id); AllList.DataSource = ul; AllList.DataBind(); }
public void OkEstimate() { ErrorCleanup(); if (CheckEstimateEntry()) { clientName = new ClientName { EstimateName = NewClient.EstimateName }; AllList.Add(clientName); database.Insert(clientName); EstimateList.Add(clientName); ItIsVisible = false; Navigation.PushAsync(new EditPage(clientName.Id, "client")); } }
void FinishInitialization () { allList = new AllList (preferences); TaskListRepo = new RtmTaskListRepository (this); taskRepo = new RtmTaskRepository (this); noteRepo = new RtmNoteRepository (this); Factory = new TasqueObjectFactory ( TaskListRepo, taskRepo, noteRepo); IsInitialized = true; if (Initialized != null) Initialized (null, null); }
public AllList GetList_InstituteSubCourseDetails(int inst_id, int Subcourse_id, string Specialization) { try { using (SqlConnection con = new SqlConnection(ConnectionStringDheya)) { AllList list = new AllList(); List <InstituteDetails> li = new List <InstituteDetails>(); SqlCommand cmd = new SqlCommand("SP_InstituteSearchAndDetails", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Type", "InstituteSubCourseDTL"); cmd.Parameters.AddWithValue("@Career", ""); cmd.Parameters.AddWithValue("@Course", ""); cmd.Parameters.AddWithValue("@Inst", inst_id); cmd.Parameters.AddWithValue("@Subco", Subcourse_id); cmd.Parameters.AddWithValue("@specialization", Specialization); // con.Open(); // SqlDataReader dr = cmd.ExecuteReader(); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); if (ds.Tables[0].Rows.Count > 0) { InstituteDetails obj = new InstituteDetails(); obj.instname = ds.Tables[0].Rows[0]["inst_name"].ToString(); obj.catagory = ds.Tables[0].Rows[0]["category"].ToString(); obj.region = ds.Tables[0].Rows[0]["region"].ToString(); obj.state = ds.Tables[0].Rows[0]["state"].ToString(); obj.city = ds.Tables[0].Rows[0]["city"].ToString(); obj.website = ds.Tables[0].Rows[0]["website"].ToString(); obj.affil = ds.Tables[0].Rows[0]["Affiliation"].ToString(); obj.email = ds.Tables[0].Rows[0]["emailid"].ToString(); obj.contact = ds.Tables[0].Rows[0]["contact_no"].ToString(); obj.address = ds.Tables[0].Rows[0]["address"].ToString(); list.InstituteDetails.Add(obj); } if (ds.Tables[1].Rows.Count > 0) { SubcourseDetails obj = new SubcourseDetails(); obj.subconame = ds.Tables[1].Rows[0]["subco_name"].ToString(); obj.catagory = ds.Tables[1].Rows[0]["category"].ToString(); obj.stream = ds.Tables[1].Rows[0]["stream"].ToString(); obj.specialization = ds.Tables[1].Rows[0]["specialization"].ToString(); obj.duration = ds.Tables[1].Rows[0]["subco_duration"].ToString(); obj.req = ds.Tables[1].Rows[0]["basic_req"].ToString(); obj.descrip = ds.Tables[1].Rows[0]["descrip"].ToString(); obj.instreq = ds.Tables[1].Rows[0]["inst_req"].ToString(); obj.rank = ds.Tables[1].Rows[0]["rank"].ToString(); obj.indiatodayrank = ds.Tables[1].Rows[0]["indiatodayrank"].ToString(); obj.businesstodayrank = ds.Tables[1].Rows[0]["businesstodayrank"].ToString(); obj.hindustantimesrank = ds.Tables[1].Rows[0]["hindustantimesrank"].ToString(); obj.dheya_rank = ds.Tables[1].Rows[0]["dheya_rank"].ToString(); obj.entranceId = ds.Tables[1].Rows[0]["entrance_id"].ToString(); obj.entrancename = ds.Tables[1].Rows[0]["entrance_name"].ToString(); if (ds.Tables[2].Rows.Count > 0) { string OtherSpe = ""; for (int i = 0; i < ds.Tables[2].Rows.Count; i++) { OtherSpe += ds.Tables[2].Rows[i][0].ToString() + " , "; } OtherSpe.Substring(0, OtherSpe.LastIndexOf(',')); obj.OtherSpecialization = OtherSpe; //list.SubcourseDetails.Add(obj); } list.SubcourseDetails.Add(obj); } else { return(null); } return(list); } } catch (Exception ex) { Log.Error(ex); return(null); } }
/// <summary>Creates collection for all of the genres in the current list</summary> public async void GetAllLists() { //Getting the user owned lists ObservableCollection <AllList> userLists = await ListCalls.GetTokenOwnerLists(LoginPage.token); //Creating objects that contains the listId's AllList toWatchList = new AllList(); AllList watchedList = new AllList(); //Adding the listId's to the appropiat list object foreach (AllList n in userLists) { //Adding to ToWatch List object if (n.ListName == "ToWatch") { toWatchList.ListId = n.ListId; toWatchList.ListName = n.ListName; } //Adding to watched List object if (n.ListName == "Watched") { watchedList.ListId = n.ListId; watchedList.ListName = n.ListName; } } //Getting all the listItems from the ToWatch List ObservableCollection <AllListItems> allTowatchListObjects = await ListItemCalls.GetListItems(toWatchList.ListId); //Getting all the listItems from the ToWatch List ObservableCollection <AllListItems> allWatchedListObjects = await ListItemCalls.GetListItems(watchedList.ListId); //Getting All of the Movies allMovies = await MovieCalls.GetMovies(); //Creating lists for storing allMovie object for the toWatch and watched list ObservableCollection <Movie> allToWatchMovies = new ObservableCollection <Movie>(); ObservableCollection <Movie> allWatchedMovies = new ObservableCollection <Movie>(); //Comparing the All ListObjects movie id with tall movies (Intensive task that can be optimised) foreach (Movie m in allMovies) { //ToWatch foreach (AllListItems toWatchI in allTowatchListObjects) { //If the movie exists in the towatchlist add the Movie object to the new list //This is so that the Movie object that contains all of the information can be displayed in the UI if (m.MovieId == toWatchI.MovieId) { //Adding the movie to the new list allToWatchMovies.Add(m); } } //Watched foreach (AllListItems watched in allWatchedListObjects) { //See comments on the foreach loop above if (m.MovieId == watched.MovieId) { allWatchedMovies.Add(m); } } } //Creating reference to the stackPanel that should contain the list StackPanel stack_toWatch = Stack_listViews; StackPanel stack_Watched = Stack_Watched; //Creating the stack lists in the ToWatch Tab DynamicListViewCreator("All Genres", allToWatchMovies, stack_toWatch); //Creating the stack lists in the Watched Tab DynamicListViewCreator("All Genres", allWatchedMovies, Stack_Watched); //The new lists can now be used to create seperate lists for every genreId that exists in the Movie collection lists //Firstly we need all of the Genre objects that excist. //Then we can compare all existing genreId's with the ones that exist in the Watched and toWatch lists. ObservableCollection <Genre> allGenres = await GenreCalls.GetGenres(); //Looping through the allGenres list foreach (Genre existingGenres in allGenres) { //Creates a temporary list to store the movie that contain the current genre ObservableCollection <Movie> genreListWatched = new ObservableCollection <Movie>(); foreach (Movie allWatched in allWatchedMovies) { //Finding out that if the allWatched contains the genre if (existingGenres.GenreId == allWatched.GenreId) { //Adding movie with same genre to the list genreListWatched.Add(allWatched); } } //If any movies got added create a new List in the UI if (genreListWatched.Count > 0) { DynamicListViewCreator(existingGenres.GenreName, genreListWatched, Stack_Watched); } //Creates a temporary list to store the movie that contain the current genre ObservableCollection <Movie> genreListToWatch = new ObservableCollection <Movie>(); foreach (Movie allToWatch in allToWatchMovies) { //Finding out that if the allToWatch contains the genre if (existingGenres.GenreId == allToWatch.GenreId) { //Adding movie with same genre to the list genreListToWatch.Add(allToWatch); } } //If any movies got added create a new List in the UI if (genreListToWatch.Count > 0) { DynamicListViewCreator(existingGenres.GenreName, genreListToWatch, stack_toWatch); } //End of Genre Loop } }