示例#1
0
        public void open_OSAS_log()
        {
            if (oCustomer.dsOpen("WSCUST", ref cust_channel) == 10)            //Open our file to migrate
            {
                MessageBox.Show("This file wasn't open!!!");
            }



            //Attach fields template
            oCustomer.dsTmpl(cust_channel, "id:c(10*),flag:c(1*),company_id:c(3*)");

            //Start at first record
            oCustomer.dsReadFld(cust_channel, "", 0, "", ref arrCustomers);
        }
示例#2
0
        public bool Open(String File, String CompanyID)
        {
            String strTemp = new string(' ', 500);
            String sFile   = File;
            int    err     = 0;

            if (CompanyID.Length > 0)
            {
                sFile = File + "." + CompanyID;
            }

            if ((err = oFile.dsOpen(sFile, ref channel)) == 30)  //Open our file to migrate
            {
                this.Error = "This file wasn't open!!!";
            }

            if (err == 13 || err == 12 || err == 11)
            {
                this.Error = "Couldn't open files,Please Contact to the server administrator error:" + err.ToString();
                return(false);
            }


            switch (File)
            {
            case "INTAX":
                this.fTemplate = FileTemplate.INTAX;
                oFile.dsTmpl(this.channel, fTemplate);
                break;

            case "INBROCH":
                this.fTemplate = FileTemplate.INBROCH;
                oFile.dsTmpl(this.channel, fTemplate);
                break;

            case "ARINV":
                this.fTemplate = FileTemplate.ARINV;
                oFile.dsTmpl(this.channel, fTemplate);
                break;

            case "INVEND":
                this.fTemplate = FileTemplate.INVEND;
                oFile.dsTmpl(this.channel, fTemplate);
                break;

            case "INMAST":
                this.fTemplate = FileTemplate.INMAST;
                oFile.dsTmpl(this.channel, fTemplate);
                break;

            case "ARMAST":
                this.fTemplate = FileTemplate.ARMAST;
                oFile.dsTmpl(this.channel, fTemplate);
                break;

            case "ARCUSTEX":
                this.fTemplate = FileTemplate.ARCUSTEX;
                oFile.dsTmpl(this.channel, fTemplate);
                break;

            case "OSST":
            {
                this.fTemplate = FileTemplate.OSST;
                oFile.dsTmpl(this.channel, fTemplate);
                break;
            }

            case "WSCUST":
            {
                this.fTemplate = FileTemplate.WSCUST;
                oFile.dsTmpl(this.channel, fTemplate);
                break;
            }

            case "OPDISC":
                strTemp  = "id:c(10),teacher:c(30),student:c(30),Reserved:c(29),";
                strTemp += "comment_1:c(50),comment_2:c(50),comment_3:c(50),comment_4:c(50),comment_5:c(50),";
                strTemp += "comment_6:c(50),comment_7:c(50),comment_8:c(50),comment_9:c(50),comment_10:c(50*),";
                strTemp += "n_1:n(10*),n_2:n(10*),n_3:n(10*),n_4:n(10*),n_5:n(10*),";
                strTemp += "n_6:n(10*),n_7:n(10*),n_8:n(10*),n_9:n(10*),n_10:n(10)";
                oFile.dsTmpl(this.channel, strTemp);
                break;

            case "WPSCAN":
                strTemp  = "number:c(10),id:c(10),teacher:c(30),student:c(30),Reserved:c(19),";
                strTemp += "access_code:c(12),reserved_1:c(188*),";
                strTemp += "no_items:n(10*),no_boxes:n(10*),n_2:n(10*),n_3:n(10*),n_4:n(10*),n_5:n(10*),";
                strTemp += "date:n(10*):date=jul:,time:n(10*),n_8:n(10*),n_9:n(10*),n_10:n(10)";;
                oFile.dsTmpl(this.channel, strTemp);
                break;

            case "INBOXSZ":
                strTemp = "BoxNumber:c(2*),Length:n(10*),Width:n(10*),Height:n(10*),Reserved:n(10*)";
                oFile.dsTmpl(this.channel, strTemp);
                break;

            case "INPRIZ":
                strTemp = "brochure_id:c(10*),product_id:c(10*),break_level:n(10*),break_level_d:n(10*)";
                oFile.dsTmpl(this.channel, strTemp);
                break;

            case "ORDER":
                break;

            case "":
                strTemp = "id:c(10*),product_id:c(10*)";
                oFile.dsTmpl(this.channel, strTemp);
                break;
            }
            //Start at first record
            oFile.dsReadFld(channel, "", 0, "", ref arrValues);
            return(true);
        }