Exemplo n.º 1
0
        private void _helper_DomainObjectToGridRow(object sender, EventArgs e)
        {
            BenQGuru.eMES.Common.Domain.IDomainDataProvider provider = null;
            try
            {
                provider = base.DataProvider;
                BenQGuru.eMES.Material.InventoryFacade facade = new InventoryFacade(provider);

                if ((e as DomainObjectToGridRowEventArgs).DomainObject != null)
                {
                    BenQGuru.eMES.Domain.Material.InvReceive obj = (e as DomainObjectToGridRowEventArgs).DomainObject as BenQGuru.eMES.Domain.Material.InvReceive;
                    if (obj != null)
                    {
                        /*int sum = facade.QueryInvReceiveWebSum(obj.RecNo,
                         *                                                      obj.RecSeq,
                         *                                                      this.drpStatus.SelectedValue,
                         *                                                      this.dateInDateFromQuery.Text,
                         *                                                      this.dateInDateToQuery.Text,
                         *                                                      this.txtModel.Text.Trim(),
                         *                                                      this.txtItemCode.Text.Trim(),
                         *                                                      this.txtRCardFrom.Text.Trim(),
                         *                                                      this.txtRCardTo.Text
                         *                                                      );*/

                        (e as DomainObjectToGridRowEventArgs).GridRow =
                            new UltraGridRow(new object[] {
                            obj.RecNo,
                            obj.RecSeq,
                            obj.RecType,
                            obj.ModelCode,
                            obj.ItemCode,
                            obj.ItemDesc,
                            GetReceiveStausName(obj.RecStatus),
                            obj.PlanQty,
                            obj.ActQty,
                            obj.Description,
                            string.Empty
                        }
                                             );
                    }
                }
            }
            finally
            {
                if (provider != null)
                {
                    ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)provider).PersistBroker.CloseConnection();
                }
            }
        }
Exemplo n.º 2
0
        private void _helper_DomainObjectToExportRow(object sender, EventArgs e)
        {
            if (!this.chbExpDetail.Checked)
            {
                #region  导出二级界面
                BenQGuru.eMES.Common.Domain.IDomainDataProvider provider = null;
                try
                {
                    provider = base.DataProvider;
                    BenQGuru.eMES.Material.InventoryFacade facade = new InventoryFacade(provider);
                    if ((e as DomainObjectToExportRowEventArgs).DomainObject != null)
                    {
                        BenQGuru.eMES.Domain.Material.InvReceive obj = (e as DomainObjectToExportRowEventArgs).DomainObject as BenQGuru.eMES.Domain.Material.InvReceive;

                        /*int sum = facade.QueryInvReceiveWebSum(obj.RecNo,
                         *      obj.RecSeq,
                         *      this.drpStatus.SelectedValue,
                         *      this.dateInDateFromQuery.Text,
                         *      this.dateInDateToQuery.Text,
                         *      this.txtModel.Text.Trim(),
                         *      this.txtItemCode.Text.Trim(),
                         *      this.txtRCardFrom.Text.Trim(),
                         *      this.txtRCardTo.Text);*/


                        (e as DomainObjectToExportRowEventArgs).ExportRow =
                            new string[] {
                            obj.RecNo,
                            obj.RecType,
                            obj.ModelCode,
                            obj.ItemCode,
                            obj.ItemDesc,
                            GetReceiveStausName(obj.RecStatus),
                            obj.PlanQty.ToString(),
                            obj.ActQty.ToString(),
                            obj.Description,
                            string.Empty
                        };
                    }
                }
                finally
                {
                    if (provider != null)
                    {
                        ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)provider).PersistBroker.CloseConnection();
                    }
                }
                #endregion
            }
            else
            {
                #region 导出二级界面
                BenQGuru.eMES.Common.Domain.IDomainDataProvider provider = null;
                try
                {
                    provider = base.DataProvider;
                    BenQGuru.eMES.Material.InventoryFacade facade = new InventoryFacade(provider);
                    if ((e as DomainObjectToExportRowEventArgs).DomainObject != null)
                    {
                        BenQGuru.eMES.Domain.Material.ReceiveRCard obj = (e as DomainObjectToExportRowEventArgs).DomainObject as BenQGuru.eMES.Domain.Material.ReceiveRCard;

                        (e as DomainObjectToExportRowEventArgs).ExportRow =
                            new string[] {
                            obj.RecNo,
                            obj.RecType,
                            obj.ModelCode,
                            obj.ItemCode,
                            obj.ItemDesc,
                            GetReceiveStausName(obj.RecStatus),
                            obj.ActQty.ToString(),
                            obj.Description,
                            obj.RunningCard,
                            RCardStatus.GetName(obj.RCardStatus),
                            obj.ReceiveUser,
                            FormatHelper.ToDateString(obj.ReceiveDate),
                            obj.CartonCode
                        };
                    }
                }
                finally
                {
                    if (provider != null)
                    {
                        ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)provider).PersistBroker.CloseConnection();
                    }
                }
                #endregion
            }
        }