Ejemplo n.º 1
0
        public static int GetPO(OleDbConnection connection,
            int compID,int locationID)
        {
            string[] mycolumnHeadings = {"PO","Date","Status","Mill","Customer","Customer Location"};
            string[] myfieldNames = {"PONumber","PODate","Status","MillName","CustomerName","CustomerLocation"};
            FieldType[] myfieldTypes = {FieldType.String,FieldType.Date,FieldType.String,
                                        FieldType.String,FieldType.String,FieldType.String};
            int[] mycolumnWidths = {150,150,60,150,150,200};
            string filterName = "Status";
            string[] filterValues = new string[]{"All","Open","Closed","Cancelled"};
            int initialFilterValue = 1;
            if (compID != -1 && locationID != -1)
            {
                using (new OpenConnection(IsWrite.No,AdapterHelper.Connection))
                {
                    EMDataSet tmpSet = new EMDataSet();
                    tmpSet.EnforceConstraints = false;
                    AdapterHelper.FillCompanyFromCompID(tmpSet,compID);
                    AdapterHelper.FillLocationFromLocationID(tmpSet,locationID);
                }

            }
            Chooser dlg = new Chooser(connection,"POID",mycolumnHeadings,mycolumnWidths,
                myfieldNames,myfieldTypes,filterName,filterValues,initialFilterValue,
                new POFindButtonClick(compID,locationID));
            DialogResult res = dlg.ShowDialog();
            if (res == DialogResult.OK)
                return dlg.KeyValue;
            else
                return 0;
        }
Ejemplo n.º 2
0
 public static int GetContainer(OleDbConnection connection)
 {
     string[] mycolumnHeadings = {"Container#","Ship Date","ETA","Status","Customer",
                                             "Completed","PONumbers"};
     string[] myfieldNames = {"ContNumber","ShipDate","ETA","Status","Customer","Completed","PONumbers"};
     FieldType[] myfieldTypes = {FieldType.String,FieldType.Date,FieldType.Date,
                                    FieldType.String,FieldType.String,FieldType.String,
                                     FieldType.String};
     int[] mycolumnWidths = {100,100,100,60,100,100,400};
     string filterName = "Status";
     string[] filterValues = new string[]{"All","Open","Closed","Cancelled"};
     int initialFilterValue = 1;
     Chooser dlg = new Chooser(connection,"ContID",mycolumnHeadings,mycolumnWidths,
         myfieldNames,myfieldTypes,filterName,filterValues,initialFilterValue,
         new ContainerFindButtonClick());
     dlg.showPOInfo.Visible = true;
     DialogResult res = dlg.ShowDialog();
     if (res == DialogResult.OK)
         return dlg.KeyValue;
     else
         return 0;
 }