private bool canCash(DataRow dataRow, bool pDbRow) { if (!ToolMobile.canPayment()) { return(false); } if (ToolMobile.isReader()) { return(false); } return(dataRow != null); }
public override EditingTools getAdapter(string pCmd) { string adpCode = ToolObjectName.getName(pCmd); EditingTools tools = new EditingTools(this); if (_adpCollection.ContainsKey(adpCode)) { return(_adpCollection[adpCode]); } else { switch (adpCode) { case ConstAdapterNames.adp_fin_cash_client_input: if (ToolMobile.canPayment()) { tools.form = typeof(MobUserEditorFormCashCollection); tools.adapter = new AdapterUserCashInputClient(this, new ImplAdapterDataSetStub(this, new AdapterDataSetCashInputClient((this)))); } break; case ConstAdapterNames.adp_fin_cash_client_output: if (ToolMobile.canPayment()) { tools.form = typeof(MobUserEditorFormCashPayment); tools.adapter = new AdapterUserCashOutputClient(this, new ImplAdapterDataSetStub(this, new AdapterDataSetCashOutputClient((this)))); } break; case ConstAdapterNames.adp_sls_doc_wholesaleret: tools.form = typeof(MobUserEditorFormWholesaleReturnSlip); tools.adapter = new AdapterUserWholesaleReturnSlip(this, new ImplAdapterDataSetStub(this, new AdapterDataSetWholesaleReturnSlip((this)))); break; case ConstAdapterNames.adp_sls_doc_wholesale: tools.form = typeof(MobUserEditorFormWholesaleSlip); tools.adapter = new AdapterUserWholesaleSlip(this, new ImplAdapterDataSetStub(this, new AdapterDataSetWholesaleSlip((this)))); break; case ConstAdapterNames.adp_sls_doc_order_wholesale: tools.form = typeof(MobUserEditorFormWholesaleOrder); tools.adapter = new AdapterUserWholesaleOrder(this, new ImplAdapterDataSetStub(this, new AdapterDataSetWholesaleOrder((this)))); break; case ConstAdapterNames.adp_sls_doc_order_wholesaleret: tools.form = typeof(MobUserEditorFormWholesaleReturnOrder); tools.adapter = new AdapterUserWholesaleReturnOrder(this, new ImplAdapterDataSetStub(this, new AdapterDataSetWholesaleReturnOrder((this)))); break; case ConstAdapterNames.adp_sls_doc_order_zero: tools.form = typeof(MobUserEditorFormZeroOrder); tools.adapter = new AdapterUserZeroOrder(this, new ImplAdapterDataSetStub(this, new AdapterDataSetZeroOrder((this)))); break; case ConstAdapterNames.adp_prch_doc_purchaseret: tools.form = typeof(MobUserEditorFormPurchaseReturnSlip); tools.adapter = new AdapterUserPurchaseReturnSlip(this, new ImplAdapterDataSetStub(this, new AdapterDataSetPurchaseReturnSlip((this)))); break; case ConstAdapterNames.adp_prch_doc_purchase: tools.form = typeof(MobUserEditorFormPurchaseSlip); tools.adapter = new AdapterUserPurchaseSlip(this, new ImplAdapterDataSetStub(this, new AdapterDataSetPurchaseSlip((this)))); break; case ConstAdapterNames.adp_prch_doc_order_purchase: tools.form = typeof(MobUserEditorFormPurchaseOrder); tools.adapter = new AdapterUserPurchaseOrder(this, new ImplAdapterDataSetStub(this, new AdapterDataSetPurchaseOrder((this)))); break; case ConstAdapterNames.adp_prch_doc_order_purchaseret: tools.form = typeof(MobUserEditorFormPurchaseReturnOrder); tools.adapter = new AdapterUserPurchaseReturnOrder(this, new ImplAdapterDataSetStub(this, new AdapterDataSetPurchaseReturnOrder((this)))); break; case ConstAdapterNames.adp_mm_doc_deficit: tools.form = typeof(MobUserEditorFormDeficitSlip); tools.adapter = new AdapterUserDeficitSlip(this, new ImplAdapterDataSetStub(this, new AdapterDataSetDeficitSlip((this)))); break; case ConstAdapterNames.adp_mm_doc_excess: tools.form = typeof(MobUserEditorFormExcessSlip); tools.adapter = new AdapterUserExcessSlip(this, new ImplAdapterDataSetStub(this, new AdapterDataSetExcessSlip((this)))); break; case ConstAdapterNames.adp_mm_doc_order_warehouse_list: tools.form = typeof(MobUserEditorFormWarehouseOrderList); tools.adapter = new AdapterUserWarehouseOrderList(this, new ImplAdapterDataSetStub(this, new AdapterDataSetWarehouseOrderList((this)))); break; case ConstAdapterNames.adp_mm_doc_order_warehouse_counting: tools.form = typeof(MobUserEditorFormWarehouseOrderCounting); tools.adapter = new AdapterUserWarehouseOrderCounting(this, new ImplAdapterDataSetStub(this, new AdapterDataSetWarehouseOrderCounting((this)))); break; case ConstAdapterNames.adp_mm_doc_order_warehouse_input: tools.form = typeof(MobUserEditorFormWarehouseOrderInput); tools.adapter = new AdapterUserWarehouseOrderInput(this, new ImplAdapterDataSetStub(this, new AdapterDataSetWarehouseOrderInput((this)))); break; case ConstAdapterNames.adp_mm_doc_order_warehouse_output: tools.form = typeof(MobUserEditorFormWarehouseOrderOutput); tools.adapter = new AdapterUserWarehouseOrderOutput(this, new ImplAdapterDataSetStub(this, new AdapterDataSetWarehouseOrderOutput((this)))); break; case ConstAdapterNames.adp_mm_doc_slip_warehouse_input: tools.form = typeof(MobUserEditorFormWarehouseSlipInput); tools.adapter = new AdapterUserWarehouseSlipInput(this, new ImplAdapterDataSetStub(this, new AdapterDataSetWarehouseSlipInput((this)))); break; case ConstAdapterNames.adp_mm_doc_slip_warehouse_output: tools.form = typeof(MobUserEditorFormWarehouseSlipOutput); tools.adapter = new AdapterUserWarehouseSlipOutput(this, new ImplAdapterDataSetStub(this, new AdapterDataSetWarehouseSlipOutput((this)))); break; } if (tools.adapter != null && tools.form != null) { _adpCollection.Add(pCmd, tools); return(tools); } } return(null); }
public override IDataReference getReference(string pCmd) { string refCode = ToolObjectName.getName(pCmd); IDataReference refer = null; if (_refCollection.ContainsKey(refCode)) { return(_refCollection[refCode]); } else { switch (refCode) { case ConstRefCode.material: refer = new MobDataReferenceMaterial(pCmd); break; case ConstRefCode.promoMaterial: refer = new MobDataReferencePromoMaterial(pCmd); break; case ConstRefCode.client: refer = new MobDataReferenceClients(pCmd); break; case ConstRefCode.string_: refer = new MobImplDataReferenceForStringSelect(pCmd); break; case ConstRefCode.date: refer = new MobImplDataReferenceForDateSelect(pCmd); break; case ConstRefCode.number: refer = new MobImplDataReferenceForValueSelectNum(pCmd); break; case ConstRefCode.numberPercent: refer = new MobImplDataReferenceForValueSelectNumPercent(pCmd); break; case ConstRefCode.docCashCollection: if (ToolMobile.canPayment()) { refer = new MobDataReferenceCashCollections(pCmd); } break; case ConstRefCode.docCashPayment: if (ToolMobile.canPayment()) { refer = new MobDataReferenceCashPayment(pCmd); } break; case ConstRefCode.docSales: refer = new MobDataReferenceSlipsSales(pCmd); break; case ConstRefCode.docSaleReturn: refer = new MobDataReferenceSlipsReturns(pCmd); break; case ConstRefCode.docOrderSale: refer = new MobDataReferenceOrdersSale(pCmd); break; case ConstRefCode.docOrderSaleReturn: refer = new MobDataReferenceOrdersReturn(pCmd); break; case ConstRefCode.docPurchase: refer = new MobDataReferenceSlipsPurchase(pCmd); break; case ConstRefCode.docPurchaseReturn: refer = new MobDataReferenceSlipsPurchaseReturns(pCmd); break; case ConstRefCode.docOrderPurchase: refer = new MobDataReferenceOrdersPurchase(pCmd); break; case ConstRefCode.docOrderPurchaseReturn: refer = new MobDataReferenceOrdersPurchaseReturn(pCmd); break; case ConstRefCode.materialBarcode: refer = new MobDataReferenceMaterialBarcode(pCmd); break; case ConstRefCode.promoMaterialBarcode: refer = new MobDataReferenceMaterialPromoBarcode(pCmd); break; case ConstRefCode.orderZero: refer = new MobDataReferenceOrdersZero(pCmd); break; case ConstRefCode.slipsExcess: refer = new MobDataReferenceSlipsExcess(pCmd); break; case ConstRefCode.slipsDeficit: refer = new MobDataReferenceSlipsDeficit(pCmd); break; case ConstRefCode.orderWarehouseIn: refer = new MobDataReferenceOrdersWarehouseInput(pCmd); break; case ConstRefCode.orderWarehouseOut: refer = new MobDataReferenceOrdersWarehouseOutput(pCmd); break; case ConstRefCode.orderWarehouseList: refer = new MobDataReferenceOrdersWarehouseList(pCmd); break; case ConstRefCode.orderWarehouseCounting: refer = new MobDataReferenceOrdersWarehouseCounting(pCmd); break; case ConstRefCode.slipWarehouseIn: refer = new MobDataReferenceSlipsWarehouseInput(pCmd); break; case ConstRefCode.slipWarehouseOut: refer = new MobDataReferenceSlipsWarehouseOutput(pCmd); break; } _refCollection.Add(refCode, refer); } return(refer); }