public static void ShowEditApprovedWindowEx(AccountDocumentType dt, MAccountDoc actDoc, GenericAccountDocCallback printCallBack) { int type = 1; String caption = ""; if (dt == AccountDocumentType.AcctDocCashPurchase) { caption = CLanguage.getValue("purchase_cash"); if (!CHelper.VerifyAccessRight("PURCHASE_BYCASH_VIEW")) { return; } } else if (dt == AccountDocumentType.AcctDocDebtPurchase) { caption = CLanguage.getValue("purchase_debt"); if (!CHelper.VerifyAccessRight("PURCHASE_BYCREDIT_VIEW")) { return; } } else if (dt == AccountDocumentType.AcctDocDrNotePurchase) { type = 2; caption = CLanguage.getValue("purchase_debit_note"); if (!CHelper.VerifyAccessRight("PURCHASE_DRNOTE_VIEW")) { return; } } else if (dt == AccountDocumentType.AcctDocCrNotePurchase) { type = 2; caption = CLanguage.getValue("purchase_credit_note"); if (!CHelper.VerifyAccessRight("PURCHASE_CRNOTE_VIEW")) { return; } } else if (dt == AccountDocumentType.AcctDocApReceipt) { caption = CLanguage.getValue("purchase_ap_receipt"); if (!CHelper.VerifyAccessRight("PURCHASE_RECEIPT_VIEW")) { return; } } else if (dt == AccountDocumentType.AcctDocMiscExpense) { caption = CLanguage.getValue("purchase_misc"); if (!CHelper.VerifyAccessRight("PURCHASE_MISC_VIEW")) { return; } } MAccountDoc v = (MAccountDoc)actDoc; if (type == 1) { WinAddEditAccountPurchaseDocApproved w = new WinAddEditAccountPurchaseDocApproved("E", dt, null, v); w.Caption = CLanguage.getValue("edit") + " " + caption; w.ShowDialog(); } else if (type == 2) { WinAddEditDrCrNoteApproved w = new WinAddEditDrCrNoteApproved("E", dt, null, v); w.Caption = CLanguage.getValue("edit") + " " + caption; w.ShowDialog(); } }
public static void ShowEditWindowEx(AccountDocumentType docType, MAccountDoc v, GenericAccountDocCallback printCallBack) { int type = 1; String caption = ""; if (docType == AccountDocumentType.AcctDocCashSale) { caption = CLanguage.getValue("sale_cash_saling"); if (!CHelper.VerifyAccessRight("SALE_BYCASH_VIEW")) { return; } } else if (docType == AccountDocumentType.AcctDocDebtSale) { caption = CLanguage.getValue("sale_debt_saling"); if (!CHelper.VerifyAccessRight("SALE_BYCREDIT_VIEW")) { return; } } else if (docType == AccountDocumentType.AcctDocDrNote) { type = 2; caption = CLanguage.getValue("sale_debit_note"); if (!CHelper.VerifyAccessRight("SALE_DRNOTE_VIEW")) { return; } } else if (docType == AccountDocumentType.AcctDocCrNote) { type = 2; caption = CLanguage.getValue("sale_credit_note"); if (!CHelper.VerifyAccessRight("SALE_CRNOTE_VIEW")) { return; } } else if (docType == AccountDocumentType.AcctDocArReceipt) { type = 3; caption = CLanguage.getValue("sale_ar_receipt"); if (!CHelper.VerifyAccessRight("SALE_RECEIPT_VIEW")) { return; } } else if (docType == AccountDocumentType.AcctDocBillSummary) { type = 6; caption = CLanguage.getValue("bill_summary"); if (!CHelper.VerifyAccessRight("SALE_BILLSUM_VIEW")) { return; } } else if (docType == AccountDocumentType.AcctDocMiscRevenue) { type = 4; caption = CLanguage.getValue("sale_misc"); if (!CHelper.VerifyAccessRight("SALE_MISC_VIEW")) { return; } } else if (docType == AccountDocumentType.AcctDocCashDepositAr) { type = 5; caption = CLanguage.getValue("cash_deposit_ar"); if (!CHelper.VerifyAccessRight("SALE_DEPOSIT_VIEW")) { return; } } else if (docType == AccountDocumentType.AcctDocSaleOrder) { type = 1; caption = CLanguage.getValue("sale_order"); if (!CHelper.VerifyAccessRight("SALE_ORDER_VIEW")) { return; } } if (type == 1) { WinAddEditAccountSaleDoc w = new WinAddEditAccountSaleDoc("E", docType, null, v, v.IsPromotionMode); w.Caption = CLanguage.getValue("edit") + " " + caption; w.ShowDialog(); if (w.IsPreviewNeed) { printCallBack?.Invoke(v, w.CreatedID, docType); } } else if (type == 2) { WinAddEditDrCrNote w = new WinAddEditDrCrNote("E", docType, null, v); w.Caption = CLanguage.getValue("edit") + " " + caption; w.ShowDialog(); } else if (type == 3) { WinAddEditReceiptDoc w = new WinAddEditReceiptDoc("E", docType, null, v); w.Caption = CLanguage.getValue("edit") + " " + caption; w.ShowDialog(); if (w.IsPreviewNeed) { printCallBack?.Invoke(v, w.CreatedID, docType); } } else if (type == 4) { WinAddEditAccountMiscDoc w = new WinAddEditAccountMiscDoc("E", docType, null, v); w.Caption = CLanguage.getValue("edit") + " " + caption; w.ShowDialog(); if (w.IsPreviewNeed) { printCallBack?.Invoke(v, w.CreatedID, docType); } } else if (type == 5) { WinAddEditCashDeposit w = new WinAddEditCashDeposit("E", docType, null, v); //w.Caption = CLanguage.getValue("edit") + " " + caption; w.ShowDialog(); if (w.IsPreviewNeed) { printCallBack?.Invoke(v, w.CreatedID, docType); } } else if (type == 6) { WinAddEditBillSummary w = new WinAddEditBillSummary("E", docType, null, v); w.Caption = CLanguage.getValue("edit") + " " + caption; w.ShowDialog(); //if (w.IsPreviewNeed) //{ // printCallBack?.Invoke(v, w.CreatedID, docType); //} } }