private void LoadData() { isInLoadData = true; this.Title = Caption; dtDocumentDate.Focus(); vw.CreateDefaultValue(); CUtil.EnableForm(false, this); if (Mode.Equals("E")) { CTable m = OnixWebServiceAPI.GetAccountDocInfo(actualView.GetDbObject()); if (m != null) { vw.SetDbObject(m); vw.NotifyAllPropertiesChanged(); } } else if (Mode.Equals("A")) { vw.DocumentDate = DateTime.Now; vw.DocumentType = ((int)dt).ToString(); vw.AllowCashNegative = CGlobalVariable.IsCashNegativeAllow(); vw.AllowARAPNegative = CGlobalVariable.IsArApNegativeAllow(); vw.AllowInventoryNegative = CGlobalVariable.IsInventoryNegativeAllow(); } vw.IsModified = false; isInLoadData = false; CUtil.EnableForm(true, this); }
protected override MBaseModel createObject() { MCheque av = (MCheque)loadParam.ActualView; MCheque mv = new MCheque(new CTable("")); mv.CreateDefaultValue(); mv.ChequeDate = DateTime.Now; mv.Direction = loadParam.GenericType; if (av != null) { //Default value mv.EntityObj = av.EntityObj; mv.PayeeName = av.PayeeName; mv.ChequeAmount = av.ChequeAmount; } mv.IssueDate = DateTime.Now; mv.ChequeDate = DateTime.Now; mv.ChequeStatus = ((int)InventoryDocumentStatus.InvDocPending).ToString(); mv.IsAcPayeeOnly = true; mv.AllowNegative = CGlobalVariable.IsCashNegativeAllow(); return(mv); }
private void LoadData() { isInLoadData = true; this.Title = Caption; dtFromDate.Focus(); vw.CreateDefaultValue(); CUtil.EnableForm(false, this); if (Mode.Equals("E")) { CTable m = getDocInfoWrapper(); if (m != null) { vw.SetDbObject(m); vw.InitAccountDocItem(); vw.InitAccountDocPayment(); String tmp = vw.EntityAddressID; vw.InitEntityAddresses(); vw.EntityAddressID = tmp; vw.AddressObj = CUtil.MasterIDToObject(vw.EntityAddresses, vw.EntityAddressID); vw.BillSimulate.InitPromotionItems(); vw.BillSimulate.InitSelectedItems(); vw.NotifyAllPropertiesChanged(); } vw.IsModified = false; } else if (Mode.Equals("A")) { vw.DocumentDate = DateTime.Now; vw.VAT_PCT = CGlobalVariable.GetGlobalVariableValue("VAT_PERCENTAGE"); vw.VATType = CGlobalVariable.GetGlobalVariableValue("DEFAULT_VAT_TYPE_SALE"); vw.AllowCashNegative = CGlobalVariable.IsCashNegativeAllow(); vw.AllowARAPNegative = CGlobalVariable.IsArApNegativeAllow(); vw.AllowInventoryNegative = CGlobalVariable.IsInventoryNegativeAllow(); vw.IsModified = (actualView != null); } isInLoadData = false; CUtil.EnableForm(true, this); }
private void LoadData() { isInLoadData = true; this.Title = Caption; dtFromDate.Focus(); vw.CreateDefaultValue(); CUtil.EnableForm(false, this); if (Mode.Equals("E")) { //CTable m = OnixWebServiceAPI.GetAccountDocInfo(actualView.GetDbObject()); CTable m = getDocInfoWrapper(); if (m != null) { vw.SetDbObject(m); vw.InitAccountDocReceipt(); vw.InitAccountDocPayment(); String tmp = vw.EntityAddressID; vw.InitEntityAddresses(); vw.EntityAddressID = tmp; vw.AddressObj = CUtil.MasterIDToObject(vw.EntityAddresses, vw.EntityAddressID); vw.NotifyAllPropertiesChanged(); } } else if (Mode.Equals("A")) { vw.DocumentDate = DateTime.Now; vw.VAT_PCT = CGlobalVariable.GetGlobalVariableValue("VAT_PERCENTAGE");; vw.AllowCashNegative = CGlobalVariable.IsCashNegativeAllow(); vw.AllowARAPNegative = CGlobalVariable.IsArApNegativeAllow(); vw.AllowInventoryNegative = CGlobalVariable.IsInventoryNegativeAllow(); vw.IsWhPayType1 = true; } vw.IsModified = false; isInLoadData = false; CUtil.EnableForm(true, this); }
protected override MBaseModel createObject() { MCashDoc mv = null; if (docType == CashDocumentType.CashDocImport) { mv = new MCashDocIn(new CTable("")); } else if (docType == CashDocumentType.CashDocExport) { mv = new MCashDocOut(new CTable("")); } mv.CreateDefaultValue(); mv.DocumentDate = DateTime.Now; mv.DocumentType = ((Int32)docType).ToString(); mv.IsInternalDoc = false; mv.DocumentStatus = ((int)CashDocumentStatus.CashDocPending).ToString(); mv.AllowNegative = CGlobalVariable.IsCashNegativeAllow(); return(mv); }