Пример #1
0
        private void fetchstudentrecord()
        {
            string     matric  = textBox1.Text.Trim();
            string     urld    = "http://localhost/get_stud_profile.php?mat=" + matric + "&pwd=" + matric + "";
            WebRequest request = WebRequest.Create(urld);

            request.Timeout = 40000;
            WebResponse responses  = request.GetResponse();
            Stream      streams    = responses.GetResponseStream();
            XmlDocument CompsSpecs = new XmlDocument();

            CompsSpecs.Load(streams);
            XmlNodeList NodeLists = CompsSpecs.GetElementsByTagName("stud_profile"); // Create a list of the nodes in the xml file //

            materialLabel7.Text  = NodeLists[0].FirstChild.ChildNodes[0].InnerText;
            materialLabel1.Text  = "Surname: " + NodeLists[0].ChildNodes[1].InnerText;
            materialLabel2.Text  = "Othernames: " + NodeLists[0].ChildNodes[2].InnerText.Trim() + " " + NodeLists[0].ChildNodes[3].InnerText.Trim();
            materialLabel34.Text = NodeLists[0].ChildNodes[4].InnerText;
            materialLabel35.Text = NodeLists[0].ChildNodes[8].InnerText;
            email1 = NodeLists[0].ChildNodes[16].InnerText.Trim();
            email2 = NodeLists[0].ChildNodes[17].InnerText.Trim();
            materialLabel3.Text = "Programme: " + NodeLists[0].ChildNodes[22].InnerText;
            if (pictureBox1.Image == null && materialLabel7.Text == "")
            {
                InformationBox.Show("Sorry, The Matric Number Does Not Exist. Please Confirm.", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Error);
                panel4.Visible      = true;
                metroPanel1.Visible = false;
                textBox1.Clear();
                this.ActiveControl = textBox1;
                textBox1.Focus();
            }
            else
            {
                InformationBox.Show("By going further, you accept that the information entered is correct and valid. If by any chance the information provided is false, you accept to be called to face the disciplinary panel and punished for impersonation and provision of wrong information.", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Exclamation);
                if (NodeLists[0].ChildNodes[20].InnerText.Trim() == "")
                {
                    fetch_father_info();
                    panel4.Visible      = false;
                    metroPanel1.Visible = true;
                }
                else
                {
                    pictureBox1.Load(folderPath + NodeLists[0].ChildNodes[20].InnerText.Trim());
                    fetch_father_info();
                    panel4.Visible      = false;
                    metroPanel1.Visible = true;
                }
            }
        }
Пример #2
0
        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                InformationBox.Show("You Cannot Open Two Hostel Allocation Forms", "Project Administrator", InformationBoxButtons.OK);
            }

            else
            {
                Vitalinfo.sessionid = sessionid;
                Form3 hostelallocationform = new Form3();
                hostelallocationform.MdiParent = this;
                hostelallocationform.Show();
            }
        }
Пример #3
0
 private void materialFlatButton1_Click(object sender, EventArgs e)
 {
     if (InformationBox.Show("Do You Really Want To Logout?", "Comida Administrator", InformationBoxButtons.YesNo,
                             InformationBoxIcon.Question).ToString() == "No")
     {
         ActiveControl = textBox1;
         textBox1.Focus();
     }
     else
     {
         var firstpage = new Firstpage();
         firstpage.Show();
         Hide();
     }
 }
Пример #4
0
 private void DetailButton_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (DetailButton.Text == "显示详情")
     {
         DetailButton.Text = "关闭详情";
         InformationBox.Show();
         this.Height = 306;
     }
     else
     {
         DetailButton.Text = "显示详情";
         InformationBox.Hide();
         this.Height = 164;
     }
 }
Пример #5
0
 private void materialFlatButton1_Click(object sender, EventArgs e)
 {
     if (comboBox1.Text == "")
     {
         InformationBox.Show("Please Select Cafeteria Name", "Project Administrator", InformationBoxButtons.OK,
                             InformationBoxIcon.Information);
     }
     else
     {
         CafeteriaInfo.CafId   = materialLabel2.Text.Trim();
         CafeteriaInfo.Cafname = comboBox1.Text;
         var login = new Firstpage();
         login.Show();
         Hide();
     }
 }
Пример #6
0
 private void materialFlatButton1_Click(object sender, EventArgs e)
 {
     if (SponsorSurname.Text == "")
     {
         InformationBox.Show("Sponsor Surname Is Missing", "Project Administrator", InformationBoxIcon.Information, InformationBoxButtons.OK);
     }
     else
     if (SponsorOthernames.Text == "")
     {
         InformationBox.Show("Sponsor Othernames Is Missing", "Project Administrator", InformationBoxIcon.Information, InformationBoxButtons.OK);
     }
     else
     if (SponsorAddress.Text == "")
     {
         InformationBox.Show("Sponsor Address Is Missing", "Project Administrator", InformationBoxIcon.Information, InformationBoxButtons.OK);
     }
     else
     if (SponsorAddress.Text == "")
     {
         InformationBox.Show("Sponsor Address Is Missing", "Project Administrator", InformationBoxIcon.Information, InformationBoxButtons.OK);
     }
     else
     if (SponsorPhone.Text == "")
     {
         InformationBox.Show("Sponsor Phone Number Is Missing", "Project Administrator", InformationBoxIcon.Information, InformationBoxButtons.OK);
     }
     else
     if (SponsorEmail.Text == "")
     {
         InformationBox.Show("Sponsor Email Address Is Missing", "Project Administrator", InformationBoxIcon.Information, InformationBoxButtons.OK);
     }
     else
     if (SponsorOccupation.Text == "")
     {
         InformationBox.Show("Sponsor Occupation Is Missing", "Project Administrator", InformationBoxIcon.Information, InformationBoxButtons.OK);
     }
     else
     {
         InformationBox.Show("Information Successfully Submitted. Please Proceed To The Hostel To Get Your Room.", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Success);
         panel4.Visible      = true;
         metroPanel1.Visible = false;
         clearinfo();
         textBox1.Clear();
         this.ActiveControl = textBox1;
         textBox1.Focus();
     }
 }
Пример #7
0
 private void pd_PrintPage(object sender, PrintPageEventArgs e)
 {
     try
     {
         var Type    = "Cash";
         var drawn   = Firstpage.Logininfo.username;
         var amounts = textBox1.Text.Trim();
         var cafname = CafSelect.CafeteriaInfo.Cafname;
         //string Customer = "Manna Palace";
         var SPACE = 50;
         var title = Application.StartupPath + "\\imagenow.png";
         var g     = e.Graphics;
         //g.DrawRectangle(Pens.Black, 5, 5, 378, 445);
         g.DrawImage(Image.FromFile(title), 30, 5);
         var fBody  = new Font("Lucida Console", 9, FontStyle.Regular);
         var fBody1 = new Font("Lucida Console", 9, FontStyle.Regular);
         var rs     = new Font("Stencil", 10, FontStyle.Bold);
         var fTType = new Font("", 150, FontStyle.Bold);
         var sb     = new SolidBrush(Color.Black);
         g.DrawString("", fBody1, sb, 10, 100);
         g.DrawString("*" + cafname + "*", fBody1, sb, 10, SPACE);
         g.DrawString("---------------------------", fBody1, sb, 10, SPACE + 30);
         g.DrawString("Date: ", fBody1, sb, 10, SPACE + 60);
         g.DrawString(DateTime.Now.ToShortDateString(), fBody1, sb, 50, SPACE + 60);
         g.DrawString("Time: ", fBody1, sb, 10, SPACE + 90);
         g.DrawString(DateTime.Now.ToShortTimeString(), fBody1, sb, 50, SPACE + 90);
         g.DrawString("Type: ", fBody1, sb, 10, SPACE + 120);
         g.DrawString(Type, fBody1, sb, 50, SPACE + 120);
         //g.DrawString("DriverName:", fBody, sb, 10, SPACE+120);
         //g.DrawString(txtDriveName.Text, fBody1, sb, 153, SPACE + 120);
         g.DrawString("Amount: ", fBody1, sb, 10, SPACE + 150);
         g.DrawString(amounts, fBody1, sb, 70, SPACE + 150);
         g.DrawString("Terminal:", fBody1, sb, 10, SPACE + 180);
         g.DrawString(drawn, fBody1, sb, 80, SPACE + 180);
         g.DrawString("---------------------------", fBody1, sb, 10, SPACE + 210);
         g.DrawString("**Powered By COMIDA**", fBody1, sb, 10, SPACE + 240);
         //  g.DrawString(TType, fTType, sb, 230, 120);
         g.DrawString("Helpline:+2348140806886", fBody1, sb, 10, SPACE + 270);
     }
     catch (Exception excep)
     {
         InformationBox.Show(excep.Message, "Comida Administrator", InformationBoxButtons.OK,
                             InformationBoxIcon.Error);
         InformationBox.Show(excep.StackTrace);
     }
 }
Пример #8
0
 private void textBox1_KeyPress_1(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar != (char)Keys.Return)
     {
         return;
     }
     if (textBox1.Text == "")
     {
         InformationBox.Show("Please Scan User Id", "Comida", InformationBoxButtons.OK,
                             InformationBoxIcon.Information);
         textBox1.Focus();
     }
     else
     {
         timer1.Start();
     }
 }
Пример #9
0
        private void checklogin()
        {
            try
            {
                string     username = metroTextBox1.Text.Trim();
                string     password = metroTextBox2.Text;
                string     url      = "http://localhost/Allocator/cgi-bin/porter_login.php?staffid=" + username + "&password="******"";
                WebRequest requ     = WebRequest.Create(url);
                requ.Timeout = 40000;
                WebResponse response  = requ.GetResponse();
                Stream      stream    = response.GetResponseStream();
                XmlDocument CompSpecs = new XmlDocument();
                CompSpecs.Load(stream);
                //Load the data from the file into the XmlDocument (CompSpecs) //
                XmlNodeList NodeList = CompSpecs.GetElementsByTagName("response");
                // Create a list of the nodes in the xml file //
                access = NodeList[0].FirstChild.ChildNodes[0].InnerText.Trim();

                if (access == "1")
                {
                    Logininfo.userid   = NodeList[0].ChildNodes[1].InnerText.Trim();
                    Logininfo.username = NodeList[0].ChildNodes[2].InnerText.Trim();
                    string greetings = NodeList[0].ChildNodes[2].InnerText.Trim();
                    Logininfo.hostelid = NodeList[0].ChildNodes[3].InnerText.Trim();
                    InformationBox.Show("Welcome, " + greetings + "", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Success);
                    Form2 homepage = new Form2();
                    homepage.Show();
                    this.Hide();
                }
                else
                {
                    InformationBox.Show("Sorry Your Username/Password Is Incorrect", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Error);
                    metroTextBox2.Clear();
                    this.ActiveControl = metroTextBox2;
                    metroTextBox2.Focus();
                }
            }
            catch (Exception exec)
            {
                InformationBox.Show(exec.Message, "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Error);
                //InformationBox.Show(exec.StackTrace);
            }
        }
Пример #10
0
        /// <summary>
        /// Shows the box.
        /// </summary>
        /// <param name="behavior">The behavior.</param>
        private void ShowBox(InformationBoxBehavior behavior)
        {
            InformationBoxButtons buttons             = this.GetButtons();
            InformationBoxIcon    icon                = this.GetIcon();
            string iconFileName                       = this.txbIcon.Text;
            InformationBoxDefaultButton defaultButton = this.GetDefaultButton();
            InformationBoxButtonsLayout buttonsLayout = this.GetButtonsLayout();
            InformationBoxAutoSizeMode  autoSize      = this.GetAutoSize();
            InformationBoxPosition      position      = this.GetPosition();
            HelpNavigator                navigator    = this.GetHelpNavigator();
            InformationBoxCheckBox       checkState   = this.GetCheckBoxState();
            CheckState                   state        = 0;
            InformationBoxStyle          style        = this.GetStyle();
            AutoCloseParameters          autoClose    = this.GetAutoClose();
            DesignParameters             design       = this.GetDesign();
            InformationBoxTitleIconStyle titleStyle   = this.GetTitleStyle();
            InformationBoxOpacity        opacity      = this.GetOpacity();
            InformationBoxOrder          order        = this.GetOrder();
            InformationBoxSound          sound        = this.GetSound();

            InformationBoxTitleIcon titleIcon = null;

            if (titleStyle == InformationBoxTitleIconStyle.Custom)
            {
                titleIcon = new InformationBoxTitleIcon(this.txbTitleIconFile.Text);
            }

            if (String.IsNullOrEmpty(iconFileName))
            {
                InformationBox.Show(this.txbText.Text, out state, this.txbTitle.Text, buttons, new string[] { this.txbUser1.Text, this.txbUser2.Text, this.txbUser3.Text }, icon, defaultButton, buttonsLayout, autoSize, position, this.chbHelpButton.Checked, this.txbHelpFile.Text, navigator, this.txbHelpTopic.Text, checkState, style, autoClose, design, titleStyle, titleIcon, behavior, new AsyncResultCallback(BoxClosed), opacity, order, sound);
            }
            else
            {
                InformationBox.Show(this.txbText.Text, out state, this.txbTitle.Text, buttons, new string[] { this.txbUser1.Text, this.txbUser2.Text, this.txbUser3.Text }, new Icon(iconFileName), defaultButton, buttonsLayout, autoSize, position, this.chbHelpButton.Checked, this.txbHelpFile.Text, navigator, this.txbHelpTopic.Text, checkState, style, autoClose, design, titleStyle, titleIcon, behavior, new AsyncResultCallback(BoxClosed), opacity, order, sound);
            }

            if (checkState != 0)
            {
                InformationBox.Show(
                    String.Format(CultureInfo.InvariantCulture, "The state of the checkbox was {0}", state),
                    InformationBoxIcon.Information);
            }
        }
Пример #11
0
 private void Firstpage_KeyDown(object sender, KeyEventArgs e)
 {
     if (!e.Control || e.KeyCode != Keys.X)
     {
         return;
     }
     if (
         InformationBox.Show("Do You Really Want To Exit The App?", "Comida Administrator",
                             InformationBoxButtons.YesNo, InformationBoxIcon.Question).ToString() == "No")
     {
         ActiveControl = textBox1;
         textBox1.Focus();
     }
     else
     {
         Application.Exit();
         Application.ExitThread();
     }
 }
Пример #12
0
        private void materialFlatButton3_Click(object sender, EventArgs e)
        {
            if (MotherSurname.Text == "" || MotherOthernames.Text == "" || MotherAddress.Text == "" || MotherPhone.Text == "" || MotherEmail.Text == "" || MotherOccupation.Text == "")
            {
                if (InformationBox.Show("Mother Information Fields Are Empty. Please Confirm To Continue.", "Project Administrator", InformationBoxButtons.YesNo, InformationBoxIcon.Question).ToString() == "No")
                {
                }
                else
                {
                    submitmotherinfo();
                }
            }

            else
            if ((MotherSurname.Text != "" && MotherOthernames.Text == "") || (MotherSurname.Text != "" && MotherAddress.Text == "") || (MotherSurname.Text != "" && MotherPhone.Text == "") || (MotherSurname.Text != "" && MotherEmail.Text == "") || (MotherSurname.Text != "" && MotherOccupation.Text == ""))
            {
                InformationBox.Show("Mother Information Missing", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Information);
            }
            else
            if ((MotherOthernames.Text != "" && MotherSurname.Text == "") || (MotherOthernames.Text != "" && MotherAddress.Text == "") || (MotherOthernames.Text != "" && MotherPhone.Text == "") || (MotherOthernames.Text != "" && MotherEmail.Text == "") || (MotherOthernames.Text != "" && MotherOccupation.Text == ""))
            {
                InformationBox.Show("Mother Information Missing", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Information);
            }
            else
            if ((MotherAddress.Text != "" && MotherSurname.Text == "") || (MotherAddress.Text != "" && MotherOthernames.Text == "") || (MotherAddress.Text != "" && MotherPhone.Text == "") || (MotherAddress.Text != "" && MotherEmail.Text == "") || (MotherAddress.Text != "" && MotherOccupation.Text == ""))
            {
                InformationBox.Show("Mother Information Missing", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Information);
            }
            else
            if ((MotherPhone.Text != "" && MotherSurname.Text == "") || (MotherPhone.Text != "" && MotherOthernames.Text == "") || (MotherPhone.Text != "" && MotherAddress.Text == "") || (MotherPhone.Text != "" && MotherEmail.Text == "") || (MotherPhone.Text != "" && MotherOccupation.Text == ""))
            {
                InformationBox.Show("Mother Information Missing", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Information);
            }
            else
            if ((MotherEmail.Text != "" && MotherSurname.Text == "") || (MotherEmail.Text != "" && MotherOthernames.Text == "") || (MotherEmail.Text != "" && MotherAddress.Text == "") || (MotherEmail.Text != "" && MotherPhone.Text == "") || (MotherEmail.Text != "" && MotherOccupation.Text == ""))
            {
                InformationBox.Show("Mother Information Missing", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Information);
            }
            else
            {
                submitmotherinfo();
            }
        }
Пример #13
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem == null)
            {
                TranslationGrid.Hide();
                InformationBox.Show();
                InformationBox.Text = "this is not a valid list";
                return;
            }

            FileName = listBox1.SelectedItem.ToString();
            var wordList = WordList.LoadList(FileName);

            if (wordList == null)
            {
                return;
            }
            TranslationGrid.Show();
            AddButton.Show();
            NewListButton.Show();
            RemoveButton.Show();
            SaveButton.Show();
            PracticeButton.Show();
            AddButton.Enabled    = true;
            SaveButton.Enabled   = true;
            RemoveButton.Enabled = true;
            InformationBox.Hide();
            var languageArray = wordList.Languages;
            var sortBy        = 0;

            CountLabel.Text = $"There are {wordList.Count()} words in the list";
            TranslationGrid.Rows.Clear();
            TranslationGrid.Columns.Clear();
            TranslationGrid.Refresh();
            foreach (var languages in languageArray)
            {
                TranslationGrid.Columns.Add("newColumnName", languages.ToUpper());
            }
            TranslationGrid.Rows.Clear();

            wordList.List(sortBy, x => { TranslationGrid.Rows.Add(x); });
        }
Пример #14
0
 private void pictureBox2_Click(object sender, EventArgs e)
 {
     if (metroTextBox1.Text == "" || metroTextBox2.Text == "")
     {
         InformationBox.Show("Username/Password Missing", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Information);
     }
     else
     if (metroTextBox1.Text == "USER" && metroTextBox2.Text == "USER")
     {
         Logininfo.username = metroTextBox1.Text;
         InformationBox.Show("Welcome, " + metroTextBox1.Text + "", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Success);
         Form2 MDIOperations = new Form2();
         MDIOperations.Show();
         this.Hide();
     }
     else
     {
         checklogin();
     }
 }
Пример #15
0
 private void getsessionid()
 {
     try
     {
         string     url  = "http://localhost/Allocator/cgi-bin/get_session_id.php?";
         WebRequest requ = WebRequest.Create(url);
         requ.Timeout = 60000;
         WebResponse response  = requ.GetResponse();
         Stream      stream    = response.GetResponseStream();
         XmlDocument CompSpecs = new XmlDocument();
         CompSpecs.Load(stream);
         //Load the data from the file into the XmlDocument (CompSpecs) //
         XmlNodeList NodeList = CompSpecs.GetElementsByTagName("ID");
         // Create a list of the nodes in the xml file //
         sessionid = NodeList[0].ParentNode.ChildNodes[0].InnerText.Trim();
     }
     catch (Exception exec)
     {
         InformationBox.Show(exec.Message, "Comida Administrator", InformationBoxButtons.OK, InformationBoxIcon.Error);
     }
 }
Пример #16
0
 private void PrintMethod()
 {
     try
     {
         var pd = new PrintDocument();
         //PaperSize ps = new PaperSize("", 261, 445);
         pd.PrintPage      += pd_PrintPage;
         pd.PrintController = new StandardPrintController();
         // pd.DefaultPageSettings.Margins.Left = 0;
         //  pd.DefaultPageSettings.Margins.Right = 0;
         //  pd.DefaultPageSettings.Margins.Top = 0;
         //  pd.DefaultPageSettings.Margins.Bottom = 0;
         //pd.DefaultPageSettings.PaperSize = ps;
         pd.Print();
     }
     catch (Exception excep)
     {
         InformationBox.Show(excep.Message, "Comida Administrator", InformationBoxButtons.OK,
                             InformationBoxIcon.Error);
     }
 }
Пример #17
0
 private void generateroom()
 {
     try
     {
         string     matric = textBox1.Text.Trim();
         string     url    = "http://localhost/Allocator/cgi-bin/fetch_accurate_accommodation_details.php?matric=" + matric + "";
         WebRequest requ   = WebRequest.Create(url);
         requ.Timeout = 90000;
         WebResponse response  = requ.GetResponse();
         Stream      stream    = response.GetResponseStream();
         XmlDocument CompSpecs = new XmlDocument();
         CompSpecs.Load(stream);
         XmlNodeList NodeList = CompSpecs.GetElementsByTagName("response");
         // Create a list of the nodes in the xml file //
         string access = NodeList[0].FirstChild.ChildNodes[0].InnerText;
         if (access == "1")
         {
             occupant             = NodeList[0].ChildNodes[1].InnerText.Trim();
             materialLabel11.Text = "Block Number: " + NodeList[0].ChildNodes[3].InnerText;
             materialLabel1.Text  = "Room Number: " + NodeList[0].ChildNodes[4].InnerText;
             panel4.Visible       = false;
             panel1.Visible       = true;
         }
         else
         {
             string message = NodeList[0].ChildNodes[1].InnerText;
             InformationBox.Show(message, "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Error);
             panel4.Visible = true;
             panel1.Visible = false;
             textBox1.Clear();
             this.ActiveControl = textBox1;
             textBox1.Focus();
         }
     }
     catch (Exception ce)
     {
         InformationBox.Show(ce.Message);
         InformationBox.Show(ce.StackTrace);
     }
 }
Пример #18
0
 private void materialFlatButton1_Click(object sender, EventArgs e)
 {
     if (comboBox1.Text == "")
     {
         InformationBox.Show("Please Select Block Number.", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Information);
     }
     else
     if (comboBox2.Text == "")
     {
         InformationBox.Show("Please Select Room Number.", "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Information);
     }
     else
     {
         if (InformationBox.Show("Please Verify That The Room Is Either Habitable Or Not. You Will Be Held Responsible If The Information Provided Is False.", "Project Administrator", InformationBoxButtons.YesNo, InformationBoxIcon.Question).ToString() == "No")
         {
         }
         else
         {
             submithabitableinformation();
         }
     }
 }
Пример #19
0
        private void InitializeActions()
        {
            exitAction.Run  += (s, e) => Close();
            aboutAction.Run += (s, e) =>
            {
                var service = This.GetService <IAboutService>();
                if (service == null)
                {
                    InformationBox.Show(this, string.Format(
                                            "About Delta.CertXplorer Version {0}", ThisAssembly.Version));
                }
                else
                {
                    service.ShowAboutDialog(this);
                }
            };

            openFileDocumentAction.Run += (s, e) =>
                                          Commands.RunVerb(Verbs.OpenFile);
            openCertificateDocumentAction.Run += (s, e) =>
                                                 Commands.RunVerb(Verbs.OpenCertificate);
        }
Пример #20
0
 private void Loadxml()
 {
     try
     {
         var to   = textBox1.Text.Trim();
         var url  = "http://localhost/comido/cgi_bin/is_staff.php?username="******"status");
         // Create a list of the nodes in the xml file //
         label2.Text = nodeList[0].ParentNode.ChildNodes[0].InnerText;
         if (label2.Text.Trim() == "1")
         {
             Logininfo.username = textBox1.Text;
             var homepage = new Form1();
             homepage.Show();
             Hide();
         }
         else
         {
             InformationBox.Show("Sorry Your Login ID Is Incorrect", "Comida Administrator",
                                 InformationBoxButtons.OK, InformationBoxIcon.Error);
             label2.Text = "";
             textBox1.Clear();
             ActiveControl = textBox1;
             textBox1.Focus();
         }
     }
     catch (Exception exec)
     {
         InformationBox.Show(exec.Message + " " + "due to poor internet connection", "Comida Administrator",
                             InformationBoxButtons.OK, InformationBoxIcon.Error);
     }
 }
Пример #21
0
 private void pd_PrintPage(object sender, PrintPageEventArgs e)
 {
     try
     {
         const string type    = "Cash";
         var          drawn   = FirstPage.Logininfo.Username;
         var          amounts = textBox1.Text.Trim();
         var          cafname = CafSelect.CafeteriaInfo.Cafname;
         const int    space   = 50;
         var          title   = Application.StartupPath + "\\imagenow.png";
         var          g       = e.Graphics;
         g.DrawImage(Image.FromFile(title), 30, 5);
         var fBody  = new Font("Lucida Console", 9, FontStyle.Regular);
         var fBody1 = new Font("Lucida Console", 9, FontStyle.Regular);
         var rs     = new Font("Stencil", 10, FontStyle.Bold);
         var fTType = new Font("", 150, FontStyle.Bold);
         var sb     = new SolidBrush(Color.Black);
         g.DrawString("", fBody1, sb, 10, 100);
         g.DrawString("*" + cafname + "*", fBody1, sb, 10, space);
         g.DrawString("---------------------------", fBody1, sb, 10, space + 30);
         g.DrawString("Date: ", fBody1, sb, 10, space + 60);
         g.DrawString(DateTime.Now.ToShortDateString(), fBody1, sb, 50, space + 60);
         g.DrawString("Time: ", fBody1, sb, 10, space + 90);
         g.DrawString(DateTime.Now.ToShortTimeString(), fBody1, sb, 50, space + 90);
         g.DrawString("Type: ", fBody1, sb, 10, space + 120);
         g.DrawString(type, fBody1, sb, 50, space + 120);
         g.DrawString("Amount: ", fBody1, sb, 10, space + 150);
         g.DrawString(amounts, fBody1, sb, 70, space + 150);
         g.DrawString("Terminal:", fBody1, sb, 10, space + 180);
         g.DrawString(drawn, fBody1, sb, 80, space + 180);
         g.DrawString("---------------------------", fBody1, sb, 10, space + 210);
         g.DrawString("**Powered By COMIDA**", fBody1, sb, 10, space + 240);
         g.DrawString(" [email protected]", fBody1, sb, 10, space + 270);
     }
     catch (Exception excep)
     {
         InformationBox.Show(excep.Message);
     }
 }
Пример #22
0
 private void fetch_supervisor_Room_Clearance()
 {
     try
     {
         string     porterid = Form1.Logininfo.userid;
         string     url      = "http://localhost/Allocator/cgi-bin/fetch_supervisor_Room_Clearance.php?porterid=" + porterid + "";
         WebRequest requ     = WebRequest.Create(url);
         requ.Timeout = 40000;
         WebResponse response  = requ.GetResponse();
         Stream      stream    = response.GetResponseStream();
         XmlDocument CompSpecs = new XmlDocument();
         CompSpecs.Load(stream);
         //Load the data from the file into the XmlDocument (CompSpecs) //
         XmlNodeList NodeList = CompSpecs.GetElementsByTagName("response");
         // Create a list of the nodes in the xml file //
         access = NodeList[0].FirstChild.ChildNodes[0].InnerText.Trim();
         if (access == "1")
         {
             hostelid = NodeList[0].ChildNodes[1].InnerText.Trim();
             genderid = NodeList[0].ChildNodes[2].InnerText.Trim();
             if (genderid == "1")
             {
                 materialLabel4.Text = "Hostel Type: Boy's Hostel";
             }
             else
             {
                 materialLabel4.Text = "Hostel Type: Girl's Hostel";
             }
             materialLabel1.Text = "Hostel Name: " + NodeList[0].ChildNodes[3].InnerText.Trim();
             materialLabel3.Text = "Supervisor: " + NodeList[0].ChildNodes[4].InnerText.Trim();
         }
     }
     catch (Exception exec)
     {
         InformationBox.Show(exec.Message, "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Error);
         //InformationBox.Show(exec.StackTrace);
     }
 }
Пример #23
0
        private void button1_Click(object sender, EventArgs e)
        {
            string originalName = textBoxOriginalSite.Text.Trim();
            string newName      = textBoxNewSite.Text.Trim();

            if (string.IsNullOrEmpty(originalName) || string.IsNullOrEmpty(newName))
            {
                return;
            }
            FictionObjectManager manager = FictionObjectManager.Instance;

            foreach (FictionObject fictionObj in manager.ProjectList)
            {
                if (fictionObj.HTMLLink.StartsWith(originalName))
                {
                    string htmlLink = fictionObj.HTMLLink;
                    htmlLink            = htmlLink.Replace(originalName, newName);
                    fictionObj.HTMLLink = htmlLink;
                }
                else if (fictionObj.HTMLLink.StartsWith(newName))
                {
                    IList <string> list = new List <string>();
                    foreach (string link in fictionObj.FilesList)
                    {
                        string newLink = link;
                        if (link.StartsWith(originalName))
                        {
                            newLink = link.Replace(originalName, newName);
                        }
                        list.Add(newLink);
                    }
                    fictionObj.FilesList.Clear();
                    fictionObj.FilesList.AddRange(list);
                }
            }
            manager.Save();
            InformationBox.Show("Change name OK !", new AutoCloseParameters(1));
        }
Пример #24
0
 private void loadbadrooms()
 {
     try
     {
         //string blocknum = comboBox1.Text.Trim();
         string     url  = "http://localhost/Allocator/cgi-bin/count_habitable_rooms.php?hostelid=" + hostelid + "";
         WebRequest requ = WebRequest.Create(url);
         requ.Timeout = 40000;
         WebResponse response  = requ.GetResponse();
         Stream      stream    = response.GetResponseStream();
         XmlDocument CompSpecs = new XmlDocument();
         CompSpecs.Load(stream);
         //Load the data from the file into the XmlDocument (CompSpecs) //
         XmlNodeList NodeList = CompSpecs.GetElementsByTagName("response");
         // Create a list of the nodes in the xml file //
         // materialLabel6.Text = NodeList[0].FirstChild.ChildNodes[0].InnerText.Trim();
         materialLabel3.Text = "No. Of Bad Rooms: " + NodeList[0].FirstChild.ChildNodes[0].InnerText.Trim();
     }
     catch (Exception exec)
     {
         InformationBox.Show(exec.Message, "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Error);
     }
 }
Пример #25
0
 private void submitpersonaleffects()
 {
     try
     {
         string     description = txtpersonaleffect.Text;
         string     url         = "http://localhost/Allocator/cgi-bin/insert_personal_effects.php?occupantid=" + studentid + "&description=" + description + "&sessionid=" + sessionid + "";
         WebRequest requ        = WebRequest.Create(url);
         requ.Timeout = 40000;
         WebResponse response  = requ.GetResponse();
         Stream      stream    = response.GetResponseStream();
         XmlDocument CompSpecs = new XmlDocument();
         CompSpecs.Load(stream);
         //Load the data from the file into the XmlDocument (CompSpecs) //
         XmlNodeList NodeList = CompSpecs.GetElementsByTagName("response");
         // Create a list of the nodes in the xml file //
         materialTabControl2.SelectedTab = tabPage6;
     }
     catch (Exception exec)
     {
         InformationBox.Show(exec.Message, "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Error);
         InformationBox.Show(exec.StackTrace);
     }
 }
Пример #26
0
 private void FetchCafeteriaName(MyWorkerClass obj)
 {
     // comboBox1.Items.Clear();
     try
     {
         var          bs  = new BindingSource();
         const string url = "http://localhost/comido/cgi_bin/fetch_cafeteria_details.php";
         // var ds = new DataSet();
         var request = (HttpWebRequest)WebRequest.Create(url);
         request.Timeout     = 80000;
         request.ContentType = "application/xml";
         var response   = (HttpWebResponse)request.GetResponse();
         var datastream = response.GetResponseStream();
         var reader     = XmlReader.Create(datastream ?? throw new InvalidOperationException());
         var doc        = new XmlDocument();
         doc.Load(reader);
         var nodeList = doc.SelectNodes("response/status");
         if (nodeList != null)
         {
             obj.Cafetype = nodeList;
         }
         //if (nodeList == null) return;
         int i = 0;
         //foreach (XmlNode node in nodeList)
         //    obj.Cafetype = node.SelectSingleNode("Name")?.InnerText;
         backgroundWorker1.ReportProgress(i, obj);
         i++;
         Thread.Sleep(10);
         ////if (!comboBox1.Items.Contains(node.SelectSingleNode("Name")?.InnerText))
         ////        comboBox1.Items.Add(node.SelectSingleNode("Name")?.InnerText ?? throw new InvalidOperationException());
     }
     catch (Exception ce)
     {
         InformationBox.Show(ce.Message);
     }
 }
Пример #27
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         string     blocknum = comboBox1.Text.Trim();
         string     url      = "http://localhost/Allocator/cgi-bin/fetch_block_id.php?hostelid=" + hostelid + "&blocknum=" + blocknum + "";
         WebRequest requ     = WebRequest.Create(url);
         requ.Timeout = 40000;
         WebResponse response  = requ.GetResponse();
         Stream      stream    = response.GetResponseStream();
         XmlDocument CompSpecs = new XmlDocument();
         CompSpecs.Load(stream);
         //Load the data from the file into the XmlDocument (CompSpecs) //
         XmlNodeList NodeList = CompSpecs.GetElementsByTagName("response");
         // Create a list of the nodes in the xml file //
         // materialLabel6.Text = NodeList[0].FirstChild.ChildNodes[0].InnerText.Trim();
         blockid = NodeList[0].FirstChild.ChildNodes[0].InnerText.Trim();
     }
     catch (Exception exec)
     {
         InformationBox.Show(exec.Message, "Project Administrator", InformationBoxButtons.OK, InformationBoxIcon.Error);
         InformationBox.Show(exec.StackTrace);
     }
 }
Пример #28
0
 public void ShowInformationDialog(string title, string message, string text)
 {
     InformationBox.Show(text, message, title);
 }
Пример #29
0
 /// <summary>
 /// Handles the HelpRequested event of the Form1 control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="hlpevent">The <see cref="System.Windows.Forms.HelpEventArgs"/> instance containing the event data.</param>
 private void Form1_HelpRequested(object sender, HelpEventArgs hlpevent)
 {
     InformationBox.Show("Help has been requested somewhere", "Help", InformationBoxButtons.OK, InformationBoxIcon.Question);
 }
Пример #30
0
 /// <summary>
 /// Call when a asynchronous InformationBox is closed.
 /// </summary>
 /// <param name="result">The result.</param>
 private static void BoxClosed(InformationBoxResult result)
 {
     InformationBox.Show(String.Format(CultureInfo.InvariantCulture, "I am the result of a modeless box : " + result));
 }