Example #1
0
        private void NewBack_Click(object sender, EventArgs e)
        {
            this.Hide();
            var home = new Reckoner();

            home.BindProjects();
        }
Example #2
0
        private void image_Load(object sender, EventArgs e)
        {
            Form2 ab = new Form2();

            ab.Show();
            System.Threading.Thread.Sleep(3000);
            ab.Hide();
            var home = new Reckoner();

            home.BindProjects();
        }
Example #3
0
        private void UpdateTicket_Click(object sender, EventArgs e)
        {
            var ticketId = _ticketId;
            var steps    = string.Empty;
            var count    = 0;

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (row.Cells[0].Value != null && row.Cells[0].Value.ToString() != "")
                {
                    if (row.Index == 0)
                    {
                        steps = "Step 1: " + row.Cells[0].Value.ToString();
                    }
                    else if (row.Index == dataGridView1.Rows.Count - 1)
                    {
                        continue;
                    }
                    else
                    {
                        steps = steps + "  Step " + (count + 1) + ": " + row.Cells[0].Value.ToString();
                    }
                    count++;
                }
            }

            var ttcount   = ETTtxt.Text.Trim().Count();
            var eacount   = EAtxt.Text.Trim().Count();
            var eapcount  = EAptxt.Text.Trim().Count();
            var stepcount = steps.Trim().Count();

            if ((ttcount != 0) && (eacount != 0) && (eapcount != 0) && (stepcount != 0))
            {
                if (File.Exists(strFileName))
                {
                    XmlDocument objXmlDocument = new XmlDocument();
                    objXmlDocument.Load(strFileName);

                    // Getting a particular Employee by selecting using Xpath query
                    XmlNode node = objXmlDocument.SelectSingleNode("//row[TicketTypeID='" + ticketId + "']");

                    if (node != null)
                    {
                        // Assigining all the values
                        node.SelectNodes("TicketType").Item(0).InnerText        = ETTtxt.Text;
                        node.SelectNodes("Business").Item(0).InnerText          = EBtxt.Text;
                        node.SelectNodes("Analysis").Item(0).InnerText          = EAtxt.Text;
                        node.SelectNodes("Approach").Item(0).InnerText          = EAptxt.Text;
                        node.SelectNodes("Steps").Item(0).InnerText             = steps;
                        node.SelectNodes("Review").Item(0).InnerText            = ERtxt.Text;
                        node.SelectNodes("Testing").Item(0).InnerText           = ETtxt.Text;
                        node.SelectNodes("LastUpdate").Item(0).InnerText        = DateTime.Now.ToString("dd/MM/yyyy");
                        node.SelectNodes("Reference").Item(0).InnerText         = ERFtxt.Text;
                        node.SelectNodes("DocumentReference").Item(0).InnerText = EDRtxt.Text;
                        //if (EDRtxt.Text.Trim().Length > 0)
                        //{
                        //    node.SelectNodes("DocumentReference").Item(0).FirstChild.InnerText = EDRtxt.Text;
                        //}
                    }
                    //Saving the file
                    objXmlDocument.Save(strFileName);
                }
                else
                {
                    Exception ex = new Exception("Database file does not exist in the folder");
                    throw ex;
                }
                MessageBox.Show(@"Details Updated Successfully");
                this.Hide();
                var home = new Reckoner();
                home.BindProjects();
            }
            else
            {
                MessageBox.Show(@"Please Fill all the Mandatory Fields");
            }
        }