Exemplo n.º 1
0
 public bool Update(YB_Miro_IV_Swap yb)
 {
     ABi_Company abi_company = new ABi_Company();
     string company_id = abi_company.GetCompanyCodeByID(yb.Bukrs);
     if (string.IsNullOrEmpty(company_id) == false)
     {
         this.iVNumber = yb.Belnr;
         this.invoiceNumber = yb.Invoice_no;
         this.dueDate = yb.Zfbdt;
         this.IVPostDate = yb.Budat;
         this.aBi_Company_ID = Convert.ToInt32(company_id);
         this.payAmount = yb.Dmbtr;
         string selStr = "update ABi_Invoice set payAmount='" + this.payAmount + "', PaymentStatus='" + yb.Status_i + "',iVNumber='" + iVNumber + "',dueDate='" + dueDate + "',IVPostDate='" + IVPostDate + "' where invoiceNumber='" + invoiceNumber + "' and aBi_Company_ID='" + aBi_Company_ID + "' and PaymentStatus!=4";
         return this.ExecCommand(selStr);
     }
     else
         return false;
 }
Exemplo n.º 2
0
 /// <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");
             }
         }
     }
 }
Exemplo n.º 3
0
        public bool Update(YB_Miro_IV_Swap yb)
        {
            ABi_Company abi_company = new ABi_Company();
            string company_id = abi_company.GetCompanyCodeByID(yb.Bukrs);
            if (string.IsNullOrEmpty(company_id) == false)
            {
                this.iVNumber = yb.Belnr;
                this.invoiceNumber = yb.Invoice_no;
                this.dueDate = yb.Zfbdt;
                this.IVPostDate = yb.Budat;
                this.aBi_Company_ID = Convert.ToInt32(company_id);
                this.payAmount = yb.Dmbtr;

                if (String.IsNullOrEmpty(yb.Lifnr) || yb.Lifnr.Trim().Length < 6)
                {
                    string selStr = "update ABi_Invoice set payAmount='" + this.payAmount + "', PaymentStatus='" + yb.Status_i + "',iVNumber='" + iVNumber + "',dueDate='" + dueDate + "',IVPostDate='" + IVPostDate + "' where invoiceNumber='" + invoiceNumber + "' and aBi_Company_ID='" + aBi_Company_ID + "' and PaymentStatus!=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 payAmount='{0}', PaymentStatus='{1}', IVNumber={2}, DueDate='{3}', IVPostDate='{4}' where
                                                    InvoiceNumber='{5}' and
                                                    ABi_Company_ID='{6}' and
                                                    ABi_Vendor_ID='{7}' and
                                                    LEFT(InvoiceDate, 4) = '{8}' and  PaymentStatus != 4 ",
                                                    payAmount, yb.Status_i, iVNumber, DueDate, IVPostDate,
                                                   invoiceNumber, company_id, v.ABi_Vendor_ID, yb.Invoice_date.Year); // "update ABi_Invoice set payAmount='" + this.payAmount + "', PaymentStatus='" + yb.Status_i + "',iVNumber='" + iVNumber + "',dueDate='" + dueDate + "',IVPostDate='" + IVPostDate + "' where invoiceNumber='" + invoiceNumber + "' and aBi_Company_ID='" + aBi_Company_ID + "' and PaymentStatus!=4";
                    return this.ExecCommand(selStr);

                }
            }
            else
                return false;
        }