Пример #1
0
        public GenDoc(List <string> records)
        {
            int linecount = records.Count;

            string[] field = records[0].Split(',');
            DocNum        = Int32.Parse(field[0]);
            DocType       = Int32.Parse(field[1]);
            ExternalAgent = Int32.Parse(field[2]);
            InternalAgent = Int32.Parse(field[3]);
            Status        = Int32.Parse(field[4]);
            ProcessID     = Int32.Parse(field[5]);
            TextValue1    = (field[6]);
            TextValue2    = (field[7]);
            QuotedAmount  = decimal.Parse(field[8]);
            ActualAmount  = decimal.Parse(field[9]);
            Comment       = field[10];
            _docDetails   = new List <DocDetailItem>();
            for (int i = 2; i < linecount; i++)
            {
                string[] nextRecord = records[i].Split(',');
                if (nextRecord.Length > 8)
                {
                    //  (" record longer than 8 fields");
                    continue;
                }
                DocDetailItem detailItem = new DocDetailItem(records[i]);
                _docDetails.Add(detailItem);
            }
        }
Пример #2
0
        public virtual List <string> GetDocument(string tablename, int inDocNum, int inDocType)
        {
            string        cmdString  = String.Format("select * from {0} where DucNum = {1} and DocType = {2}", tablename, inDocNum, inDocType);
            List <string> mainString = new List <string>();

            mainString = Utilities.DataBaseUtility.GetList(cmdString);
            if (mainString.Count < 2)
            {
                return(mainString);
            }
            //  if (mainString.Count > 2) return 3;
            //  count = 2, therefore found 1 data record and 1 string of names
            new GenDoc(mainString[1]);
            cmdString = String.Format("select * from DocumentDetails where DucNum = {0} and DocType = {1}, inDocNum, inDocType");
            List <string> detailStrings = Utilities.DataBaseUtility.GetList(cmdString);

            if (detailStrings.Count < 2)
            {
                return(mainString);
            }
            for (int i = 1; i < detailStrings.Count; i++)
            {
                DocDetailItem _item = new DocDetailItem(detailStrings[i]);
            }
            return(mainString);
        }
Пример #3
0
        public virtual int GetDocument(int inDocNum, int inDocType)
        {
            string        docName    = "GenDocs";
            string        cmdString  = String.Format("select * from {0} where DucNum = {1} and DocType = {2}", docName, inDocNum, inDocType);
            List <string> mainString = Utilities.DataBaseUtility.GetList(cmdString);

            if (mainString.Count < 2)
            {
                return(0);
            }
            if (mainString.Count > 2)
            {
                return(3);
            }
            //  count = 2, therefore found 1 data record and 1 string of names
            new GenDoc(mainString[1]);
            cmdString = String.Format("select * from {0}_Details where DucNum = {1} and DocType = {2}", docName, inDocNum, inDocType);
            List <string> detailStrings = Utilities.DataBaseUtility.GetList(cmdString);

            if (detailStrings.Count < 2)
            {
                return(0);
            }
            for (int i = 1; i < detailStrings.Count; i++)
            {
                DocDetailItem _item = new DocDetailItem(detailStrings[i]);
            }
            return(detailStrings.Count - 1);
        }
Пример #4
0
 public GenDoc(List<string> records)
 {
     int linecount = records.Count;
     string[] field = records[1].Split(',');
     DocNum = Int32.Parse(field[0]);
     DocType = Int32.Parse(field[1]);
     ExternalAgent = Int32.Parse(field[2]);
     InternalAgent = Int32.Parse(field[3]);
     Status = Int32.Parse(field[4]);
     ProcessID = Int32.Parse(field[5]);
      TextValue1 = (field[6]);
     TextValue2 = (field[7]);
      QuotedAmount = decimal.Parse(field[8]);
     ActualAmount = decimal.Parse(field[9]);
     Comment = field[10];
     _docDetails = new List<DocDetailItem>();
     for (int i = 2; i < linecount; i++)
     {
         string[] nextRecord = records[i].Split(',');
         if (nextRecord.Length > 8)
         {
             //  (" record longer than 8 fields");
             continue;
         }
         DocDetailItem detailItem = new DocDetailItem(records[i]);
         _docDetails.Add(detailItem);
     }
 }
Пример #5
0
 public virtual List<string> GetDocument(string tablename, int inDocNum, int inDocType)
 {
     string cmdString = String.Format("select * from {0} where DucNum = {1} and DocType = {2}",tablename, inDocNum, inDocType);
     List<string> mainString = new List<string>();
     mainString = Utilities.DataBaseUtility.GetList(cmdString);
     if (mainString.Count < 2)
     {
         return mainString;
     }
     //  if (mainString.Count > 2) return 3;
     //  count = 2, therefore found 1 data record and 1 string of names
     new GenDoc(mainString[1]);
     cmdString = String.Format("select * from DocumentDetails where DucNum = {0} and DocType = {1}, inDocNum, inDocType");
     List<string> detailStrings = Utilities.DataBaseUtility.GetList(cmdString);
     if (detailStrings.Count < 2) return mainString ;
     for (int i = 1; i < detailStrings.Count; i++)
     {
         DocDetailItem _item = new DocDetailItem(detailStrings[i]);
     }
     return mainString ;
 }
Пример #6
0
 public virtual int GetDocument(int inDocNum, int inDocType)
 {
     string docName = "GenDocs";
     string cmdString = String.Format("select * from {0} where DucNum = {1} and DocType = {2}", docName, inDocNum, inDocType);
     List<string> mainString = Utilities.DataBaseUtility.GetList(cmdString);
     if (mainString.Count < 2) return 0;
     if (mainString.Count > 2) return 3;
     //  count = 2, therefore found 1 data record and 1 string of names
     new GenDoc(mainString[1]);
     cmdString = String.Format("select * from {0}_Details where DucNum = {1} and DocType = {2}", docName, inDocNum, inDocType);
     List<string> detailStrings = Utilities.DataBaseUtility.GetList(cmdString);
     if (detailStrings.Count < 2) return 0;
     for (int i = 1; i < detailStrings.Count; i++)
     {
         DocDetailItem _item = new DocDetailItem(detailStrings[i]);
     }
     return detailStrings.Count - 1;
 }