Exemple #1
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);
            }
        }
Exemple #2
0
        private void loadData()
        {
            try
            {
                //LotMaintenanceController ctlsys = new LotMaintenanceController();
                //LotMaintenanceUIDM model = dmc.SaveData(new LotMaintenanceUIDM());
                //LotMaintenanceUIDM models = ctlsys.loaddata(model);
                DeliveryBIZ bizDelivery = new DeliveryBIZ();
                DataTable   dt          = bizDelivery.Load_DeliveryOrderListForReturn(dtPeriodBegin.NZValue, dtPeriodEnd.NZValue, txtMasterNo.Text.ToNZString(), txtItemDesc.Text.ToNZString(), m_Customer.ToNZString(), m_Return_Slip_No.ToNZString(), false);
                fpView.DataSource = dt;//models.DATA_VIEW;

                for (int i = 0; i < shtPreviousData.RowCount; i++)
                {
                    for (int j = shtView.RowCount - 1; j >= 0; j--)
                    {
                        if (Convert.ToDecimal(shtPreviousData.GetValue(i, (int)eColPreviousScreen.RETURNABLE_QTY)) <= 0)
                        {
                            shtView.RemoveRows(j, 1);
                            continue;
                        }
                        if (Convert.ToString(shtPreviousData.GetValue(i, (int)eColPreviousScreen.REF_SLIP_NO)) == Convert.ToString(shtView.GetValue(j, (int)eColumns.ORDER_DETAIL_NO)) &&
                            Convert.ToString(shtPreviousData.GetValue(i, (int)eColPreviousScreen.REF_NO)) == Convert.ToString(shtView.GetValue(j, (int)eColumns.TRANS_ID)))
                        {
                            shtView.RemoveRows(j, 1);
                        }
                    }
                }



                //for (int i = 0; i < shtView.Rows.Count; i++)
                //{
                //    if (Convert.ToInt32(shtView.Cells[i, (int)eColumns.EDIT_FLAG].Value) == 1)
                //        shtView.Cells[i, (int)eColumns.EDIT_FLAG].Value = true;
                //    else
                //        shtView.Cells[i, (int)eColumns.EDIT_FLAG].Value = false;
                //}
            }
            catch (Exception ex)
            {
                MessageDialog.ShowBusiness(this, ex.Message);
            }
        }
Exemple #3
0
        private DataTable OrderData(DataTable dt)
        {
            if (shtPreviousLot == null || shtPreviousLot.RowCount <= 0)
            {
                return(dt);
            }


            for (int j = 0; j < dt.Rows.Count; j++)
            {
                for (int i = 0; i < shtPreviousLot.RowCount; i++)
                {
                    string pOrderDetailNo = Convert.ToString(shtPreviousLot.GetValue(i, (int)eColPreviousLot.REF_SLIP_NO));
                    string pItemCd        = Convert.ToString(shtPreviousLot.GetValue(i, (int)eColPreviousLot.ITEM_CD));
                    string pPackNo        = Convert.ToString(shtPreviousLot.GetValue(i, (int)eColPreviousLot.PACK_NO));
                    string pLotNo         = Convert.ToString(shtPreviousLot.GetValue(i, (int)eColPreviousLot.LOT_NO));

                    if (pItemCd != ItemCd)
                    {
                        continue;
                    }


                    string dataPackNo = null;
                    string dataLotNo  = null;

                    if (dt.Rows[j][ActualOnhandViewDTO.eColumns.PACK_NO.ToString()] != DBNull.Value)
                    {
                        dataPackNo = dt.Rows[j][ActualOnhandViewDTO.eColumns.PACK_NO.ToString()].ToString();
                    }
                    else
                    {
                        dataPackNo = "";
                    }

                    if (dt.Rows[j][ActualOnhandViewDTO.eColumns.LOT_NO.ToString()] != DBNull.Value)
                    {
                        dataLotNo = dt.Rows[j][ActualOnhandViewDTO.eColumns.LOT_NO.ToString()].ToString();
                    }
                    else
                    {
                        dataLotNo = "";
                    }


                    if (dataPackNo == pPackNo && dataLotNo == pLotNo)
                    {
                        if (OrderDetailNo.StrongValue == pOrderDetailNo)
                        {
                            dt.Rows[j][CONST_COLUMN_NAME_CHECK_FLAG] = 1;
                        }

                        break;
                    }
                }
            }

            dt.DefaultView.Sort = CONST_COLUMN_NAME_CHECK_FLAG + " DESC"
                                  + "," + ActualOnhandViewDTO.eColumns.LAST_RECEIVE_DATE.ToString()
                                  + "," + ActualOnhandViewDTO.eColumns.PACK_NO.ToString()
                                  + "," + ActualOnhandViewDTO.eColumns.LOT_NO.ToString();

            return(dt.DefaultView.ToTable());
        }