Exemple #1
0
 public string GetDataList(JobDataStatus jds)
 {
     StringBuilder builder = new StringBuilder();
     string s = "";
     StrFunc func = StrFunc.CreateInstance();
     this.MakeLstNaccsData();
     int lastDataIdx = this.GetLastDataIdx();
     if (lastDataIdx < 0)
     {
         return "";
     }
     for (int i = 0; i <= lastDataIdx; i++)
     {
         if ((this.LstNaccsData[i].In != "0") || (jds != JobDataStatus.jdSend))
         {
             s = this.LstNaccsData[i].Data;
             if (this.LstNaccsData[i].Attr.Equals("F"))
             {
                 s = func.ConvertCommaToPeriod(s);
             }
             if (((this.LstNaccsData[i].Attr == "I") || (this.LstNaccsData[i].Attr == "F")) || (this.LstNaccsData[i].Rpacked == "1"))
             {
                 s = func.FillBlankLeft(s, this.LstNaccsData[i].Figure);
             }
             else
             {
                 s = func.FillBlankRight(s, this.LstNaccsData[i].Figure);
             }
             if (builder.Length == 0)
             {
                 builder.Append(s);
             }
             else
             {
                 builder.Append("\r\n" + s);
             }
         }
     }
     return builder.ToString();
 }
Exemple #2
0
 public void SetDataList(List<string> stList, JobDataStatus jds, string tblName)
 {
     this.LstLastPageInfo.Clear();
     StrFunc func = StrFunc.CreateInstance();
     this.MakeLstNaccsData();
     string s = "";
     int num = 0;
     int num2 = 0;
 Label_0021:
     if ((num2 != stList.Count) && (num != this.LstNaccsData.Count))
     {
         if ((tblName != "") && (tblName != this.LstNaccsData[num].Tbl))
         {
             num++;
         }
         else if (((this.LstNaccsData[num].In == "0") && (jds == JobDataStatus.jdSend)) || ((this.LstNaccsData[num].Out == "0") && (jds == JobDataStatus.jdRecv)))
         {
             num++;
         }
         else if (stList[num2] == "")
         {
             num2++;
             num++;
         }
         else
         {
             if (((this.LstNaccsData[num].Attr == "I") || (this.LstNaccsData[num].Attr == "F")) || (this.LstNaccsData[num].Rpacked == "1"))
             {
                 s = stList[num2].TrimStart(null);
             }
             else
             {
                 s = stList[num2].TrimEnd(null);
             }
             if ((this.LstNaccsData[num].Attr == "I") && !func.IsIntegralNum(s))
             {
                 num2++;
                 num++;
             }
             else
             {
                 if (this.LstNaccsData[num].Attr == "F")
                 {
                     s = func.ConvertPeriodToComma(s);
                     if (!func.IsNumeric(s))
                     {
                         num2++;
                         num++;
                         goto Label_0021;
                     }
                 }
                 if (this.LstNaccsData[num].Attr == "A")
                 {
                     s = s.ToUpper();
                     if (!func.ForbiddenCharCheck(s))
                     {
                         num2++;
                         num++;
                         goto Label_0021;
                     }
                 }
                 if ((this.LstNaccsData[num].Attr == "W") && !func.ForbiddenConvCheck(s))
                 {
                     num2++;
                     num++;
                 }
                 else
                 {
                     int figure = this.LstNaccsData[num].Figure;
                     if ("W".Equals(this.LstNaccsData[num].Attr))
                     {
                         figure /= 3;
                     }
                     if (func.GetStringLength(s) > figure)
                     {
                         s = func.CutStringLength(s, figure);
                     }
                     this.LstNaccsData[num].Data = s;
                     num2++;
                     num++;
                 }
             }
         }
         goto Label_0021;
     }
     DataSet set = this.DsItems.Copy();
     for (int i = 0; i < this.LstNaccsData.Count; i++)
     {
         NaccsDataItem item = this.LstNaccsData[i];
         set.Tables[item.Tbl].Rows[item.Page][item.ID] = item.Data;
     }
     for (int j = 0; j < this.DsItems.Tables.Count; j++)
     {
         for (int k = 0; k < this.DsItems.Tables[j].Rows.Count; k++)
         {
             this.DsItems.Tables[j].Rows[k].ItemArray = set.Tables[j].Rows[k].ItemArray;
         }
         this.DsItems.Tables[j].AcceptChanges();
     }
     this.MakeLstLastPageInfo();
 }