Exemplo n.º 1
0
        protected void Finalize_Click(object sender, EventArgs e)
        {
            //Generate report
            //sort assets in list into groups of OrderNumber
            var                  list      = (from a in Session["CheckIn"] as List <Asset> select a.OrderNumber).Distinct().ToList();
            List <Asset>         finalized = new List <Asset>();
            List <string>        filenames = new List <string>();
            List <List <Asset> > subEmails = new List <List <Asset> >();

            foreach (var number in list)
            {
                var sublist = (from a in Session["CheckIn"] as List <Asset> where a.OrderNumber == number select a).ToList();
                var files   = CreateReceivingReport(sublist);
                SaveToUserPersistantLog();
                filenames.AddRange(files);
                finalized.AddRange(sublist);
                subEmails.Add(sublist);
            }
            FinalizeCheckIn(finalized);
            Session["CheckInReportFileNameList"] = filenames;
            //combine all reports into one and display
            CombineReports(filenames);
            ReportIcon.Shake();
            CheckInMultiView.ActiveViewIndex = 1;
            if (!Global.Library.Settings.TESTMODE)
            {
                Finalize.Enabled = false;
                NotifyCheckInEmail(subEmails);
            }
        }
Exemplo n.º 2
0
        private void createEntity(string msg, ReportIcon ri)
        {
            Label lb = new Label();
            lb.Content = msg;
            Image image = new Image();
            image.Width = 15;
            image.Height = 15;
            // Create source.
            BitmapImage bi = new BitmapImage();
            bi.BeginInit();

            if (ri == ReportIcon.Error)
                bi.UriSource = new Uri(@"/Images/Error.png", UriKind.RelativeOrAbsolute);
            else if (ri == ReportIcon.OK)
                bi.UriSource = new Uri(@"/Images/ok.png", UriKind.RelativeOrAbsolute);
            else if (ri == ReportIcon.Warning)
                bi.UriSource = new Uri(@"/Images/Warning.png", UriKind.RelativeOrAbsolute);
            else if (ri == ReportIcon.Info)
                bi.UriSource = new Uri(@"/Images/Info.png", UriKind.RelativeOrAbsolute);

            bi.EndInit();
            // Set the image source.
            image.Source = bi;

            this.Children.Add(image);
            this.Children.Add(lb);
        }
Exemplo n.º 3
0
        public void log(string s,ReportIcon ri)
        {
            //get time
            string timestr = DateTime.Now.ToString("h:mm tt - ");
            //create a log element to be shown
            LogEntity le = new LogEntity(timestr+s,ri);
            //this.AddChild(le);
            this.Items.Insert(0, le);

            //create log event to be saved to file
            logs.Add(System.DateTime.Now.ToString() + " -> " + s);
        }
Exemplo n.º 4
0
        private void createMessage(string msg, ReportIcon ri)
        {
            clearReportMessage();

            Label lb = new Label();
            lb.Content = msg;

            StackPanel sb = new StackPanel();
            sb.Orientation = Orientation.Horizontal;

            Image image = new Image();
            image.Width = 25;
            image.Height = 25;
            // Create source.
            BitmapImage bi = new BitmapImage();
            bi.BeginInit();

            switch (ri){

                case(ReportIcon.Error):
                    bi.UriSource = new Uri(@"/Images/Error.png", UriKind.RelativeOrAbsolute);
                    break;
                case (ReportIcon.Busy):
                    bi.UriSource = new Uri(@"/Images/loading.gif", UriKind.RelativeOrAbsolute);
                    break;
                case(ReportIcon.OK):
                    bi.UriSource = new Uri(@"/Images/ok.png", UriKind.RelativeOrAbsolute);
                    break;
                case(ReportIcon.Warning):
                    bi.UriSource = new Uri(@"/Images/Warning.png", UriKind.RelativeOrAbsolute);
                    break;
                case(ReportIcon.Info):
                    bi.UriSource = new Uri(@"/Images/Info.png", UriKind.RelativeOrAbsolute);
                    break;
                default:
                    bi.UriSource = new Uri(@"/Images/Warning.png", UriKind.RelativeOrAbsolute);
                    break;
            }
            bi.EndInit();
            // Set the image source.
            image.Source = bi;

            sb.Children.Add(image);
            sb.Children.Add(lb);

            this.Items.Add(sb);
        }
Exemplo n.º 5
0
 public void ShowStatus(string p, ReportIcon reportIcon)
 {
     if (this.ParentWindow != null)
     {
         if (this.ParentWindow is Mapper)
             (ParentWindow as Mapper).ReportStatusBar.ShowStatus(p, reportIcon);
         if (this.ParentWindow is Visualiser)
             (ParentWindow as Visualiser).ReportStatusBar.ShowStatus(p, reportIcon);
     }
 }
Exemplo n.º 6
0
 public void reportMessage(string msg, ReportIcon ri)
 {
     ReportStatusBar.ShowStatus(msg, ri);
 }
Exemplo n.º 7
0
 public void ShowStatus(string msg, ReportIcon reportIcon)
 {
     createMessage(msg, reportIcon);
 }
Exemplo n.º 8
0
 protected void ReportViewBtn_Click(object sender, EventArgs e)
 {
     ReportIcon.Quiet();
     CheckInMultiView.ActiveViewIndex = 1;
 }
Exemplo n.º 9
0
 public LogEntity(String s, ReportIcon ri)
 {
     this.Orientation = Orientation.Horizontal;
     createEntity(s, ri);
 }