Beispiel #1
0
 public bool Update(YB_DP_Item_Swap yb)
 {
     ABi_Company abi_company = new ABi_Company();
     string company_id = abi_company.GetCompanyCodeByID(yb.Bukrs);
     if (string.IsNullOrEmpty(company_id) == false)
     {
         this.invoiceNumber = yb.Invoice_no;
         string selStr = "update ABi_Invoice set PaymentStatus='" + yb.Status_i + "' where invoiceNumber='" + this.invoiceNumber + "' and aBi_Company_ID='" + company_id + "' and PaymentStatus not in('3','4')";
         return this.ExecCommand(selStr);
     }
     else
         return false;
 }
 /// <summary>
 /// 更新Abi_Invoice
 /// </summary>
 public void UpdateAbi_Invoice()
 {
     //先处理YB_Payment_Report_Swap
     YB_Payment_Report_Swap yb_payment_report_swap=new YB_Payment_Report_Swap();
     List<YB_Payment_Report_Swap> list = yb_payment_report_swap.GetYB_Payment_Report_SwapList();
     if (list != null && list.Count > 0)
     {
         foreach (YB_Payment_Report_Swap yb in list)
         {
             ABi_Invoice abi = new ABi_Invoice();
             if (abi.Update(yb))
             {
                 yb.SaveStatus("1");
             }
         }
     }
     //然后处理YB_Miro_IV_Swap
     YB_Miro_IV_Swap yb_miro_iv_swap=new YB_Miro_IV_Swap();
     List<YB_Miro_IV_Swap> miroList = yb_miro_iv_swap.GetYB_Miro_IV_SwapList();
     if (miroList != null && miroList.Count > 0)
     {
         foreach (YB_Miro_IV_Swap yb in miroList)
         {
             ABi_Invoice abi = new ABi_Invoice();
             if (abi.Update(yb))
             {
                 yb.SaveStatus("1");
             }
         }
     }
     //最后处理YB_DP_Item_Swap
     YB_DP_Item_Swap yb_dp_item_swap = new YB_DP_Item_Swap();
     List<YB_DP_Item_Swap> itemList = yb_dp_item_swap.GetYB_DP_Item_SwapList();
     if (itemList != null && itemList.Count > 0)
     {
         foreach (YB_DP_Item_Swap yb in itemList)
         {
             ABi_Invoice abi = new ABi_Invoice();
             if (abi.Update(yb))
             {
                 yb.SaveStatus("1");
             }
         }
     }
 }
 public bool Update(YB_DP_Item_Swap yb)
 {
     ABi_Company abi_company = new ABi_Company();
     string company_id = abi_company.GetCompanyCodeByID(yb.Bukrs);
     if (string.IsNullOrEmpty(company_id) == false)
     {
         this.invoiceNumber = yb.Invoice_no;
         if (String.IsNullOrEmpty(yb.Lifnr) || yb.Lifnr.Trim().Length < 6)
         {
             string selStr = "update ABi_Invoice set PaymentStatus='" + yb.Status_i + "' where invoiceNumber='" + this.invoiceNumber + "' and aBi_Company_ID='" + company_id + "' and PaymentStatus not in('3','4')";
             return this.ExecCommand(selStr);
         }
         else
         {
             String strVC = yb.Lifnr.Trim();
             ABi_Vendor v = new ABi_Vendor(strVC.Substring(strVC.Length - 6));
             string selStr = String.Format(@"update ABi_Invoice set PaymentStatus='{0}' where
                                             InvoiceNumber='{1}' and
                                             ABi_Company_ID='{2}' and
                                             ABi_Vendor_ID='{3}' and
                                             LEFT(InvoiceDate, 4) = '{4}' and  PaymentStatus not in('3','4')",
                                             yb.Status_i, invoiceNumber, company_id, v.ABi_Vendor_ID, yb.Invoice_date.Year); // "update ABi_Invoice set PaymentStatus='" + yb.Status_i + "' where invoiceNumber='" + this.invoiceNumber + "' and aBi_Company_ID='" + company_id + "' and PaymentStatus not in('3','4')";
             return this.ExecCommand(selStr);
         }
     }
     else
         return false;
 }