Exemplo n.º 1
0
        private void BindSegment()
        {
            BenQGuru.eMES.Common.Domain.IDomainDataProvider provider = null;
            try
            {
                this.drpSegment.Items.Clear();
                provider = base.DataProvider;

                BenQGuru.eMES.BaseSetting.BaseModelFacade facade = new BenQGuru.eMES.BaseSetting.BaseModelFacade(provider);
                object[] objs = facade.GetAllSegment();
                if (objs != null && objs.Length > 0)
                {
                    foreach (object obj in objs)
                    {
                        BenQGuru.eMES.Domain.BaseSetting.Segment seg = obj as BenQGuru.eMES.Domain.BaseSetting.Segment;
                        if (seg != null)
                        {
                            //this.drpSegment.Items.Add(new ListItem(seg.SegmentCode,seg.ShiftTypeCode));
                            this.drpSegment.Items.Add(seg.SegmentCode);
                        }
                    }
                }
            }
            finally
            {
                if (provider != null)
                {
                    ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)provider).PersistBroker.CloseConnection();
                }
            }
        }
Exemplo n.º 2
0
        protected override int GetRowCount()
        {
            BenQGuru.eMES.Common.Domain.IDomainDataProvider provider = null;
            try
            {
                provider = base.DataProvider;
                BenQGuru.eMES.Material.InventoryFacade facade = new InventoryFacade(provider);
                string no        = this.Session["FInvRCardQP_No"].ToString();
                string seq       = this.Session["FInvRCardQP_Seq"].ToString();
                string status    = this.Session["FInvRCardQP_Status"].ToString();
                string rcardfrom = this.Session["FInvRCardQP_From"].ToString();
                string rcardto   = this.Session["FInvRCardQP_To"].ToString();
                string datefrom  = this.Session["FInvRCardQP_DateFrom"].ToString();
                string dateto    = this.Session["FInvRCardQP_DateTo"].ToString();

                if (_type == "ship")
                {
                    return(facade.QueryInvShipRCardWebCount(no, seq, datefrom, dateto, rcardfrom, rcardto));
                }
                else
                {
                    return(facade.QueryInvRCardWebCount(no, seq, status, datefrom, dateto, rcardfrom, rcardto));
                }
            }
            finally
            {
                if (provider != null)
                {
                    BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider p = provider as BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider;
                    BenQGuru.eMES.Common.PersistBroker.OLEDBPersistBroker         b = p.PersistBroker as BenQGuru.eMES.Common.PersistBroker.OLEDBPersistBroker;
                    //b.CloseConnection();
                }
                //((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)provider).PersistBroker.CloseConnection();
            }
        }
Exemplo n.º 3
0
        protected override object[] LoadDataSource(int inclusive, int exclusive)
        {
            BenQGuru.eMES.Common.Domain.IDomainDataProvider provider = null;
            try
            {
                provider = base.DataProvider;
                BenQGuru.eMES.Material.InventoryFacade facade = new InventoryFacade(provider);
                string no        = this.Session["FInvRCardQP_No"].ToString();
                string seq       = this.Session["FInvRCardQP_Seq"].ToString();
                string status    = this.Session["FInvRCardQP_Status"].ToString();
                string rcardfrom = this.Session["FInvRCardQP_From"].ToString();
                string rcardto   = this.Session["FInvRCardQP_To"].ToString();
                string datefrom  = this.Session["FInvRCardQP_DateFrom"].ToString();
                string dateto    = this.Session["FInvRCardQP_DateTo"].ToString();

                if (_type == "ship")
                {
                    return(facade.QueryInvShipRCardWeb(no, seq, datefrom, dateto, rcardfrom, rcardto, inclusive, exclusive));
                }
                else
                {
                    return(facade.QueryInvRCardWeb(no, seq, status, datefrom, dateto, rcardfrom, rcardto, inclusive, exclusive));
                }
            }
            finally
            {
                //if(provider != null)
                //	((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)provider).PersistBroker.CloseConnection();
            }
        }
Exemplo n.º 4
0
        //Bind产品别下拉列表
        private void BindModel(BenQGuru.eMES.Common.Domain.IDomainDataProvider provider, UserControl.UCLabelCombox cbx)
        {
            cbx.ComboBoxData.Items.Clear();
            this.cbxItemCode.ComboBoxData.Items.Clear();
            this.txtItemDesc.InnerTextBox.Text = string.Empty;

            //只列出可入库的产品别
            object[] objs = new BenQGuru.eMES.Material.InventoryFacade(this.DataProvider).GetInventoryModel();
            if (objs != null)
            {
                foreach (object obj in objs)
                {
                    BenQGuru.eMES.Domain.MOModel.Model model = obj as BenQGuru.eMES.Domain.MOModel.Model;
                    if (model != null)
                    {
                        cbx.AddItem(model.ModelCode, model.ModelCode);
                    }
                }
            }
        }
Exemplo n.º 5
0
 private void BindShift()
 {
     BenQGuru.eMES.Common.Domain.IDomainDataProvider provider = null;
     try
     {
         provider = base.DataProvider;
         this.drpShift.Items.Clear();
         if (this.drpSegment.SelectedItem != null)
         {
             BenQGuru.eMES.BaseSetting.BaseModelFacade facade = new BenQGuru.eMES.BaseSetting.BaseModelFacade(provider);
             BenQGuru.eMES.Domain.BaseSetting.Segment  seg    = facade.GetSegment(this.drpSegment.SelectedItem.ToString()) as BenQGuru.eMES.Domain.BaseSetting.Segment;
             if (seg != null)
             {
                 //string shifttype = seg.ShiftTypeCode;
                 //object[] objs = provider.CustomQuery(typeof(Shift), new SQLCondition(string.Format("select {0} from TBLSHIFT where shifttypecode='{1}'order by SHIFTBTIME", DomainObjectUtility.GetDomainObjectFieldsString(typeof(Shift)),shifttype)));
                 object[] objs = (new ShiftModelFacade(base.DataProvider)).QueryShiftBySegment("", seg.SegmentCode, 0, int.MaxValue);
                 if (objs != null && objs.Length > 0)
                 {
                     foreach (object obj in objs)
                     {
                         Shift s = obj as BenQGuru.eMES.Domain.BaseSetting.Shift;
                         if (s != null)
                         {
                             this.drpShift.Items.Add(s.ShiftCode);
                         }
                     }
                 }
             }
         }
         this.drpShift.Items.Insert(0, new ListItem("所有", string.Empty));
     }
     finally
     {
         if (provider != null)
         {
             ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)provider).PersistBroker.CloseConnection();
         }
     }
 }
Exemplo n.º 6
0
        //bind 料品下拉列表
        private void BindItem(BenQGuru.eMES.Common.Domain.IDomainDataProvider provider, string model, UCLabelCombox cbx)
        {
            cbx.Clear();
            this.txtItemDesc.InnerTextBox.Text = string.Empty;
            if (provider == null || model == null || model == string.Empty)
            {
                return;
            }

            BenQGuru.eMES.MOModel.ModelFacade _facade = new BenQGuru.eMES.MOModel.ModelFacade(provider);
            object[] objs = _facade.GetModelAllItem(model);
            if (objs != null)
            {
                foreach (object obj in objs)
                {
                    BenQGuru.eMES.Domain.MOModel.Model2Item mo = obj as BenQGuru.eMES.Domain.MOModel.Model2Item;
                    if (mo != null)
                    {
                        cbx.AddItem(mo.ItemCode, mo.ItemCode);
                    }
                }
            }
        }
Exemplo n.º 7
0
        public int QueryFirstOnlineWebCount(BenQGuru.eMES.Common.Domain.IDomainDataProvider provider, string date, string dateto, string shift, string ss, string itemcode, string model, string seg)
        {
            string str = this.GetFirstOnlineWhere(date, dateto, shift, ss, itemcode, model, seg);

            return(provider.GetCount(new SQLCondition(string.Format("select count(*) c {0}", str))));
        }
Exemplo n.º 8
0
        public object[] QueryFirstOnlineWeb(BenQGuru.eMES.Common.Domain.IDomainDataProvider provider, string date, string dateto, string shift, string ss, string itemcode, string model, string seg, int inclusive, int exclusive)
        {
            string str = this.GetFirstOnlineWhere(date, dateto, shift, ss, itemcode, model, seg);

            return(provider.CustomQuery(typeof(FirstOnline), new PagerCondition(string.Format("select {0} {1}", DomainObjectUtility.GetDomainObjectFieldsString(typeof(FirstOnline)), str), "MDATE,SSCODE", inclusive, exclusive)));
        }
Exemplo n.º 9
0
        private void _helper_LoadGridDataSource(object sender, EventArgs e)
        {
            PageCheckManager manager = new PageCheckManager();

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return;
            }

            BenQGuru.eMES.Common.Domain.IDomainDataProvider provider = null;
            try
            {
                provider = base.DataProvider;

                WebQueryEventArgs we = e as WebQueryEventArgs;

                string shift;
                if (drpShift.SelectedValue == null)
                {
                    shift = string.Empty;
                }
                else
                {
                    shift = drpShift.SelectedValue.ToString();
                }

                if (shift == string.Empty)
                {
                    string[] shiftArray = new string[drpShift.Items.Count];
                    for (int i = 0; i < shiftArray.Length; i++)
                    {
                        shiftArray[i] = drpShift.Items[i].Value;
                    }
                    shift = FormatHelper.ProcessQueryValues(shiftArray);
                }
                else
                {
                    shift = FormatHelper.ProcessQueryValues(drpShift.SelectedValue);
                }
                object[] dataSource = QueryFirstOnlineWeb(provider,
                                                          this.txtDate.Text,
                                                          this.txtDateTo.Text,
                                                          shift,
                                                          this.txtSS.Text.Trim(),
                                                          this.txtItemCode.Text.Trim(),
                                                          txtModel.Text.Trim(),
                                                          this.drpSegment.SelectedValue,
                                                          we.StartRow,
                                                          we.EndRow);

                we.GridDataSource = dataSource;

                we.RowCount = QueryFirstOnlineWebCount(provider,
                                                       this.txtDate.Text,
                                                       this.txtDateTo.Text,
                                                       shift,
                                                       this.txtSS.Text.Trim(),
                                                       this.txtItemCode.Text.Trim(),
                                                       txtModel.Text.Trim(),
                                                       this.drpSegment.SelectedValue);
            }
            finally
            {
                if (provider != null)
                {
                    ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)provider).PersistBroker.CloseConnection();
                }
            }
        }
Exemplo n.º 10
0
        public Messages CKeyPartsCollect(XmlNode node)
        {
            string action = node.Attributes["action"].Value;
            string card   = node["code"].InnerText;
            string res    = node["resource"].InnerText;
            string usr    = node["user"].InnerText;
            string data   = node["data"].InnerText;

            string[] ss          = data.Split(';');
            string   MOSplitRule = node["MOSplitRule"].InnerText;

            Messages productmessages = new Messages();

            try
            {
                //数据准备
                productmessages.AddMessages(dataCollect.GetIDInfo(card));
                ProductInfo product;
                if (productmessages.IsSuccess())
                {
                    product = (ProductInfo)productmessages.GetData().Values[0];
                }
                else
                {
                    return(productmessages);
                }

                #region 先推途程,然后找OPBOM


                productmessages.AddMessages(dataCollect.CheckID(new CKeypartsActionEventArgs(
                                                                    ActionType.DataCollectAction_CollectKeyParts, card, usr,
                                                                    res, product, null)));

                if (productmessages.IsSuccess())
                {
                }
                else
                {
                    return(productmessages);
                }
                OPBomKeyparts opBomKeyparts;
                try
                {
                    BenQGuru.eMES.Common.Domain.IDomainDataProvider _provider = _provider = BenQGuru.eMES.Common.DomainDataProvider.DomainDataProviderManager.DomainDataProvider();
                    OPBOMFacade opBOMFacade = new OPBOMFacade(_provider);
                    opBomKeyparts = new OPBomKeyparts(opBOMFacade.GetOPBOMDetails(product.NowSimulation.MOCode,
                                                                                  product.NowSimulation.RouteCode, product.NowSimulation.OPCode), Convert.ToInt32(MOSplitRule), this.DataProvider);
                    if (opBomKeyparts.Count == 0)
                    {
                        productmessages.Add(new Message("$CS_NOOPBomInfo $CS_Param_MOCode=" + product.NowSimulation.MOCode
                                                        + " $CS_Param_RouteCode=" + product.NowSimulation.RouteCode
                                                        + " $CS_Param_OPCode=" + product.NowSimulation.OPCode));

                        return(productmessages);
                    }
                    #endregion

                    for (int i = 0; i < ss.Length; i++)
                    {
                        opBomKeyparts.AddKeyparts(ss[i].ToUpper());
                    }
                }
                catch (Exception e)
                {
                    productmessages.Add(new Message(e));
                    return(productmessages);
                }
                productmessages.AddMessages(dataCollect.Action(new CKeypartsActionEventArgs(action, card,
                                                                                            usr, res, product, opBomKeyparts)));
                //检查数据
                if (productmessages.IsSuccess())
                {
                    DataCollectFacade df = new DataCollectFacade();
                    Simulation        s2 = (Simulation)df.GetSimulation(card);
                    if (s2 == null)
                    {
                        productmessages.Add(new Message(MessageType.Error,
                                                        "天拉"));
                        return(productmessages);
                    }
                }
                else
                {
                    return(productmessages);
                }
                return(productmessages);
            }
            catch (Exception e)
            {
                productmessages.Add(new Message(e));
                return(productmessages);
            }
        }