Example #1
0
        private void RunReq_Load(object sender, EventArgs e)
        {
            //get desktop path
            string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\Tables";

            //ensure directory exists, if not create it
            if (!(Directory.Exists(path)))
            {
                DirectoryInfo di = Directory.CreateDirectory(path);
            }
            path += "\\Request.txt";

            // Determine whether the File exists.
            if (!(File.Exists(path)))
            {
                FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite);
                fs.Close();
                //                    DialogResult Message = MessageBox.Show(this, "There are no Specials at this time", "Sorry");
            }

            Reqs = Reqs.FileToOrders(path);
            boxRunReq.DataSource = Reqs.toStringList();
            if (Reqs.Count != 0)
            {
                boxRunReq.SetSelected(0, false);
            }
            boxRunReq.Refresh();
        }
Example #2
0
        //public Specials()
        //{
        //   InitializeComponent();
        //}
        //read the specals file and add populate the array
        private void Specials_Load(object sender, EventArgs e)
        {
            //if it is ordering time resize the from and add controls
            if (!Admin)
            {
                this.Size = new System.Drawing.Size(319+40, 265+70);
            }

            //get desktop path
            string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\Specials";

            //ensure directory exists, if not create it
            if (!(Directory.Exists(path)))
            {
                DirectoryInfo di = Directory.CreateDirectory(path);
            }
            path += "\\Specials.txt";

            // Determine whether the File exists.
            if (!(File.Exists(path)))
            {
                FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite);
                fs.Close();
                //                    DialogResult Message = MessageBox.Show(this, "There are no Specials at this time", "Sorry");
            }

            CurSpc = CurSpc.FileToList(path);
            boxSpcList.DataSource = CurSpc.toStringList();
            if (CurSpc.Count != 0)
            {
                boxSpcList.SetSelected(0, false);
            }
            boxSpcList.Refresh();
        }