internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContentsRow, PXSqlMeta_21 meta, SqlDbConfig_21 config) { mStatAuthorityCode = someContentsRow.StatAuthority; string copyright = someContentsRow.Copyright; if (copyright.Equals(config.Codes.Copyright1) || copyright.Equals(config.Codes.Copyright2)) { mCopyright = false; } else if (copyright.Equals(config.Codes.Copyright3)) { mCopyright = true; } else { mCopyright = true; log.Error("The database has copyright=" + copyright + ", but the valid codes from config are " + config.Codes.Copyright1 + "," + config.Codes.Copyright2 + " or " + config.Codes.Copyright3 + "."); } if (copyright.Equals(config.Codes.Copyright1)) { mOfficialStatistics = true; } else { mOfficialStatistics = false; } OrganizationRow org = meta.MetaQuery.GetOrganizationRow(mStatAuthorityCode); foreach (string language in org.texts.Keys) { nameByLangCode.Add(language, org.texts[language].OrganizationName); } }
public static OrganizationRow GetOrganizationRow(int ownerEmpId, PPPEntities db) { var rtn = new OrganizationRow(); var p = db.TPeople.FirstOrDefault(x => x.EmployeeId == ownerEmpId); if (p != null && p.OrganizationId != null) { rtn.OrganizationId = (int)p.OrganizationId; rtn.OwnerId = ownerEmpId; rtn.EmpName = p.PeopleNameEn; return(rtn); } else { return(null); } }
public PricesPurchaseRow AddPricesPurchaseRow(OrganizationRow parentOrganizationRowByOrganization_PricesPurchase, ProductRow parentProductRowByProduct_PricesPurchase, decimal PricePurchase, System.DateTime Date, string OrganizationName) { PricesPurchaseRow rowPricesPurchaseRow = ((PricesPurchaseRow)(this.NewRow())); rowPricesPurchaseRow.ItemArray = new object[] { parentOrganizationRowByOrganization_PricesPurchase[0], parentProductRowByProduct_PricesPurchase[0], PricePurchase, Date, OrganizationName}; this.Rows.Add(rowPricesPurchaseRow); return rowPricesPurchaseRow; }
/// <summary> /// Builds the Contactstring for each language in meta.LanguageCodes. /// </summary> public PXSqlContact(PXSqlMeta_24 meta, string mMainTableId) { foreach (string language in meta.LanguageCodes) { mBigFatContactStringsByLanguage.Add(language, ""); } try { Dictionary <string, MainTablePersonRow> personIDs = new Dictionary <string, MainTablePersonRow>(); try { foreach (KeyValuePair <string, MainTablePersonRow> RoleMain in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleMain, false)) { if (!personIDs.ContainsKey(RoleMain.Key)) { personIDs.Add(RoleMain.Key, RoleMain.Value); } } } catch (Exceptions.PCAxisSqlException e) { log.Error("Cant add RoleMain", e); } try { foreach (KeyValuePair <string, MainTablePersonRow> RoleContact in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleContact, true)) { if (!personIDs.ContainsKey(RoleContact.Key)) { personIDs.Add(RoleContact.Key, RoleContact.Value); } } } catch (Exceptions.PCAxisSqlException e) { log.Error("Cant add RoleContact", e); } bool firstPerson = true; foreach (string personId in personIDs.Keys) { PersonRow person = meta.MetaQuery.GetPersonRow(personId); if (!orgs.ContainsKey(person.OrganizationCode)) { orgs.Add(person.OrganizationCode, meta.MetaQuery.GetOrganizationRow(person.OrganizationCode)); } OrganizationRow org = orgs[person.OrganizationCode]; foreach (string language in meta.LanguageCodes) { if (!firstPerson) { //mBigFatContactStringsByLanguage[language] += "#"; // mBigFatContactStringsByLanguage[language] += "||"; } //mBigFatContactStringsByLanguage[language] += person.Forename + " " + person.Surname + ", " + org.texts[language].OrganizationName + // "# " + PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactPhone", language) + ": " + person.PhonePrefix + " " + person.PhoneNo + // "#" + PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactFax", language) + ": " + person.PhonePrefix + " " + person.FaxNo + // "#" + PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactEMail", language) + ": " + person.Email; mBigFatContactStringsByLanguage[language] += person.Forename + "#" + person.Surname + "# " + person.PhonePrefix + "#" + person.PhoneNo + "#" + person.Email + "#" + org.texts[language].OrganizationName + "#" + org.texts[language].Department + "#" + org.texts[language].Unit + "||"; } firstPerson = false; } } catch (Exceptions.PCAxisSqlException e) { log.Error("Cant find contact info", e); } }
public ReceiptMasterRow AddReceiptMasterRow( string Note, System.DateTime DocDate, DocumentTypeRow parentDocumentTypeRowByFK_ReceiptMaster_DocumentType, OrganizationRow parentOrganizationRowByFK_ReceiptMaster_Organization, StockRow parentStockRowByFK_ReceiptMaster_Stock, int SenderStockRef, int SenderInvoiceRef, decimal SalesSum, decimal PurchSum, decimal PurchNDS, decimal SalesNDS, bool IsReadOnly, string AuthorCreate, string AuthorLastModif, System.DateTime DateCreate, byte[] RowVersion, bool RecalcSum, string OrganizationName, decimal CalcPurchSum, bool IsNDS, System.DateTime DateUpdateDetail, System.DateTime DateLastModif) { ReceiptMasterRow rowReceiptMasterRow = ((ReceiptMasterRow)(this.NewRow())); rowReceiptMasterRow.ItemArray = new object[] { null, null, Note, DocDate, parentDocumentTypeRowByFK_ReceiptMaster_DocumentType[0], parentOrganizationRowByFK_ReceiptMaster_Organization[0], parentStockRowByFK_ReceiptMaster_Stock[0], SenderStockRef, SenderInvoiceRef, SalesSum, PurchSum, PurchNDS, SalesNDS, IsReadOnly, AuthorCreate, AuthorLastModif, DateCreate, RowVersion, RecalcSum, OrganizationName, CalcPurchSum, IsNDS, DateUpdateDetail, DateLastModif}; this.Rows.Add(rowReceiptMasterRow); return rowReceiptMasterRow; }
public void RemoveOrganizationRow(OrganizationRow row) { this.Rows.Remove(row); }
public void AddOrganizationRow(OrganizationRow row) { this.Rows.Add(row); }
public InvoiceMasterRow AddInvoiceMasterRow( System.DateTime Date, OrganizationRow parentOrganizationRowByFK_InvoiceMaster_Organization, int DocumentTypeRef, StockRow parentStockRowByFK_Stock_InvoiceMaster, int RemoteReceiptMasterRef, int RemoteInvoiceMasterRef, bool IsReadOnly, decimal Sum, decimal Nds, string AuthorCreate, string AuthorLastModif, System.DateTime DateCreate, byte[] RowVersion, string Note, System.DateTime DateLastModif, StockRow parentStockRowByFK_InvoiceMaster_StockMain, bool RecalcSum, bool IsNDS, bool IsNDSMain, string TradePupletName, string EXTRA, decimal ExtraPercent) { InvoiceMasterRow rowInvoiceMasterRow = ((InvoiceMasterRow)(this.NewRow())); rowInvoiceMasterRow.ItemArray = new object[] { null, null, Date, parentOrganizationRowByFK_InvoiceMaster_Organization[0], DocumentTypeRef, parentStockRowByFK_Stock_InvoiceMaster[0], RemoteReceiptMasterRef, RemoteInvoiceMasterRef, IsReadOnly, Sum, Nds, AuthorCreate, AuthorLastModif, DateCreate, RowVersion, Note, DateLastModif, parentStockRowByFK_InvoiceMaster_StockMain[0], RecalcSum, IsNDS, IsNDSMain, TradePupletName, EXTRA, ExtraPercent}; this.Rows.Add(rowInvoiceMasterRow); return rowInvoiceMasterRow; }
public OrganizationRowChangeEvent(OrganizationRow row, System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; }