private void LoadLayout_Load(object sender, EventArgs e)
 {
     try
     {
         Address = string.Format(@"{0}\Layouts\{1}\{2}", GlobalVariables.LayoutLocation, GlobalVariables.CurrentUser, ReportName);
         if (Directory.Exists(Address))
         {
             var df = new DirectoryInfo(Address);
             var fl = df.GetFiles("*.xml");
             foreach (FileInfo f in fl)
             {
                 FileName.Properties.Items.Add(f.Name);
             }
             if (FileName.Properties.Items.Count == 0)
             {
                 ProjectFunctions.SpeakError("No Saved Layouts.");
             }
         }
         ProjectFunctions.EventTracker("Load Report Layout Process Ended");
     }
     catch (Exception ex)
     {
         ProjectFunctions.SpeakError("Unable to Load Layouts.\n" + ex.Message);
     }
 }
Beispiel #2
0
        private void SaveBtn_Click(object sender, EventArgs e)
        {
            try
            {
                if (FileName.Text == string.Empty)
                {
                    ProjectFunctions.SpeakError("Please Enter Layout Name to Proceed");
                    return;
                }

                Address = string.Format(@"{0}\Layouts\{1}\{2}", GlobalVariables.LayoutLocation, GlobalVariables.CurrentUser, ReportName);
                if (!Directory.Exists(Address))
                {
                    Directory.CreateDirectory(Address);
                }
                Address = string.Format(@"{0}\Layouts\{1}\{2}\{3}.xml", GlobalVariables.LayoutLocation, GlobalVariables.CurrentUser, ReportName, FileName.Text);
                PGC.SaveLayoutToXml(Address);
                ProjectFunctions.EventTracker("Save Report Layout Process Ended");
            }
            catch (Exception ex)
            {
                ProjectFunctions.SpeakError("Unable to Save Layout.\n" + ex.Message);
            }
            Hide();
        }
 void Button_ItemClick(object sender, ItemClickEventArgs e)
 {
     ProjectFunctions.EventTracker("Program Started");
     RunProg(e.Item.Name);
 }