예제 #1
0
 protected override void InsertData(List <InvVolumeApp> ListModel)
 {
     try
     {
         if (base.customStyleDataGrid1.DataSource != null)
         {
             ((DataTable)base.customStyleDataGrid1.DataSource).Clear();
         }
         if (this.CheckEmpty(ListModel))
         {
             DataTable table     = this.CreateTableHeader();
             int       num       = 0;
             int       yearExist = 0x7fffffff;
             foreach (InvVolumeApp app in ListModel)
             {
                 if (((11 != app.InvType) && (0x33 != app.InvType)) && (0x29 != app.InvType))
                 {
                     int number = app.Number;
                     if (('0' != app.Status) && (number > 0))
                     {
                         DataRow row     = table.NewRow();
                         string  invType = ShareMethods.GetInvType(app.InvType);
                         row["FPZL"] = invType;
                         row["KPXE"] = this.GetInvUpLimit(invType);
                         row["JH"]   = Convert.ToString(num++);
                         row["LBDM"] = app.TypeCode;
                         row["MC"]   = ShareMethods.GetFPLBMC(app, base._dictFPLBBM);
                         row["QSHM"] = ShareMethods.FPHMTo8Wei(app.HeadCode);
                         row["SYZS"] = Convert.ToString(number);
                         uint num4 = (app.HeadCode + app.Number) - 1;
                         row["JZZH"] = num4.ToString().PadLeft(8, '0');
                         row["LGRQ"] = app.BuyDate.ToString("yyyy-MM-dd");
                         row["LGZS"] = app.BuyNumber.ToString();
                         if (app.BuyDate.Year < yearExist)
                         {
                             yearExist = app.BuyDate.Year;
                         }
                         table.Rows.Add(row);
                     }
                 }
             }
             base.customStyleDataGrid1.DataSource = table;
             this.InitializeQueryComponents(yearExist);
         }
     }
     catch (BaseException exception)
     {
         base._bError = true;
         this.loger.Error(exception.Message);
         ExceptionHandler.HandleError(exception);
     }
     catch (Exception exception2)
     {
         base._bError = true;
         this.loger.Error(exception2.Message);
         ExceptionHandler.HandleError(exception2);
     }
 }
예제 #2
0
        public void InsertInvVolume(List <InvVolumeApp> invList)
        {
            InvSQInfo invUpLimit = base.TaxCardInstance.get_SQInfo();
            int       num        = 0;
            DataTable table      = this.CreateTableHeader();

            foreach (InvVolumeApp app in invList)
            {
                num = 0;
                DataRow row     = table.NewRow();
                string  invType = ShareMethods.GetInvType(app.InvType);
                row[this.strHead[num++]] = invType;
                double upLimit = ShareMethods.GetUpLimit(invUpLimit, invType);
                row[this.strHead[num++]] = Convert.ToString(upLimit);
                row[this.strHead[num++]] = app.TypeCode;
                row[this.strHead[num++]] = ShareMethods.GetFPLBMC(app, this._dictFPLBBM);
                row[this.strHead[num++]] = ShareMethods.FPHMTo8Wei(app.HeadCode);
                int number = app.Number;
                row[this.strHead[num++]] = Convert.ToString(number);
                row[this.strHead[num++]] = app.BuyDate.ToString("yyyy-MM-dd");
                table.Rows.Add(row);
            }
            this.dgInvInfo.DataSource = table;
        }
예제 #3
0
 protected virtual void QueryIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (this.queryInitialized)
         {
             this._ListModel = base.TaxCardInstance.GetInvStock();
             if (0 < base.TaxCardInstance.get_RetCode())
             {
                 MessageManager.ShowMsgBox(base.TaxCardInstance.get_ErrCode());
                 this._bError = true;
                 base.Close();
             }
             else
             {
                 if (this.customStyleDataGrid1.DataSource != null)
                 {
                     ((DataTable)this.customStyleDataGrid1.DataSource).Clear();
                 }
                 DataTable table = this.CreateTableHeader();
                 int       num   = 0;
                 int       num2  = 0;
                 while (num2 < this._ListModel.Count)
                 {
                     DataRow row     = table.NewRow();
                     string  invType = ShareMethods.GetInvType(this._ListModel[num2].InvType);
                     if (this.InvTypeMatched(invType))
                     {
                         row["FPZL"] = invType;
                         DateTime buyDate = this._ListModel[num2].BuyDate;
                         if (this.InvYearMatched(buyDate.Year.ToString()) && this.InvMonthMatched(buyDate.Month.ToString()))
                         {
                             row["LGRQ"] = buyDate.ToString("yyyy-MM-dd");
                             row["KPXE"] = this.GetInvUpLimit(invType);
                             row["JH"]   = Convert.ToString(num);
                             row["LBDM"] = this._ListModel[num2].TypeCode;
                             row["MC"]   = ShareMethods.GetFPLBMC(this._ListModel[num2], this._dictFPLBBM);
                             row["QSHM"] = ShareMethods.FPHMTo8Wei(this._ListModel[num2].HeadCode);
                             row["SYZS"] = Convert.ToString(this._ListModel[num2].Number);
                             uint num5 = (this._ListModel[num2].HeadCode + this._ListModel[num2].Number) - 1;
                             row["JZZH"] = num5.ToString().PadLeft(8, '0');
                             row["LGZS"] = this._ListModel[num2].BuyNumber.ToString();
                             table.Rows.Add(row);
                         }
                     }
                     num2++;
                     num++;
                 }
                 this.customStyleDataGrid1.DataSource = table;
             }
         }
     }
     catch (BaseException exception)
     {
         this.loger.Error(exception.Message);
         ExceptionHandler.HandleError(exception);
     }
     catch (Exception exception2)
     {
         this.loger.Error(exception2.Message);
         ExceptionHandler.HandleError(exception2);
     }
 }