Example #1
0
        private void LoadMenu(string userid)
        {
            slAmidaConsole.Web.EQ_DomainContext db = new Web.EQ_DomainContext();

            EntityQuery< vwUserMenuAllow> qry = from n in db.GetVwUserMenuAllowQuery() where n.UserID == userid && n.IsAllow select n;
            LoadOperation<vwUserMenuAllow> lo = db.Load<vwUserMenuAllow>(qry);
            lo.Completed += (s, a) =>
                {
                    if (lo.Error != null)
                    {
                        MessageBox.Show(lo.Error.Message);
                        return;

                    }

                    MenuInfos = new System.Collections.ObjectModel.ObservableCollection<vwUserMenuAllow>(lo.Entities);

                    var q = (from n in MenuInfos group n by new { n.GroupName, n.MenuOrder} into gn select new MenuInfo { MainMenu = gn.Key.GroupName, MenuOrder=gn.Key.MenuOrder, Menus = gn.ToList<vwUserMenuAllow>() }).OrderBy(x=>x.MenuOrder);
                    this.accordin.ItemsSource = q.ToList<MenuInfo>();
                    //    var MainMenus = (from n in MenuInfos select n.GroupName).Distinct<string>();

                //    foreach (string mainmenu in MainMenus)
                //    {
                //        AccordionItem item = new AccordionItem() { Header = mainmenu };
                //        var q = from n in MenuInfos where n.GroupName == mainmenu select n;
                //        item.DataContext = q;
                //        this.accordin.Items.Add (item);

                //    }

                };
        }
Example #2
0
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     Uri  uri = new Uri(App.Current.Host.Source + "/../../DownLoadForm.aspx?rptid=4");
       InvokeOperation<slAmidaConsole.Web.RptSchema.rptCurrentWIPSchema[]> lo = null;
       slAmidaConsole.Web.EQ_DomainContext client = new EQ_DomainContext();
       lo = client.GetCurrentWIP();
       this.BusyIndicator1.IsBusy = true;
       lo.Completed += (s, a) =>
       {
           this.BusyIndicator1.IsBusy = false;
           this.dataGrid1.ItemsSource = lo.Value;
       };
       HtmlWindow html = HtmlPage.Window;
       if (chkDownload.IsChecked == true)
       html.Navigate(uri);
 }
Example #3
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            EQ_DomainContext context = new EQ_DomainContext();

            this.busyIndicator1.IsBusy = true;
            EntityQuery<tblUser> q = (from n in context.GetTblUserQuery() where n.UserID == txtUserID.Text && n.Password == txtPassword.Password select n);

            LoadOperation<tblUser> lo = context.Load<tblUser>(q);
            lo.Completed += (s, a) =>
            {
                if (lo.Error != null)
                {
                    MessageBox.Show(lo.Error.Message);
                    this.busyIndicator1.IsBusy = false;
                    return;
                }

                tblUser user = lo.Entities.FirstOrDefault<tblUser>();
                if (user == null)
                {
                    MessageBox.Show("帳號密碼錯誤 !");
                    this.busyIndicator1.IsBusy = false;
                    return;
                };

               // slDBManager.WebContext client = new WebContext();

                WebService.WebServiceSoapClient client = new WebService.WebServiceSoapClient();

                client.RegisterSessionCompleted += (ss, aa) =>
                {
                    if (aa.Error != null)
                    {
                        MessageBox.Show(aa.Error.Message);
                        this.busyIndicator1.IsBusy = false;
                        return;
                    }
                    this.busyIndicator1.IsBusy = true;
                    this.NavigationService.Navigate(new Uri("/EqManager.xaml?userid="+user.UserID+"&username="+user.UserName,UriKind.Relative));

                };

                client.RegisterSessionAsync(user.UserID);

            };
        }
Example #4
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            string wherestr="";
            slAmidaConsole.Web.EQ_DomainContext client =new EQ_DomainContext();

            //var q = from n in client.GetTblVerifyNoteQuery() where n.StartTimes == new DateTime(2013, 1, 1) select n; ;
            //client.Load(q);

            if (txtPCMASK.Text.Trim() != "")
                wherestr += " it.PCID like '" + txtPCMASK.Text + "%' and";

            if (txtPCShape.Text.Trim() != "")
            {
                int res;

                if (!int.TryParse(txtPCShape.Text,out res))
                {
                    MessageBox.Show("ProbeShape must be integer!");
                    return;

                }
                wherestr += " it.ProbeShape=" + txtPCShape.Text.Trim() + " and";

            }
            int datecnt = 0;
            if (txtStartDate.Text.Trim() != "" && txtStopDate.Text.Trim() != "")
            {
                DateTime res;
                if (!DateTime.TryParse(txtStartDate.Text.Trim(), out res))
                {
                    MessageBox.Show("Start Date format error!");
                    return;
                }
                if (!DateTime.TryParse(this.txtStopDate.Text.Trim(), out res))
                {
                    MessageBox.Show("End Date format error!");
                    return;
                }
                datecnt = 2;
                wherestr += string.Format("  it.StartTimes >= @p0 and it.StartTimes <@p1 and it.stoptimes >=@p0 and it.stoptimes <@p1  and");
            }
            else if (txtStartDate.Text.Trim() != "" && txtStopDate.Text.Trim() == "")
            {
                DateTime res;
                if (!DateTime.TryParse(txtStartDate.Text.Trim(), out res))
                {
                    MessageBox.Show("Start Date format error!");
                    return;
                }
                datecnt = 1;
                wherestr += string.Format("  it.StartTimes >= @p0   and");

            }
            else if (txtStartDate.Text.Trim() == "" && txtStopDate.Text.Trim() != "")
            {
                DateTime res;
                if (!DateTime.TryParse(txtStartDate.Text.Trim(), out res))
                {
                    MessageBox.Show("Start Date format error!");
                    return;
                }
                datecnt = 1;
                wherestr += string.Format("  it.stoptimes < @p1   and");

            }

               wherestr= wherestr.TrimEnd(new char[] { 'a', 'n', 'd' });

               Uri uri;

            InvokeOperation<slAmidaConsole.Web.RptSchema.RptTouchDownSchema[]> lo=null;
            if (datecnt == 2)
            {
                lo = client.GetTouchDownTotalBySql(wherestr, DateTime.Parse(txtStartDate.Text), DateTime.Parse(txtStopDate.Text));
                uri = new Uri(App.Current.Host.Source + "/../../DownLoadForm.aspx?rptid=1&wherestr="+wherestr+"&starttimes=" + txtStartDate.Text.Trim() + "&stoptimes=" + txtStopDate.Text.Trim());
            }
            else if (datecnt == 1)
            {
                if(txtStartDate.Text.Trim()=="")
                {
                    lo = client.GetTouchDownTotalBySql(wherestr, DateTime.MinValue, DateTime.Parse(txtStopDate.Text));
                    uri = new Uri(App.Current.Host.Source + "/../../DownLoadForm.aspx?rptid=1&wherestr=" + wherestr + "&starttimes=" + txtStartDate.Text.Trim() + "&stoptimes=" + DateTime.MaxValue.ToShortDateString());

                }
                else
                 {
                lo = client.GetTouchDownTotalBySql(wherestr, DateTime.Parse(txtStartDate.Text), DateTime.MaxValue);
                uri = new Uri(App.Current.Host.Source + "/../../DownLoadForm.aspx?rptid=1&wherestr="+wherestr+"&starttimes=" + txtStartDate.Text.Trim() + "&stoptimes=" + DateTime.MaxValue.ToShortDateString());
                  }
            }
            else
            {
                lo = client.GetTouchDownTotalBySql(wherestr, DateTime.MinValue, DateTime.MaxValue);
                uri = new Uri(App.Current.Host.Source + "/../../DownLoadForm.aspx?rptid=1&wherestr="+wherestr +"&starttimes=" + DateTime.MinValue.ToShortDateString() + "&stoptimes=" + DateTime.MaxValue.ToShortDateString());

            }
            this.BusyIndicator1.IsBusy = true;
            lo.Completed += (s, a) =>
                {
                    this.BusyIndicator1.IsBusy = false ;
                    this.dataGrid1.ItemsSource = lo.Value;
                    if(IsShowChart)
                        (this.chart1.Series[0] as ColumnSeries).ItemsSource = lo.Value;
                };

            HtmlWindow html = HtmlPage.Window;
            if (chkDownload.IsChecked == true)
            {
               // MessageBox.Show(uri.ToString());

                html.Navigate(uri);
            }
               // WebClient webclient = new WebClient();
              //  webclient.OpenReadAsync(uri);
               // Uri uri = App.Current.Host.Source.MakeRelativeUri("../../DownloadForm.aspx");
              //  webclient.OpenReadAsync(new Uri().);

            //   var exp = PredicateBuilder.True<tblVerifyNote>().And<tblVerifyNote>(n=>n.StartTimes>=new DateTime(2013,4,16));

             // exp = exp.And<tblVerifyNote>(n => n.StartTimes >= new DateTime(2013, 4, 16) && n.StartTimes <= new DateTime(2013, 4, 16));

            //EntityQuery<slAmidaConsole.Web.> q
            // = client.GetTblVerifyNoteBySqlQuery("").Take(3600);
             //  client.GetTblVerifyNoteQuery().Where<tblVerifyNote>(n=>n.PCID.StartsWith("AE385"));

               // LoadOperation<slAmidaConsole.Web.tblVerifyNote> lo
               //     = client.Load<slAmidaConsole.Web.tblVerifyNote>(q);
               //// EntityQuery<tblVerifyNote> lo1 = client.GetTblVerifyNoteBySqlQuery("it.PCID like 'AE385%'");

               // lo.Completed += (s, a) =>
               //     {
               //         if (lo.HasError)
               //         {
               //             MessageBox.Show(lo.Error.Message);
               //             return;
               //         }
               //         this.dataGrid1.ItemsSource = lo.Entities;
               //     };
        }
Example #5
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            //   string wherestr = "";
            slAmidaConsole.Web.EQ_DomainContext client = new EQ_DomainContext();

            if (this.txtWaferMask.Text.Trim() == "")
            {
                MessageBox.Show("WaferMask must not be empty!");
                return;
            }

            int datecnt = 0;
            if (txtStartDate.Text.Trim() != "" && txtStopDate.Text.Trim() != "")
            {
                DateTime res;
                if (!DateTime.TryParse(txtStartDate.Text.Trim(), out res))
                {
                    MessageBox.Show("Start Date format error!");
                    return;
                }
                if (!DateTime.TryParse(this.txtStopDate.Text.Trim(), out res))
                {
                    MessageBox.Show("End Date format error!");
                    return;
                }
                datecnt = 2;

            }
            else if (txtStartDate.Text.Trim() != "" && txtStopDate.Text.Trim() == "")
            {
                DateTime res;
                if (!DateTime.TryParse(txtStartDate.Text.Trim(), out res))
                {
                    MessageBox.Show("Start Date format error!");
                    return;
                }
                datecnt = 1;

            }

            Uri uri;

            InvokeOperation<slAmidaConsole.Web.RptSchema.rptYieldVSRCPSchema[]> lo = null;
            if (datecnt == 2)
            {
                lo = client.GetYieldVSRCP(txtWaferMask.Text.Trim(),txtRCP.Text.Trim(), DateTime.Parse(txtStartDate.Text), DateTime.Parse(txtStopDate.Text));
                uri = new Uri(App.Current.Host.Source + "/../../DownLoadForm.aspx?rptid=6&maskid=" + txtWaferMask.Text.Trim() + "&starttimes=" + txtStartDate.Text.Trim() + "&stoptimes=" + txtStopDate.Text.Trim() + "&rcp=" + txtRCP.Text.Trim());
            }
            else if (datecnt == 1)
            {
                lo = client.GetYieldVSRCP(txtWaferMask.Text.Trim(), txtRCP.Text, DateTime.Parse(txtStartDate.Text), DateTime.MaxValue);
                uri = new Uri(App.Current.Host.Source + "/../../DownLoadForm.aspx?rptid=6&maskid=" + txtWaferMask.Text + "&starttimes=" + txtStartDate.Text.Trim() + "&stoptimes=" + DateTime.MaxValue.ToShortDateString() + "&rcp=" + txtRCP.Text.Trim());
            }
            else
            {
                lo = client.GetYieldVSRCP(txtWaferMask.Text.Trim(), txtRCP.Text, new DateTime(1900, 1, 1), DateTime.Now.Date);
                uri = new Uri(App.Current.Host.Source + "/../../DownLoadForm.aspx?rptid=6&maskid=" + txtWaferMask.Text.Trim() + "&starttimes=" + new DateTime(1900, 1, 1).ToShortDateString() + "&stoptimes=" + DateTime.MaxValue.ToShortDateString() + "&rcp=" + txtRCP.Text.Trim());

            }
            this.BusyIndicator1.IsBusy = true;
            lo.Completed += (s, a) =>
            {
                this.BusyIndicator1.IsBusy = false;
                this.dataGrid1.ItemsSource = lo.Value;
                if (IsShowChart)
                {
                    (this.chart1.Series[0] as LineSeries).ItemsSource = lo.Value;
                    (this.chart1.Series[1] as ColumnSeries).ItemsSource = lo.Value;
                    (this.chart1.Series[2] as LineSeries).ItemsSource = lo.Value;
                }
            };

            HtmlWindow html = HtmlPage.Window;
            if (chkDownload.IsChecked == true)
            {
                // MessageBox.Show(uri.ToString());

                html.Navigate(uri);
            }
        }
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            string wherestr = "";
            slAmidaConsole.Web.EQ_DomainContext client = new EQ_DomainContext();

            //var q = from n in client.GetTblVerifyNoteQuery() where n.StartTimes == new DateTime(2013, 1, 1) select n; ;
            //client.Load(q);

            if (txtOperator.Text.Trim() != "")
                wherestr += " it.operator like '" + this.txtOperator.Text + "%' and";

            //if (txtPCShape.Text.Trim() != "")
            //{
            //    int res;

            //    if (!int.TryParse(txtPCShape.Text, out res))
            //    {
            //        MessageBox.Show("ProbeShape must be integer!");
            //        return;

            //    }
            //    wherestr += " it.ProbeShape=" + txtPCShape.Text.Trim() + " and";

            //}
            int datecnt = 0;
            if (txtStartDate.Text.Trim() != "" && txtStopDate.Text.Trim() != "")
            {
                DateTime res;
                if (!DateTime.TryParse(txtStartDate.Text.Trim(), out res))
                {
                    MessageBox.Show("Start Date format error!");
                    return;
                }
                if (!DateTime.TryParse(this.txtStopDate.Text.Trim(), out res))
                {
                    MessageBox.Show("End Date format error!");
                    return;
                }
                datecnt = 2;
                wherestr += string.Format("  it.Start_Time >= @p0 and it.Start_Time <@p1 and it.stop_time >=@p0 and it.stop_time <@p1  and");
            }
            else if (txtStartDate.Text.Trim() != "" && txtStopDate.Text.Trim() == "")
            {
                DateTime res;
                if (!DateTime.TryParse(txtStartDate.Text.Trim(), out res))
                {
                    MessageBox.Show("Start Date format error!");
                    return;
                }
                datecnt = 1;
                wherestr += string.Format("  it.Start_Time >= @p0   and");

            }

            wherestr = wherestr.TrimEnd(new char[] { 'a', 'n', 'd' });

            Uri uri;

            InvokeOperation<slAmidaConsole.Web.RptSchema.rptPerformanceSchema[]> lo = null;
            if (datecnt == 2)
            {
                lo = client.GetPerformanceTotalBySql(wherestr, DateTime.Parse(txtStartDate.Text), DateTime.Parse(txtStopDate.Text));
                uri = new Uri(App.Current.Host.Source + "/../../DownLoadForm.aspx?rptid=2&wherestr=" + wherestr + "&starttimes=" + txtStartDate.Text.Trim() + "&stoptimes=" + txtStopDate.Text.Trim());
            }
            else if (datecnt == 1)
            {
                lo = client.GetPerformanceTotalBySql(wherestr, DateTime.Parse(txtStartDate.Text), DateTime.MaxValue);
                uri = new Uri(App.Current.Host.Source + "/../../DownLoadForm.aspx?rptid=2&wherestr=" + wherestr + "&starttimes=" + txtStartDate.Text.Trim() + "&stoptimes=" + DateTime.MaxValue.ToShortDateString());
            }
            else
            {
                lo = client.GetPerformanceTotalBySql(wherestr, DateTime.MinValue, DateTime.MaxValue);
                uri = new Uri(App.Current.Host.Source + "/../../DownLoadForm.aspx?rptid=2&wherestr=" + wherestr + "&starttimes=" + DateTime.MinValue.ToShortDateString() + "&stoptimes=" + DateTime.MaxValue.ToShortDateString());

            }
            this.BusyIndicator1.IsBusy = true;
            lo.Completed += (s, a) =>
            {
                if (lo.Error != null)
                {
                    MessageBox.Show(lo.Error.Message);
                    return;
                }
                this.BusyIndicator1.IsBusy = false;
                this.dataGrid1.ItemsSource = lo.Value;
                if (IsShowChart)
                    (this.chart1.Series[0] as ColumnSeries).ItemsSource = lo.Value;
            };

            HtmlWindow html = HtmlPage.Window;
            if (chkDownload.IsChecked == true)
                html.Navigate(uri);
        }