protected void Page_Load(object sender, EventArgs e) { System.Web.HttpCookie authCookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName]; if (authCookie == null) { return; } var encTicket = authCookie.Value; var ticket = FormsAuthentication.Decrypt(encTicket); if (ticket != null) { _userId = ticket.UserData; } if (Page.IsPostBack) { return; } ListarOrdenPaginadas(); var fesaDataSource = new FesaDataSourceDataContext(); OfficeList.DataSource = fesaDataSource.GET_ALL_OFFICE(); OfficeList.DataBind(); CostCenterList.DataSource = fesaDataSource.GET_ALL_COSTCENTER(); CostCenterList.DataBind(); }
/// <summary> /// Displaying the whole content of list<Office>. /// </summary> /// <returns>true, if the list is not empty</returns> public static bool Display() { if (OfficeList.Orders.Count != 0) { Console.WriteLine("OfficeList class, displaying 'List<Office> orders'."); OfficeList.Display(); return(true); } else { Console.WriteLine("The 'List<Office> orders' is empty."); return(false); } }
void GetJsonData(string Location) { string jsonFileName = "Data.offices.json"; var assembly = typeof(ProfilePage).GetTypeInfo().Assembly; Stream stream = assembly.GetManifestResourceStream($"{assembly.GetName().Name}.{jsonFileName}"); using (var reader = new System.IO.StreamReader(stream)) { var jsonString = reader.ReadToEnd(); //Converting JSON Array Objects into generic list ObjList = JsonConvert.DeserializeObject <OfficeList>(jsonString); } //Binding listview with json string //listviewContacts.ItemsSource = ObjContactList.offices; }
/// <summary> /// Change of state. If the position is available we /// change state on 'during repair' and substract one position. /// </summary> /// <returns>true, if the process of 'taking' car to workshop succeed</returns> public static bool ChangeState() { bool ap = Workshop.CheckAvaileblePosition(); if (ap == true) { bool c = OfficeList.Finding(); if (c == true) { Workshop.MinusPosition(); return(true); } else { Console.WriteLine("There isn't the order with RepairState 'before repair'."); return(false); } } else { Console.WriteLine("There isn't availble position."); return(false); } }
/// <summary> /// Checking the selected order nr entered by the user /// </summary> /// <param name="number"></param> /// <returns></returns> public static bool Cheking(int number) { return(OfficeList.CheckNumber(number)); }
/// <summary> /// Displaying chosen object of Office class. /// </summary> /// <param name="o">object for displaying</param> public static void Display2(Office o) { OfficeList.Display2(o); }
/// <summary> /// Get all preserved data. /// </summary> /// <param name="fileName">file name from main</param> /// <returns></returns> public static bool LoadOrders(string fileName) { return(OfficeList.LoadAll(fileName)); }
/// <summary> /// Preserve all data. /// </summary> /// <param name="fileName">file name from main</param> /// <returns></returns> public static bool SaveOrders(string fileName) { return(OfficeList.SaveAll(fileName)); }
/// <summary> /// Displaying. /// </summary> /// <returns></returns> public static bool DisplayInfo() { return(OfficeList.DisplayInfo()); }
/// <summary> /// Insert new order. /// </summary> /// <param name="o">object of Office class</param> /// <returns></returns> public static bool InsertOrderII(Office o) { return(OfficeList.AddOrderII(o)); }