Ejemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string _patchTitle      = txtPatchTitle.Text;
            string _patchDesc       = txtPatchDesc.Text;
            string _patchNumber     = txtPatchNumber.Text;
            string _patchDeployedBy = txtPatchDeployedBy.Text;
            int    _patchQATested   = checkIsQAPassedYes.Checked == true ? 1 : 0;

            _patchQATested = checkIsQAPassedNo.Checked == true ? 0 : 1;
            string _patchDependency    = txtPatchDependency.Text;
            int    _patchClientID      = Convert.ToInt32(dropPatchClientName.SelectedItem.Value);
            int    _patchProductID     = Convert.ToInt32(dropProductName.SelectedItem.Value);
            int    _patchEnvironmentID = Convert.ToInt32(dropEnvironmentType.SelectedItem.Value);

            Debug.WriteLine("Patch Title: " + _patchTitle);
            Debug.WriteLine("Patch Description: " + _patchDesc);
            Debug.WriteLine("Patch Number: " + _patchNumber);
            Debug.WriteLine("Patch Deployed By: " + _patchDeployedBy);
            Debug.WriteLine("Patch QA Passed " + _patchQATested);
            Debug.WriteLine("Patch Dependency " + _patchDependency);
            Debug.WriteLine("Patch Client ID " + _patchClientID);
            Debug.WriteLine("Patch Product ID: " + _patchProductID);
            Debug.WriteLine("Patch Environment ID: " + _patchEnvironmentID);

            DatabaseConnectivity db = new DatabaseConnectivity();
            int res = db.insertPatch(_patchTitle, _patchDesc, _patchNumber, _patchDeployedBy, Convert.ToDateTime(txtPatchCreatedDate.Text), Convert.ToDateTime(txtPatchDeployedDate.Text), _patchQATested, _patchDependency, _patchClientID, _patchProductID, _patchEnvironmentID);

            Debug.WriteLine("Query Result: " + res);
            rowPatchTitle.Visible        = false;
            rowPatchDesc.Visible         = false;
            rowPatchNumber.Visible       = false;
            rowPatchDeployedBy.Visible   = false;
            rowPatchCreatedDate.Visible  = false;
            rowPatchDeployedDate.Visible = false;
            rowPatchIsQAPassed.Visible   = false;
            rowPatchDependency.Visible   = false;
            rowPatchClientName.Visible   = false;
            rowProductName.Visible       = false;
            rowEnvironmentType.Visible   = false;
            rowSubmit.Visible            = false;
            lblSubmission.Visible        = true;
            lblSubmission.Text           = "Release has been saved with the Response Code: " + (res == 1 ? "0200 OK." : "0500 Error.");
        }