// public static string Get_CalculatedProperty(fmIDocCacheJournal instance) { // // A "Get_" method is executed when getting a target property value. The target property should be readonly. // // Use this method to implement calculated properties. // return ""; // } // public static void AfterChange_PersistentProperty(fmIDocCacheJournal instance) { // // An "AfterChange_" method is executed after a target property is changed. The target property should not be readonly. // // Use this method to refresh dependant property values. // } // public static void AfterConstruction(fmIDocCacheJournal instance) { // // The "AfterConstruction" method is executed only once, after an object is created. // // Use this method to initialize new objects with default property values. // } public static fmIDocCacheJournalLine RegisterDocument(IObjectSpace os_doc, fmIDocCache doc) //, IObjectSpace os_jur) { // You can also define custom methods. { fmIDocCacheJournalLine line = os_doc.FindObject <fmIDocCacheJournalLine>(new BinaryOperator("Document", doc)); fmIDocCacheJournal journal = null; if (line != null) { return(line); } Int32 date_delimiter = 0; switch (doc.JournalType) { case fmIDocCacheJournalType.JOURNAL_PREPARE: date_delimiter = doc.DocDate.Year; journal = os_doc.FindObject <fmIDocCacheJournal>( CriteriaOperator.And(new BinaryOperator("JournalType", doc.JournalType), new BinaryOperator("DateDelimiter", date_delimiter))); if (journal == null) { journal = os_doc.CreateObject <fmIDocCacheJournal>(); journal.JournalType = doc.JournalType; journal.DateDelimiter = date_delimiter; } line = os_doc.CreateObject <fmIDocCacheJournalLine>(); journal.Lines.Add(line); journal.CurrentNumber++; line.NumberSequence = journal.CurrentNumber; line.Document = doc; return(line); // break; } return(null); }
public static void AfterConstruction(fmIDocCache instance, IObjectSpace os) { // The "AfterConstruction" method is executed only once, after an object is created. // Use this method to initialize new objects with default property values. instance.DocDate = DateTime.Now; if (crmUserParty.CurrentUserParty != null) { if (crmUserParty.CurrentUserParty.Value != null) { instance.DocParty = crmUserParty.CurrentUserPartyGet(os).Party; } } csCSecurityUser user = SecuritySystem.CurrentUser as csCSecurityUser; user = os.GetObject <csCSecurityUser>(user); if (user != null && user.Staff != null) { instance.DocPartyDepartment = user.Staff.Department; } instance.AccountDebit = os.FindObject <fmCFAAccount>( CriteriaOperator.And( new BinaryOperator("AccountSystem.Code", "1000"), new BinaryOperator("BuhCode", "5011") )); instance.AccountCredit = os.FindObject <fmCFAAccount>( CriteriaOperator.And( new BinaryOperator("AccountSystem.Code", "1000"), new BinaryOperator("BuhCode", "6242") )); instance.AVTMode = "1"; }
public static String Get_SummaSeniorString(fmIDocCache instance) { // A "Get_" method is executed when getting a target property value. The target property should be readonly. // // Use this method to implement calculated properties. Int64 val = (Int64)instance.Summa; return(RSDN.RusNumber.Str(val, true)); }
public static void AfterChange_PayPartyStaff(fmIDocCache instance) { if (instance.PayPartyStaff != null) { instance.PayPartyType = fmIDocCachePartyType.PARTY_STAFF; instance.UpdatePartyName(); } }
public static String Get_SummaJuniorString(fmIDocCache instance) { // A "Get_" method is executed when getting a target property value. The target property should be readonly. // // Use this method to implement calculated properties. Int64 val = (Int64)instance.Summa; val = ((Int64)(instance.Summa * 100)) - val * 100; return(val.ToString("D2")); }
public static void AfterChange_PayPartyType(fmIDocCache instance) { if (instance.PayPartyType == fmIDocCachePartyType.PARTY_STAFF) { instance.PayPartyParty = null; } if (instance.PayPartyType == fmIDocCachePartyType.PARTY_PARTY) { instance.PayPartyStaff = null; } }
public static String Get_AnaliticCode(fmIDocCache instance) { if (instance.Lines.Count > 0) { return(instance.Lines[0].AnaliticCode); } else { return(String.Empty); } }
public static void Set_PayPartyParty(fmIDocCache instance, crmIParty party) { if (party != null) { instance.PayPartyPartyC = party.Party; } else { instance.PayPartyPartyC = null; } }
//public static String Get_PayPartyName(fmIDocCache instance) { // // A "Get_" method is executed when getting a target property value. The target property should be readonly. // // Use this method to implement calculated properties. // if (instance.PayPartyParty != null) // return instance.PayPartyParty.Name; // else if (instance.PayPartyStaff != null) // return instance.PayPartyStaff.NameFull; // else // return String.Empty; //} public static void UpdatePartyName(fmIDocCache instance) { // A "Get_" method is executed when getting a target property value. The target property should be readonly. // Use this method to implement calculated properties. if (instance.PayPartyParty != null) { instance.PayPartyName = instance.PayPartyParty.Name; } else if (instance.PayPartyStaff != null) { instance.PayPartyName = instance.PayPartyStaff.NameFull; } else { instance.PayPartyName = String.Empty; } }
public static void AfterChange_PersistentProperty(fmIDocCache instance) { // An "AfterChange_" method is executed after a target property is changed. The target property should not be readonly. // Use this method to refresh dependant property values. }
public static String Get_SummaString(fmIDocCache instance) { return(instance.SummaSeniorString + " руб. " + instance.SummaJuniorString + " коп."); }
public static Int64 Get_SummaSenior(fmIDocCache instance) { return((Int64)instance.Summa); }
public static crmIParty Get_PayPartyParty(fmIDocCache instance) { return(instance.PayPartyPartyC); }
public static IList <hrmStaff> Get_GrossAccountStaffList(fmIDocCache instance, IObjectSpace os) { return(fmCSettingsFinance.GetInstance(os).ManagerGroupOfSignAccountDepartmentStaffs); }