public static Guid?CalculateBumiClassification(Guid?AccountID) { try { Nullable <Guid> BumiClassificationCID = null; decimal bumiSharePercentage = GetBumiShareholderPercentage(AccountID); CodeMaster mgr = new CodeMaster(); if (bumiSharePercentage == 0) { BumiClassificationCID = mgr.GetCodeMasterIDWithNull(BOL.AppConst.CodeType.BumiClassification, "Others"); } else if (bumiSharePercentage > 50) { BumiClassificationCID = mgr.GetCodeMasterIDWithNull(BOL.AppConst.CodeType.BumiClassification, "Majority Bumi"); } else if (bumiSharePercentage <= 50) { BumiClassificationCID = mgr.GetCodeMasterIDWithNull(BOL.AppConst.CodeType.BumiClassification, "Bumi participation"); } return(BumiClassificationCID); } catch (Exception ex) { //MsgBox(ex.Message, MsgBoxStyle.OkOnly, "CalculateBumiClassification") return(null); } }
public static Guid?CalculateClassification(Guid?AccountID) { try { Nullable <Guid> ClassificationCID = null; double localSharePercentage = GetLocalCountryShareholderPercentage(AccountID); double foreignSharePercentage = GetForeignCountryShareholderPercentage(AccountID); CodeMaster mgr = new CodeMaster(); if (localSharePercentage == 50 && foreignSharePercentage == 50) { ClassificationCID = mgr.GetCodeMasterIDWithNull(BOL.AppConst.CodeType.Classification, "50/50"); } else if (localSharePercentage > foreignSharePercentage) { ClassificationCID = mgr.GetCodeMasterIDWithNull(BOL.AppConst.CodeType.Classification, "Malaysian Owned"); } else if (localSharePercentage < foreignSharePercentage) { ClassificationCID = mgr.GetCodeMasterIDWithNull(BOL.AppConst.CodeType.Classification, "Foreign Owned"); } return(ClassificationCID); } catch (Exception ex) { //MsgBox(ex.Message, MsgBoxStyle.OkOnly, "CalculateClassification") return(null); } }
public static Nullable <Guid> CalculateJVCategory(Guid?AccountID) { Nullable <Guid> JVCategoryCID = null; double foreignSharePercentage = GetForeignCountryShareholderPercentage(AccountID); double localSharePercentage = GetLocalCountryShareholderPercentage(AccountID); CodeMaster mgr = new CodeMaster(); if (localSharePercentage == 100 && foreignSharePercentage == 0) { JVCategoryCID = mgr.GetCodeMasterIDWithNull(BOL.AppConst.CodeType.JVCategory, "100% Malaysia"); } else if (localSharePercentage == 0 && foreignSharePercentage == 100) { JVCategoryCID = mgr.GetCodeMasterIDWithNull(BOL.AppConst.CodeType.JVCategory, "100% Foreign"); } else if (localSharePercentage == 50 && foreignSharePercentage == 50) { JVCategoryCID = mgr.GetCodeMasterIDWithNull(BOL.AppConst.CodeType.JVCategory, "50/50"); } else if (localSharePercentage < foreignSharePercentage) { JVCategoryCID = mgr.GetCodeMasterIDWithNull(BOL.AppConst.CodeType.JVCategory, "Majority Foreign"); } else if (localSharePercentage > foreignSharePercentage) { JVCategoryCID = mgr.GetCodeMasterIDWithNull(BOL.AppConst.CodeType.JVCategory, "Majority Local"); } return(JVCategoryCID); }