Esempio n. 1
0
        private void LoadData()
        {
            List <InventoryMovementInqUIDM> listModel = null;

            //if (m_lotNo.StrongValue == Common.LOT_NO_GROUPBY)
            if (m_QueryType == 1)//Query Type = 1 แปลว่า Group ตาม Item
            {
                // Load all movement.
                listModel = m_inventoryMovementInqController.LoadDataInventoryMovementInquiry(YearMonth, PeriodBeginDate, PeriodEndDate, ItemCode, WareHouseCode, m_lotNo);
            }
            else
            {
                // Load movement only LotNo.
                listModel = m_inventoryMovementInqController.LoadDataInventorymovementInquiryByLotNo(YearMonth, PeriodBeginDate, PeriodEndDate, ItemCode, WareHouseCode, m_lotNo, m_packNo);
            }

            DataTable dataTable = DTOUtility.ConvertListToDataTable(listModel);

            shtView.DataSource = dataTable;

            if (dataTable.Rows.Count > 0)
            {
                shtView.Cells[0, (int)eColView.TRANS_INFO].CellType = new FarPoint.Win.Spread.CellType.TextCellType();
                txtOnHandQty.Text = CtrlUtil.GetCompleteNumberFormatValue(txtOnHandQty.MaxDecimalPlaces, listModel[listModel.Count - 1].BALANCE);// listModel[listModel.Count - 1].BALANCE.StrongValue.ToString();
            }
            else
            {
                txtOnHandQty.PathValue = 0;
            }

            CtrlUtil.SpreadUpdateColumnSorting(shtView);
        }
Esempio n. 2
0
        private void LoadShipList()
        {
            dmcShip.LoadData(m_uidm);

            if (m_Mode == Common.eScreenMode.ADD)
            {
                InvoiceController ctrl = new InvoiceController();
                shtCustomerOrder.RowCount = 0;
                DataTable dtOrder = DTOUtility.ConvertListToDataTable <InvoiceDTO>(ctrl.Load_Delivery_Detail(m_uidm.DELIVERY_NO.StrongValue));
                shtCustomerOrder.DataSource = dtOrder;
            }
            else
            {
                InvoiceController ctrl = new InvoiceController();
                shtCustomerOrder.RowCount = 0;
                DataTable dtOrder = DTOUtility.ConvertListToDataTable <InvoiceDTO>(ctrl.Load_By_Bill_No(m_uidm.BILL_NO.StrongValue));
                shtCustomerOrder.DataSource = dtOrder;
            }

            ////ShipmentEntryController ctl = new ShipmentEntryController();
            //m_uidm.DATA_VIEW = ctl.LoadShipList(SlipNo);
            //CalculateOldInventoryOnhand();
            //this.shtCustomerOrder.DataSource = m_uidm.DATA_VIEW;
            //// load lot no
            //int row = shtCustomerOrder.Rows.Count;
            //for (int i = 0; i < row; i++)
            //{
            //    NZString ItemCD = new NZString(null, shtCustomerOrder.Cells[i, (int)eColView.PART_NO].Value);
            //    NZString LocCD = new NZString(null, cboFromLoc.SelectedValue);

            //    LookupLotNo(i, ItemCD, LocCD);
            //    shtCustomerOrder.Cells[i, (int)eColView.LOT_NO].Value =
            //        m_uidm.DATA_VIEW.Rows[i][eColView.LOT_NO.ToString()].ToString();
            //}
        }
Esempio n. 3
0
        public static void LoadLookup <T>(EVOComboBox control, List <T> listData, string displayMember, string valueMember)
            where T : IDataTransferObject
        {
            DataTable dt = DTOUtility.ConvertListToDataTable(listData);

            LoadLookup(control, dt, displayMember, valueMember);
        }
Esempio n. 4
0
        private void fpView_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
        {
            if (shtView.Rows.Count == 0)
            {
                return;
            }
            if (shtView.ActiveRowIndex < 0)
            {
                return;
            }

            int activeRow = shtView.ActiveRowIndex;

            IsSelected = true;

            int rowModel = shtView.GetModelRowFromViewRow(activeRow);

            if (shtView.DataSource != null)
            {
                DataTable dt = (DataTable)shtView.DataSource;
                SelectedItem = DTOUtility.ConvertDataRowToDTO <CustomerDTO>(dt.Rows[rowModel]);
            }

            Close();
        }
Esempio n. 5
0
        private void fpView_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                if (shtView.Rows.Count == 0)
                {
                    return;
                }
                if (shtView.ActiveRowIndex < 0)
                {
                    return;
                }

                int activeRow = shtView.ActiveRowIndex;

                IsSelected = true;

                int rowModel = shtView.GetModelRowFromViewRow(activeRow);
                if (shtView.DataSource != null)
                {
                    DataTable dt = (DataTable)shtView.DataSource;
                    SelectedItem = DTOUtility.ConvertDataRowToDTO <CustomerDTO>(dt.Rows[rowModel]);
                }

                Close();
            }
        }
Esempio n. 6
0
        public ErrorItem CheckDifferentLocationOfItem(DataTable argConsumption)
        {
            List <WorkResultEntryViewDTO> listConsumption = DTOUtility.ConvertDataTableToList <WorkResultEntryViewDTO>(argConsumption);

            Dictionary <string, string> dictItemLocation = new Dictionary <string, string>();

            foreach (WorkResultEntryViewDTO dtoConsumption in listConsumption)
            {
                string strItemCode = dtoConsumption.ITEM_CD.StrongValue;
                if (dictItemLocation.ContainsKey(strItemCode))
                {
                    string strLocation = dictItemLocation[dtoConsumption.ITEM_CD.StrongValue];
                    if (!strLocation.Equals(dtoConsumption.LOC_CD.StrongValue))
                    {
                        return(new ErrorItem(null, TKPMessages.eValidate.VLM0099.ToString(), new object[] { strItemCode }));
                    }
                }
                else
                {
                    dictItemLocation.Add(dtoConsumption.ITEM_CD.StrongValue, dtoConsumption.LOC_CD.StrongValue);
                }
            }



            return(null);
        }
Esempio n. 7
0
        private void loadData()
        {
            try
            {
                DeliveryController     m_Controller = new DeliveryController();
                List <DeliveryViewDTO> listDTO      = new List <DeliveryViewDTO>();
                listDTO          = m_Controller.Load_OrderMaintenance(dtPeriodBegin.NZValue, dtPeriodEnd.NZValue, m_Customer, m_Currency, m_SlipNo);
                shtView.RowCount = 0;

                for (int i = 0; i < ShtPreviousOrder.RowCount; i++)
                {
                    for (int j = listDTO.Count - 1; j >= 0; j--)
                    {
                        if (listDTO[j].RETURN_QTY.StrongValue > 0)
                        {
                            listDTO.RemoveAt(j);
                            continue;
                        }
                        if (Convert.ToString(ShtPreviousOrder.GetValue(i, (int)eColCustomerOrder.ITEM_CD)) == listDTO[j].ITEM_CD.StrongValue &&
                            Convert.ToString(ShtPreviousOrder.GetValue(i, (int)eColCustomerOrder.ORDER_DETAIL_NO)) == listDTO[j].ORDER_DETAIL_NO.StrongValue)
                        {
                            listDTO.RemoveAt(j);
                        }
                    }
                }

                shtView.DataSource = DTOUtility.ConvertListToDataTable <DeliveryViewDTO>(listDTO);
            }
            catch (Exception ex)
            {
                MessageDialog.ShowBusiness(this, ex.Message);
            }
        }
Esempio n. 8
0
        internal ClassListUIDM LoadClassList()
        {
            ClassListUIDM       model         = new ClassListUIDM();
            ClassListBIZ        biz           = new ClassListBIZ();
            List <ClassListDTO> ListClassList = biz.LoadAll();

            model.DATA_VIEW = DTOUtility.ConvertListToDataTable <ClassListDTO>(ListClassList);
            return(model);
        }
Esempio n. 9
0
        internal SystemConfigurationUIDM LoadSysConfig()
        {
            SystemConfigurationUIDM model      = new SystemConfigurationUIDM();
            SysConfigBIZ            biz        = new SysConfigBIZ();
            List <SysConfigDTO>     listConfig = biz.LoadData();

            model.DATA_VIEW = DTOUtility.ConvertListToDataTable <SysConfigDTO>(listConfig);
            return(model);
        }
Esempio n. 10
0
        public LookupData LoadLookup(bool orderByKey)
        {
            IUserGroupDAO       dao  = DAOFactory.CreateUserGroupDAO(CommonLib.Common.CurrentDatabase);
            List <UserGroupDTO> dtos = dao.LoadAll(null, orderByKey);

            return(new LookupData(DTOUtility.ConvertListToDataTable(dtos),
                                  UserGroupDTO.eColumns.GROUP_NAME.ToString(),
                                  UserGroupDTO.eColumns.GROUP_CD.ToString()));
        }
Esempio n. 11
0
        private void LoadItemData(string keyFilter)
        {
            //set ให้ show column ทั้งหมด
            //shtView.Columns[0, shtView.Columns.Count - 1].Visible = true;

            DealingBIZ biz = new DealingBIZ();
            DealingDTO dto = new DealingDTO();

            //DataTable dt = null;

            if (m_LocationType != null && m_LocationType.Length > 0)
            {
                m_dtAllData = biz.LoadByLocationType(m_LocationType);
            }
            else
            {
                m_dtAllData = DTOUtility.ConvertListToDataTable <DealingDTO>(biz.LoadAllLocations(false));
            }

            FindDataFromMemory();

            //shtView.Columns[(int)eColView.CRT_BY].Visible = false;
            //shtView.Columns[(int)eColView.CRT_DATE].Visible = false;
            //shtView.Columns[(int)eColView.CRT_MACHINE].Visible = false;
            //shtView.Columns[(int)eColView.UPD_BY].Visible = false;
            //shtView.Columns[(int)eColView.UPD_DATE].Visible = false;
            //shtView.Columns[(int)eColView.UPD_MACHINE].Visible = false;
            //shtView.Columns[(int)eColView.ALLOW_NEGATIVE].Visible = false;
            //shtView.Columns[(int)eColView.MRP_LOCATION].Visible = false;

            //DataTable dtView = dt.Clone();

            //if (keyFilter != string.Empty)
            //{
            //    string [] colNames = Enum.GetNames(typeof(eColView));
            //    string filterString = string.Empty;

            //    for (int i = 0; i < colNames.Length; i++) {
            //        filterString += string.Format(@"CONVERT({0},'System.String') LIKE '%{1}%' ", colNames[i], keyFilter);
            //        if (i != colNames.Length - 1)
            //            filterString += " OR ";
            //    }

            //    //get only the rows you want
            //    DataRow [] results = dt.Select(filterString);

            //    //populate new destination table
            //    foreach (DataRow dr in results)
            //        dtView.ImportRow(dr);
            //}
            //else
            //{
            //    foreach (DataRow dr in dt.Rows)
            //        dtView.ImportRow(dr);
            //}
            //fpView.DataSource = dtView;
        }
Esempio n. 12
0
        private void LoadData(NZDateTime from, NZDateTime to)
        {
            m_dtAllData = DTOUtility.ConvertListToDataTable(m_controller.LoadAdjustmentList(from, to));

            shtView.RowCount   = 0;
            shtView.DataSource = null;
            //shtView.DataSource = m_dtAllData;
            FindDataFromMemory();
            //CtrlUtil.SpreadUpdateColumnSorting(shtView);
        }
Esempio n. 13
0
        public LookupData LoadLookup(bool orderByKey)
        {
            IMenuSetDAO dao = DAOFactory.CreateMenuSetDAO(CommonLib.Common.CurrentDatabase);

            List <MenuSetDTO> dtos = dao.LoadAll(null, orderByKey);

            return(new LookupData(DTOUtility.ConvertListToDataTable(dtos),
                                  MenuSetDTO.eColumns.MENU_SET_NAME.ToString(),
                                  MenuSetDTO.eColumns.MENU_SET_CD.ToString()));
        }
Esempio n. 14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ClassInfoCD"></param>
        /// <returns></returns>
        public LookupData LoadLookupClassType(NZString ClassInfoCD)
        {
            IClassListDAO dao        = DAOFactory.CreateClassListDAO(CommonLib.Common.CurrentDatabase);
            DataTable     dt         = DTOUtility.ConvertListToDataTable(dao.LoadByClassInfo(null, ClassInfoCD));
            LookupData    lookupData = new LookupData(dt,
                                                      ClassListDTO.eColumns.CLS_DESC.ToString(),
                                                      ClassListDTO.eColumns.CLS_CD.ToString());

            return(lookupData);
        }
Esempio n. 15
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public LookupData LoadLookupLocation()
        {
            DealingDAO dao        = new DealingDAO(CommonLib.Common.CurrentDatabase);
            DataTable  dt         = DTOUtility.ConvertListToDataTable(dao.LoadAll(null, true));
            LookupData lookupData = new LookupData(dt,
                                                   DealingDTO.eColumns.LOC_DESC.ToString(),
                                                   DealingDTO.eColumns.LOC_CD.ToString());

            return(lookupData);
        }
Esempio n. 16
0
        private void RefreshUserSpread()
        {
            UserBIZ biz = new UserBIZ();

            fpUser.DataSource = DTOUtility.ConvertListToDataTable(biz.LoadAllUserNotInGroup(m_GroupCD));

            UserMaintenanceUIDM umd = new UserMaintenanceUIDM();

            shtUser.Columns[(int)eColUser.SEL].Locked          = false;
            shtUser.Columns[(int)eColUser.USER_ACCOUNT].Locked = true;
            shtUser.Columns[(int)eColUser.FULL_NAME].Locked    = true;
        }
Esempio n. 17
0
        public LookupData LoadPersonInCharge()
        {
            SystemMaintenance.BIZ.UserBIZ        biz      = new SystemMaintenance.BIZ.UserBIZ();
            List <SystemMaintenance.DTO.UserDTO> listUser = biz.LoadPersonInCharge();
            DataTable dtUser = DTOUtility.ConvertListToDataTable(listUser);

            LookupData lookupData = new LookupData(dtUser,
                                                   SystemMaintenance.DTO.UserDTO.eColumns.FULL_NAME.ToString(),
                                                   SystemMaintenance.DTO.UserDTO.eColumns.USER_ACCOUNT.ToString());

            return(lookupData);
        }
Esempio n. 18
0
        private void LoadData(NZDateTime from, NZDateTime to)
        {
            List <InventoryTransactionViewDTO> list = m_controller.LoadReceivingList(from, to);

            //DataTable dt = DTOUtility.ConvertListToDataTable(list);
            m_dtAllData        = DTOUtility.ConvertListToDataTable(list);
            shtView.RowCount   = 0;
            shtView.DataSource = null;
            FindDataFromMemory();
            //shtView.DataSource = m_dtAllData;

            // CtrlUtil.SpreadUpdateColumnSorting(shtView);
        }
Esempio n. 19
0
        internal LotMaintenanceUIDM loaddata(LotMaintenanceUIDM model)
        {
            LotMaintenanceBIZ biz  = new LotMaintenanceBIZ();
            LotMaintenanceDTO data = new LotMaintenanceDTO();

            data.Location       = model.Location;
            data.Item_NO        = model.Item_No;
            data.Item_Name      = model.Item_Name;
            data.LOT_NO         = model.Lot_No;
            data.ShowReserveLot = model.ShowReserveLot;
            List <LotMaintenanceDTO> ListLot = biz.LoadAll(data);

            model.DATA_VIEW = DTOUtility.ConvertListToDataTable <LotMaintenanceDTO>(ListLot);
            return(model);
        }
Esempio n. 20
0
        /// <summary>
        /// Load All Location
        /// </summary>
        /// <param name="dtoAddedLocation">Dummy Location to Added and Set to first Row</param>
        /// <returns></returns>
        public LookupData LoadLookupLocation_AddDummy(DealingDTO dtoAddedLocation)
        {
            DealingDAO        dao          = new DealingDAO(CommonLib.Common.CurrentDatabase);
            List <DealingDTO> dtoLocations = dao.LoadAll(null, true);

            //add Dummy Location and Set to first Row
            dtoLocations.Insert(0, dtoAddedLocation);

            DataTable  dt         = DTOUtility.ConvertListToDataTable(dtoLocations);
            LookupData lookupData = new LookupData(dt,
                                                   DealingDTO.eColumns.LOC_DESC.ToString(),
                                                   DealingDTO.eColumns.LOC_CD.ToString());

            return(lookupData);
        }
Esempio n. 21
0
        /// <summary>
        /// Load lookup for lot number by item and location code
        /// If these lot no has no onhand qty will be supressed.
        /// </summary>
        /// <param name="ItemCD"></param>
        /// <param name="LocationCD"></param>
        /// <returns></returns>
        public LookupData LoadLookupLotNo(NZString ItemCD, NZString LocationCD, NZString YearMonth)
        {
            InventoryOnhandDAO dao = new InventoryOnhandDAO(CommonLib.Common.CurrentDatabase);
            InventoryPeriodBIZ inventoryPeriodBIZ = new InventoryPeriodBIZ();
            InventoryPeriodDTO inventoryPeriodDTO = inventoryPeriodBIZ.LoadCurrentPeriod();

            List <InventoryOnhandDTO> listOnhand = dao.LoadLotNoWithHasOnhandQty(null, YearMonth, inventoryPeriodDTO.YEAR_MONTH, ItemCD, LocationCD);
            DataTable dt = DTOUtility.ConvertListToDataTable(listOnhand);

            LookupData lookupData = new LookupData(dt,
                                                   InventoryOnhandDTO.eColumns.LOT_NO.ToString(),
                                                   InventoryOnhandDTO.eColumns.LOT_NO.ToString());

            return(lookupData);
        }
Esempio n. 22
0
        /// <summary>
        /// Delete MenuSub on all language.
        /// </summary>
        /// <param name="database"></param>
        /// <param name="MENU_SUB_CD"></param>
        /// <returns></returns>
        public int DeleteOnAllLang(Database database, NZString MENU_SUB_CD)
        {
            Database db = UseDatabase(database);

            string        tableName = DTOUtility.ReadTableName(typeof(MenuSubLangDTO));
            StringBuilder sb        = new StringBuilder();

            sb.AppendLine(" DELETE FROM " + tableName);
            sb.AppendLine(" WHERE MENU_SUB_CD=:MENU_SUB_CD");

            DataRequest req = new DataRequest(sb.ToString());

            req.Parameters.Add("MENU_SUB_CD", DataType.NVarChar, MENU_SUB_CD.Value);

            return(db.ExecuteNonQuery(req));
        }
Esempio n. 23
0
        private void txtDeliveryNo_Validating(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (m_Mode != Common.eScreenMode.ADD || txtDeliveryNo.Text == "")
            {
                return;
            }
            InvoiceBIZ        biz  = new InvoiceBIZ();
            InvoiceController ctrl = new InvoiceController();
            List <InvoiceDTO> list = biz.Load_Delivery_Detail(txtDeliveryNo.Text);

            if (list.Count > 0)
            {
                dmcShip.LoadData(ctrl.MapDTOToUIDM(list[0]));
                shtCustomerOrder.DataSource = DTOUtility.ConvertListToDataTable <InvoiceDTO>(list);
            }
        }
Esempio n. 24
0
 /// <summary>
 /// Execute data request for list of data transfer object.
 /// It will execute command and parse field into strongly type of DTO.
 /// </summary>
 /// <typeparam name="T">Type of DTO</typeparam>
 /// <param name="request">DataRequest command and parameter.</param>
 /// <returns>List of DTO. If not found data it will return empty list.</returns>
 /// <exception cref="DataAccessException"><c>DataAccessException</c>.</exception>
 public override System.Collections.Generic.List <T> ExecuteForList <T>(DataRequest request)
 {
     // It will loss performance because:
     //  - first execute to get DataTable.
     //  - second convert dataTable to List.
     try {
         DataTable dt = ExecuteQuery(request);
         return(DTOUtility.ConvertDataTableToList <T>(dt));
     }
     catch (Exception err)
     {
         DataAccessException ex = new DataAccessException(err.Message, err);
         ex.DataRequest = request;
         throw ex;
     }
 }
Esempio n. 25
0
        private void RefreshGroupSpread()
        {
            UserGroupBIZ biz = new UserGroupBIZ();

            fpGroup.DataSource = DTOUtility.ConvertListToDataTable(biz.LoadAllGroup());

            UserMaintenanceUIDM umd = new UserMaintenanceUIDM();

            //dmcUserMaintenance.LoadData(umd);

            int rows = shtGroup.Rows.Count;

            for (int i = 0; i < rows; i++)
            {
                shtGroup.Rows[i].Locked = true;
            }
        }
Esempio n. 26
0
        private void RefreshUserSpread()
        {
            UserBIZ biz = new UserBIZ();

            fpUser.DataSource = DTOUtility.ConvertListToDataTable(biz.LoadUserByGroupCD(m_GroupCD));

            UserMaintenanceUIDM umd = new UserMaintenanceUIDM();

            //dmcUserMaintenance.LoadData(umd);

            int rows = shtUser.Rows.Count;

            for (int i = 0; i < rows; i++)
            {
                shtUser.Rows[i].Locked = true;
            }
        }
Esempio n. 27
0
        public CustomerOrderEntryUIDM LoadData(NZString orderNo)
        {
            CustomerOrderBIZ            biz         = new CustomerOrderBIZ();
            CustomerOrderViewDTO        ViewDTO     = biz.LoadCustomerOrderHeader(orderNo, false);
            List <CustomerOrderViewDTO> listViewDTO = biz.LoadCustomerOrderEntry(orderNo, false);

            if (ViewDTO != null)
            {
                CustomerOrderEntryUIDM model = MapDTOToUIDM(ViewDTO);
                model.DATA_VIEW = DTOUtility.ConvertListToDataTable(listViewDTO);

                //== Ensure that data has not modified.
                model.DATA_VIEW.AcceptChanges();

                return(model);
            }
            return(new CustomerOrderEntryUIDM());
        }
Esempio n. 28
0
        public System.Data.DataTable LoadAllInvTranLogPeriod(EVOFramework.NZDateTime FromDate, EVOFramework.NZDateTime ToDate, EVOFramework.NZString ScreenType)
        {
            //EVOFramework.Database.DatabaseCredential dbCre = CommonLib.Common.CurrentDatabase.Credential;//new EVOFramework.Database.DatabaseCredential ();
            //dbCre.DatabaseName = dbCre.DatabaseName + "_HIST";


            EVOFramework.Database.DatabaseCredential dbCre = new EVOFramework.Database.DatabaseCredential();
            dbCre.DatabaseName = CommonLib.Common.CurrentDatabase.Credential.DatabaseName + "_HIST";
            dbCre.Password     = CommonLib.Common.CurrentDatabase.Credential.Password;
            dbCre.Provider     = CommonLib.Common.CurrentDatabase.Credential.Provider;
            dbCre.ServerName   = CommonLib.Common.CurrentDatabase.Credential.ServerName;
            dbCre.Username     = CommonLib.Common.CurrentDatabase.Credential.Username;

            EVOFramework.Database.Database db = EVOFramework.Database.DatabaseManager.CreateDatabase(dbCre);
            InvTranLogDAO        dao          = new InvTranLogDAO(db);
            List <InvTranLogDTO> dtoList      = dao.LoadAllInvTranLogPeriod(db, FromDate, ToDate, ScreenType);

            return(DTOUtility.ConvertListToDataTable(dtoList));
        }
Esempio n. 29
0
        /// <summary>
        /// Load data for Receiving Entry.
        /// </summary>
        /// <param name="receiveNo"></param>
        /// <returns></returns>
        public ReceivingEntryUIDM LoadData(NZString receiveNo)
        {
            InventoryBIZ biz = new InventoryBIZ();
            List <InventoryTransactionViewDTO> listViewDTO = biz.LoadTransactionViewByReceiveNo(receiveNo);

            if (listViewDTO != null)
            {
                if (listViewDTO.Count > 0)
                {
                    ReceivingEntryUIDM model = MapDTOToUIDM(listViewDTO[0]);
                    model.DATA_VIEW = DTOUtility.ConvertListToDataTable(listViewDTO);

                    //== Ensure that data has not modified.
                    model.DATA_VIEW.AcceptChanges();

                    return(model);
                }
            }
            return(new ReceivingEntryUIDM());
        }
Esempio n. 30
0
        private void LoadData(NZDateTime FromPeriod, NZDateTime ToPeriod, NZString ItemFrom, NZString ItemTo, NZString LotNo)
        {
            try
            {
                if (ItemFrom == "")
                {
                    ItemFrom = null;
                }
                if (ItemTo == "")
                {
                    ItemTo = null;
                }

                bool GroupByItem = rdoGroupItem.Checked;

                NGInquiryController     ctlInvent = new NGInquiryController();
                List <NGInquiryViewDTO> dto       = ctlInvent.LoadNGInquiry(FromPeriod, ToPeriod, ItemFrom, ItemTo, GroupByItem, LotNo);
                if (dto.Count == 0)
                {
                    MessageDialog.ShowBusiness(this, new EVOFramework.Message(TKPMessages.eInformation.INF0001.ToString()));
                    return;
                }

                m_dtAllData = DTOUtility.ConvertListToDataTable(dto);
                DataTable dtView = m_dtAllData.Clone();
                foreach (DataRow dr in m_dtAllData.Rows)
                {
                    dtView.ImportRow(dr);
                }

                //Hide Column When ByGroupItem
                RefreshSpreadColumn();

                fpView.DataSource = dtView;
                CtrlUtil.MappingDataFieldWithEnum(shtView, typeof(eColumns));
            }
            catch (Exception ex)
            {
                MessageDialog.ShowBusiness(this, ex.Message);
            }
        }