Esempio n. 1
0
        protected void Yes_Click(object sender, EventArgs e)
        {
            string url = "http://apsimdev.apsim.info/APSIM.Builds.Service/BuildsClassic.svc/DeleteJob" +
                         "?JobID=" + JobID +
                         "&DbConnectPassword="******"/Bob.aspx");
        }
Esempio n. 2
0
        /// <summary>
        /// Generate HTML for showing validation for a module.
        /// </summary>
        private string GenerateHTML()
        {
            string html = string.Empty;

            string moduleFolder = Path.Combine(validationFolder, versionList.Text, moduleList.Text);

            string baseURL = Bob.GetBaseURL(Request.Url);

            foreach (string imageFileName in Directory.GetFiles(moduleFolder, "*.jpg", SearchOption.AllDirectories))
            {
                string title = imageFileName.Replace(validationFolder + "\\", "").Replace("\\", "/");
                html += "<h2>" + title.Replace(".jpg", "") + "</h2>";
                string imageURL = baseURL + "/ValidationGraphs/" + title;
                html += "<img src=\"" + imageURL + "\"/>";
            }

            return(html);
        }
Esempio n. 3
0
        protected void UploadButton_Click(object sender, EventArgs e)
        {
            bool Ok = AuthenticateSVNUser(UserNameTextBox.Text, PasswordTextBox.Text);

            InvalidLabel.Visible     = !Ok;
            DescriptionLabel.Visible = DescriptionTextBox.Text == "";
            PatchLabel.Visible       = FileUpload.FileName == "";
            if (Ok && DescriptionTextBox.Text != "" && FileUpload.FileName != "")
            {
                // Check the bug id.
                int PosHyphen = BugList.Text.IndexOf(" - ");
                if (PosHyphen == -1)
                {
                    throw new Exception("Bad BugID description: " + BugList.Text);
                }
                int BugID = Convert.ToInt32(BugList.Text.Substring(0, PosHyphen));

                // Write the file to the upload directory.
                string FileNameToWrite = @"D:\Websites\APSIM.Builds.Portal\Files\" + Path.GetFileNameWithoutExtension(FileUpload.FileName).Replace(" ", "") + "(" + DateTime.Now.ToString("dd-MM-yyyy_HH.mm.ss") + ").zip";

                // Write the zip file.
                FileStream ZipFile = new FileStream(FileNameToWrite, FileMode.CreateNew);
                FileUpload.FileContent.CopyTo(ZipFile);
                ZipFile.Close();

                string url = "http://apsimdev.apsim.info/APSIM.Builds.Service/BuildsClassic.svc/Add" +
                             "?UserName="******"&Password="******"&PatchFileName=" + Path.GetFileName(FileNameToWrite) +
                             "&Description=" + DescriptionTextBox.Text +
                             "&BugID=" + BugID +
                             "&DoCommit=" + CheckBox.Checked +
                             "&DbConnectPassword="******"/Bob.aspx");
            }
        }
Esempio n. 4
0
 protected void No_Click(object sender, EventArgs e)
 {
     Response.Redirect(Bob.GetBaseURL(Request.Url) + "/Bob.aspx");
 }