示例#1
0
        private static void GenerateProject()
        {
            PushOutPut("Uploading the project");
            DateTime dtn = DateTime.Now;
            var      pr3 = CommonFunctions.ToNgProgect(pr);

            CommonFunctions.SaveXml("temp.xml", pr3);

            Boolean uploadStatus   = false;
            string  url            = Constants.SITEURL + "FileHandling";
            string  filePath       = @"\";
            Random  rnd            = new Random();
            string  uploadFileName = CommonFunctions.RandomString();

            uploadStatus = Upload(url, filePath, "temp.xml", uploadFileName);
            if (uploadStatus)
            {
                try
                {
                    PushOutPut("Upload success");
                    PushOutPut("Generating the code");
                    PostData(uploadFileName + ".xml").Wait();
                }
                catch (Exception ex)
                {
                    PushOutPut(ex.Message);
                }
            }
            else
            {
                PushOutPut("Upload failed. Please try again.");
                MessageBox.Show("Upload failed. Please try again.");
            }
        }
示例#2
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (pr == null)
            {
                MessageBox.Show("No project exists. Try by creating New Project or Open.");
                return;
            }
            if (pr.Menues.Count() == 0)
            {
                MessageBox.Show("No project exists. Try by creating New Project or Open.");
                return;
            }

            if (strFileName == "")
            {
                saveFileDialog1.FileName = "Project1";
                saveFileDialog1.Filter   = "XML Files|*.xml";
                saveFileDialog1.ShowDialog();
                strFileName = saveFileDialog1.FileName;
            }
            if (strFileName == "")
            {
                return;
            }
            CommonFunctions.SaveXml(strFileName, pr);
            MessageBox.Show("Done");
        }