public override EvaluateSource GetNewValues(EvaluateSource initValues) { ConfigCode scheduleCode = (ConfigCode)ArticleCodeCz.FACT_CONTRACT_TIMESHEET; Result <MonthScheduleValue, string> scheduleResult = InternalValues .FindResultValue <ArticleGeneralResult, MonthScheduleValue>( TargetFilters.TargetCodePlusPartFunc(scheduleCode, InternalTarget.Head(), InternalTarget.Part()), (x) => (x.IsRealMonthValue())); if (scheduleResult.IsFailure) { return(ReturnFailureAndError(initValues, scheduleResult.Error)); } MonthScheduleValue scheduleValues = scheduleResult.Value; return(new EvaluateSource { // PROPERTIES SET AbsenceCode = initValues.AbsenceCode, DayFrom = initValues.DayFrom, DayStop = initValues.DayStop, SchedulePiece = initValues.SchedulePiece, ScheduleHours = initValues.ScheduleHours, ScheduleMonth = scheduleValues.HoursMonth.ToArray(), // PROPERTIES SET }); }
public override EvaluateSource GetNewValues(EvaluateSource initValues) { ConfigCode declaracyCode = (ConfigCode)ArticleCodeCz.FACT_INS_DECLARATION_SOCIAL; Result <DeclarationSocialValue, string> declaracyResult = InternalValues .FindResultValue <ArticleGeneralResult, DeclarationSocialValue>( TargetFilters.TargetCodePlusHeadAndNullPartFunc(declaracyCode, InternalTarget.Head()), (x) => (x.IsDeclarationSocialValue())); Result <MoneyPaymentSum, string> includeIncome = GetIncludeIncome(InternalValues, InternalTarget); Result <MoneyPaymentSum, string> excludeIncome = GetExcludeIncome(InternalValues, InternalTarget); if (ResultMonadUtils.HaveAnyResultFailed(declaracyResult, includeIncome, excludeIncome)) { return(ReturnFailureAndError(initValues, ResultMonadUtils.FirstFailedResultError(declaracyResult, includeIncome, excludeIncome))); } DeclarationSocialValue declaracyValues = declaracyResult.Value; MoneyPaymentSum includeValues = includeIncome.Value; MoneyPaymentSum excludeValues = excludeIncome.Value; return(new EvaluateSource { // PROPERTIES SET SummarizeType = declaracyValues.SummarizeType, IncludeIncome = includeValues.Balance(), ExcludeIncome = excludeValues.Balance(), // PROPERTIES SET }); }
/// <summary> /// ╦Ы╬щеДжц╠ЮбК╩Ях║еДжцпео╒ /// </summary> /// <param name="type"></param> /// <returns></returns> public GameServerConfigEntity Get(ConfigCode code) { GameServerConfigEntity entity = null; if (m_List == null || m_List.Count == 0) { entity = new GameServerConfigEntity() { ConfigCode = code.ToString() }; m_List.Add(entity); } for (int i = 0; i < m_List.Count; i++) { if (m_List[i].ConfigCode.Equals(code.ToString(), System.StringComparison.CurrentCultureIgnoreCase)) { entity = m_List[i]; break; } } if (entity == null) { entity = new GameServerConfigEntity() { ConfigCode = code.ToString() }; m_List.Add(entity); } return(entity); }
public override EvaluateSource GetNewValues(EvaluateSource initValues) { ConfigCode workCode = (ConfigCode)ArticleCodeCz.FACT_POSITION_SCHEDULE; Result <MonthScheduleValue, string> workFindResult = InternalValues .FindResultValue <ArticleGeneralResult, MonthScheduleValue>( TargetFilters.TargetCodePlusPartFunc(workCode, InternalTarget.Head(), InternalTarget.Part()), (x) => (x.IsRealMonthValue())); MonthScheduleValue workValuesPrep = workFindResult.Value; ConfigCode termCode = (ConfigCode)ArticleCodeCz.FACT_POSITION_TERM; Result <MonthFromStopValue, string> termFindResult = InternalValues .FindResultValue <ArticleGeneralResult, MonthFromStopValue>( TargetFilters.TargetCodePlusHeadAndSeedFunc(termCode, InternalTarget.Head(), InternalTarget.Part()), (x) => (x.IsMonthFromStopValue())); if (ResultMonadUtils.HaveAnyResultFailed(workFindResult, workFindResult)) { return(ReturnFailureAndError(initValues, ResultMonadUtils.FirstFailedResultError(workFindResult, workFindResult))); } MonthFromStopValue termValuesPrep = termFindResult.Value; return(new EvaluateSource { // PROPERTIES SET DayTermFrom = termValuesPrep.PeriodDayFrom, DayTermStop = termValuesPrep.PeriodDayStop, RealMonthHours = workValuesPrep.HoursMonth, // PROPERTIES SET }); }
public ArticleTarget(TargetHead codeHead, TargetPart codePart, ConfigCode codeBody, TargetSeed seedBody) { this.InternalHead = codeHead; this.InternalPart = codePart; this.InternalCode = codeBody; this.InternalSeed = seedBody; }
public override EvaluateSource GetNewValues(EvaluateSource initValues) { ConfigCode termCode = (ConfigCode)ArticleCodeCz.FACT_CONTRACT_TERM; Result <MonthFromStopValue, string> termFindResult = InternalValues .FindResultValue <ArticleGeneralResult, MonthFromStopValue>( TargetFilters.TargetCodePlusSeedFunc(termCode, InternalTarget.Head()), (x) => (x.IsMonthFromStopValue())); if (termFindResult.IsFailure) { return(ReturnFailureAndError(initValues, termFindResult.Error)); } MonthFromStopValue termPrepValues = termFindResult.Value; return(new EvaluateSource { // PROPERTIES SET DateTermFrom = initValues.DateTermFrom, DateTermStop = initValues.DateTermStop, PositionType = initValues.PositionType, DayContractFrom = termPrepValues.PeriodDayFrom, DayContractStop = termPrepValues.PeriodDayStop, // PROPERTIES SET }); }
void setCheckBox(CheckBox checkbox, ConfigCode code) { ConfigItem <bool> item = (ConfigItem <bool>)ConfigData.Instance.GetDebugItem(code); checkbox.Checked = item.Value; checkbox.Enabled = !item.Fixed; }
private Result <IEnumerable <PositionEvaluateSource>, string> GetPositionValues() { ConfigCode positionCode = (ConfigCode)ArticleCodeCz.FACT_POSITION_TERM; ConfigCode scheduleCode = (ConfigCode)ArticleCodeCz.FACT_POSITION_TIMESHEET; Result <IEnumerable <ResultPair>, string> positionList = InternalValues .GetTypedResultsInListAndError <ArticleGeneralResult>( TargetFilters.TargetCodePlusHeadFunc(positionCode, InternalTarget.Head())); Result <IEnumerable <ResultPair>, string> scheduleList = InternalValues .GetTypedResultsInListAndError <ArticleGeneralResult>( TargetFilters.TargetCodePlusHeadFunc(scheduleCode, InternalTarget.Head())); if (ResultMonadUtils.HaveAnyResultFailed(positionList, scheduleList)) { return(Result.Fail <IEnumerable <PositionEvaluateSource>, string>( ResultMonadUtils.FirstFailedResultError(positionList, scheduleList))); } var positionZips = GetZip2Position(positionList.Value, scheduleList.Value); if (positionZips.IsFailure) { return(Result.Fail <IEnumerable <PositionEvaluateSource>, string>(positionZips.Error)); } var positionStream = positionZips.Value.Select((tp) => (BuildItem(tp.Key, tp.Value.Item1, tp.Value.Item2))).ToList(); return(positionStream.ToResultWithValueListAndError((tp) => (tp))); }
void setTextBox(TextBox textBox, ConfigCode code) { ConfigItem <string> item = (ConfigItem <string>)ConfigData.Instance.GetDebugItem(code); textBox.Text = item.Value; textBox.Enabled = !item.Fixed; }
void setColorBox(ColorBox colorBox, ConfigCode code) { ConfigItem <Color> item = (ConfigItem <Color>)ConfigData.Instance.GetDebugItem(code); colorBox.SelectingColor = item.Value; colorBox.Enabled = !item.Fixed; }
public override EvaluateSource GetNewValues(EvaluateSource initValues) { ConfigCode termCode = (ConfigCode)ArticleCodeCz.FACT_POSITION_TERM; Result <MonthFromStopValue, string> termFindResult = InternalValues .FindResultValue <ArticleGeneralResult, MonthFromStopValue>( TargetFilters.TargetCodePlusHeadAndSeedFunc(termCode, InternalTarget.Head(), InternalTarget.Part()), (x) => (x.IsMonthFromStopValue())); if (termFindResult.IsFailure) { return(ReturnFailureAndError(initValues, termFindResult.Error)); } MonthFromStopValue termPrepValues = termFindResult.Value; var absenceValues = GetAbsenceValues(); if (absenceValues.IsFailure) { return(ReturnFailureAndError(initValues, absenceValues.Error)); } var completeSorted = absenceValues.Value.OrderBy((p) => (p), new CompareAbsenceTerms()); return(new EvaluateSource { // PROPERTIES SET DayPositionFrom = termPrepValues.PeriodDayFrom, DayPositionStop = termPrepValues.PeriodDayStop, AbsenceList = completeSorted.ToList(), // PROPERTIES SET }); }
public TargetItem AddMainPart(TargetHead codeHead, ISourceValues tagsBody) { TargetPart PART_CODE = ArticleTarget.PART_CODE_NULL; ConfigCode BODY_CODE = GetPartConfigCode(); return(AddGeneralItem(codeHead, PART_CODE, BODY_CODE, ArticleTarget.BODY_SEED_NULL, tagsBody)); }
public override EvaluateSource GetNewValues(EvaluateSource initValues) { ConfigCode scheduleCode = (ConfigCode)ArticleCodeCz.FACT_POSITION_TIMESHEET; ConfigCode absencesCode = (ConfigCode)ArticleCodeCz.FACT_POSITION_ABSENCE; Result <MonthScheduleValue, string> scheduleResult = InternalValues .FindResultValue <ArticleGeneralResult, MonthScheduleValue>( TargetFilters.TargetCodePlusPartFunc(scheduleCode, InternalTarget.Head(), InternalTarget.Part()), (x) => (x.IsTermMonthValue())); Result <MonthScheduleValue, string> absencesResult = InternalValues .FindResultValue <ArticleGeneralResult, MonthScheduleValue>( TargetFilters.TargetCodePlusPartFunc(absencesCode, InternalTarget.Head(), InternalTarget.Part()), (x) => (x.IsTermMonthValue())); if (ResultMonadUtils.HaveAnyResultFailed(scheduleResult, absencesResult)) { return(ReturnFailureAndError(initValues, ResultMonadUtils.FirstFailedResultError(scheduleResult, absencesResult))); } MonthScheduleValue scheduleValues = scheduleResult.Value; MonthScheduleValue absencesValues = absencesResult.Value; return(new EvaluateSource { // PROPERTIES SET ScheduleMonth = scheduleValues.HoursMonth, AbsencesMonth = absencesValues.HoursMonth, // PROPERTIES SET }); }
public ActionResult PaymentReturn(string token, string key, int type = 0) { string result; //DEBUG //Logger.GetInstance().Write("Payment Return URL:"); //Logger.GetInstance().Write(Request.Url.AbsoluteUri.ToString()); if (type == ReturnType.Cancel.GetHashCode() || type == ReturnType.Timeout.GetHashCode() || string.IsNullOrEmpty(key) || string.IsNullOrEmpty(token)) { result = DbContext.CancelUrl(key); return(Redirect(result)); } var db = new DbContext(); var details = db.GetDetails(key); if (details != null && details.ProviderTransRefId == token) { var info = new RequestCheckOrder(); info.Merchant_id = ConfigCode.GetInstance().MerchantID; info.Merchant_password = ConfigCode.GetInstance().MerchantPassword; info.Token = token; var objApiCheckout = new APICheckoutV3(); ResponseCheckOrder checkOrderRs = objApiCheckout.GetTransactionDetail(info); //DEBUG //Logger.GetInstance().Write("Transaction details:"); // Logger.GetInstance().Write(JsonConvert.SerializeObject(checkOrderRs)); switch (checkOrderRs.transactionStatus) { case "00": details.PaymentStatus = EnumPaymentStatus.Paid.GetHashCode(); break; case "01": details.PaymentStatus = EnumPaymentStatus.Pending.GetHashCode(); break; case "02": details.PaymentStatus = EnumPaymentStatus.Unpaid.GetHashCode(); break; } var updateRs = db.SetDetails(key, details); // Build the success url and redirect back to Arcadier result = DbContext.SuccessUrl(key, ""); return(Redirect(result)); } else { // Build the failure url and redirect back to Arcadier result = DbContext.CancelUrl(key); return(Redirect(result)); } }
public T GetConfigValue <T>(ConfigCode code) { AConfigItem item = GetItem(code); //if ((item != null) && (item is ConfigItem<T>)) return(((ConfigItem <T>)item).Value); //throw new ExeEE("GetConfigValueのCodeまたは型が不適切"); }
private IEnumerable <TargetHead> SelectContractCode(ConfigCode contractCode) { IEnumerable <TargetItem> targetsInit = GetTargets(); var contractsHead = targetsInit.Where((ch) => (ch.Code() == contractCode)).Select((cv) => (cv.Seed())); return(contractsHead); }
protected SourcePack GetTemplateSourceForArticle(ConfigCode codeBody, ISourceValues tagsBody) { if (ModelSourceProfile == null) { return(Result.Fail <IArticleSource, string>(EXCEPTION_CONFIG_NULL_TEXT)); } return(ModelSourceProfile.CloneInstanceForCode(codeBody, tagsBody)); }
public TargetItem AddMainHead(ISourceValues tagsBody) { TargetHead HEAD_CODE = ArticleTarget.HEAD_CODE_NULL; TargetPart PART_CODE = ArticleTarget.PART_CODE_NULL; ConfigCode BODY_CODE = GetHeadConfigCode(); return(AddGeneralItem(HEAD_CODE, PART_CODE, BODY_CODE, ArticleTarget.BODY_SEED_NULL, tagsBody)); }
private IEnumerable <Tuple <TargetHead, TargetPart> > SelectPositionCode(ConfigCode positionCode) { IEnumerable <TargetItem> targetsInit = GetTargets(); var positionsPart = targetsInit.Where((ch) => (ch.Code() == positionCode)).Select((cv) => new Tuple <TargetHead, TargetPart>(cv.Head(), cv.Seed())); return(positionsPart); }
private Result <MoneyAmountSum, string> GetTaxableIncome(IEnumerable <ResultPair> results, TargetItem target) { ConfigCode incomeTaxingCode = (ConfigCode)ArticleCodeCz.FACT_TAX_INCOMES_WITHHOLD_GENERAL; Result <MoneyAmountSum, string> taxableIncome = FindResultUtils.FindMoneyTransferIncomeValue(results, TargetFilters.TargetCodeFunc(incomeTaxingCode)); return(taxableIncome); }
private Result <MoneyAmountSum, string> GetGeneralBase(IEnumerable <ResultPair> results, TargetItem target) { ConfigCode taxBaseCode = (ConfigCode)ArticleCodeCz.FACT_TAX_BASE_ADVANCE; Result <MoneyAmountSum, string> taxBaseAmount = FindResultUtils.FindMoneyTaxingBasisValue(results, TargetFilters.TargetCodeFunc(taxBaseCode)); return(taxBaseAmount); }
public ArticleConfigDetail(ConfigCode _code, ConfigName _name, ConfigGang _gang, ConfigType _type, ConfigBind _bind, TaxingBehaviour _taxing, HealthBehaviour _health, SocialBehaviour _social, params ConfigCode[] _path) : base(_code, _gang, _type, _bind, _taxing, _health, _social) { InternalName = _name; InternalPath = _path.ToList(); }
private IEnumerable <TargetItem> CreateTargetsQueue(ConfigCode code, TargetItem target, IEnumerable <TargetHead> heads, IEnumerable <Tuple <TargetHead, TargetPart> > parts) { IEnumerable <ArticleTarget> targetList = new List <ArticleTarget>(); ConfigType targetType = ModelSourceProfile.GetConfigType(code); ConfigBind targetBind = ModelSourceProfile.GetConfigBind(code); TargetHead codeHead = 0; TargetPart codePart = 0; ConfigCode codeBody = code; TargetSeed seedBody = 0; if (targetBind == (ConfigBind)ArticleBind.ARTICLE_OPT) { return(targetList); } if (targetType == (ConfigType)ArticleType.NO_HEAD_PART_TYPE) { targetList = new List <ArticleTarget>() { new ArticleTarget(codeHead, codePart, codeBody, seedBody) }; } if (targetType == (ConfigType)ArticleType.HEAD_CODE_ARTICLE) { if (target.Head() != 0) { codeHead = target.Head(); targetList = new List <ArticleTarget>() { new ArticleTarget(codeHead, codePart, codeBody, seedBody) }; } else { targetList = heads.Select((ch) => (new ArticleTarget(ch, codePart, codeBody, seedBody))).ToList(); } } else if (targetType == (ConfigType)ArticleType.PART_CODE_ARTICLE) { if (target.Head() != 0 && target.Part() != 0) { codeHead = target.Head(); codePart = target.Part(); targetList = new List <ArticleTarget>() { new ArticleTarget(codeHead, codePart, codeBody, seedBody) }; } else { targetList = parts.Select((pp) => (new ArticleTarget(pp.Item1, pp.Item2, codeBody, seedBody))).ToList(); } } return(targetList); }
private Result <MoneyAmountSum, string> GetSocialsPart(IEnumerable <ResultPair> results, TargetItem target) { ConfigCode taxPartCode = (ConfigCode)ArticleCodeCz.FACT_TAX_BASE_ADVANCE_SOCIAL; Result <MoneyAmountSum, string> taxPartAmount = FindResultUtils.FindMoneyInsuranceBasisValue(results, TargetFilters.TargetCodeFunc(taxPartCode)); return(taxPartAmount); }
private Result <TaxableIncomeSum, string> GetTaxableIncome(IEnumerable <ResultPair> results, TargetItem target) { ConfigCode incomeTaxingCode = (ConfigCode)ArticleCodeCz.FACT_TAX_INCOMES_GENERAL; Result <TaxableIncomeSum, string> taxableIncome = GetSumResultUtils.GetSumIncomeTaxGeneral(results, TargetFilters.TargetCodeFunc(incomeTaxingCode), ArticleFilters.SelectAllFunc); return(taxableIncome); }
public TargetItem StoreGeneralItem(TargetHead codeHead, TargetPart codePart, ConfigCode codeBody, TargetSeed seedBody, ISourceValues tagsBody) { ArticleTarget newTarget = new ArticleTarget(codeHead, codePart, codeBody, seedBody); SourcePack newSource = GetTemplateSourceForArticle(codeBody, tagsBody); model.Add(newTarget, newSource); return(newTarget); }
public ConfigStub CloneMasterStub(ConfigCode _code, ConfigRole _role, ConfigGang _gang, ConfigType _type, ConfigBind _bind, TaxingBehaviour _taxing, HealthBehaviour _health, SocialBehaviour _social) { ConfigStub returnStub = CloneUtils <ConfigStub> .CloneOrNull(InternalStub); returnStub.SetSourceConfig(_code, _role, _gang, _type, _bind, _taxing, _health, _social); return(returnStub); }
/// <summary> /// Identifies the code and parses it to a runtime value /// </summary> /// <param name="code">The code to parse</param> /// <returns>The code value to return</returns> private string CodeIdentifier(ConfigCode code) { switch (code) { case ConfigCode.CurrentDirectory: return(Directory.GetCurrentDirectory()); default: return(null); } }
public override EvaluateSource GetNewValues(EvaluateSource initValues) { ConfigCode scheduledCode = (ConfigCode)ArticleCodeCz.FACT_POSITION_SCHEDULE; ConfigCode timesheetCode = (ConfigCode)ArticleCodeCz.FACT_POSITION_TIMESHEET; ConfigCode worksheetCode = (ConfigCode)ArticleCodeCz.FACT_POSITION_WORKING; Result <WeekScheduleValue, string> fullWeekResult = InternalValues .FindResultValue <ArticleGeneralResult, WeekScheduleValue>( TargetFilters.TargetCodePlusPartFunc(scheduledCode, InternalTarget.Head(), InternalTarget.Part()), (x) => (x.IsFullWeeksValue())); Result <WeekScheduleValue, string> realWeekResult = InternalValues .FindResultValue <ArticleGeneralResult, WeekScheduleValue>( TargetFilters.TargetCodePlusPartFunc(scheduledCode, InternalTarget.Head(), InternalTarget.Part()), (x) => (x.IsRealWeeksValue())); Result <MonthScheduleValue, string> timesheetResult = InternalValues .FindResultValue <ArticleGeneralResult, MonthScheduleValue>( TargetFilters.TargetCodePlusPartFunc(timesheetCode, InternalTarget.Head(), InternalTarget.Part()), (x) => (x.IsRealMonthValue())); Result <MonthScheduleValue, string> worksheetResult = InternalValues .FindResultValue <ArticleGeneralResult, MonthScheduleValue>( TargetFilters.TargetCodePlusPartFunc(worksheetCode, InternalTarget.Head(), InternalTarget.Part()), (x) => (x.IsTermMonthValue())); if (ResultMonadUtils.HaveAnyResultFailed( fullWeekResult, realWeekResult, timesheetResult, worksheetResult)) { return(ReturnFailureAndError(initValues, ResultMonadUtils.FirstFailedResultError( fullWeekResult, realWeekResult, timesheetResult, worksheetResult))); } WeekScheduleValue fullWeekValues = fullWeekResult.Value; WeekScheduleValue realWeekValues = realWeekResult.Value; MonthScheduleValue timesheetValues = timesheetResult.Value; MonthScheduleValue worksheetValues = worksheetResult.Value; return(new EvaluateSource { // PROPERTIES SET MonthlyAmount = initValues.MonthlyAmount, ShiftLiable = PeriodUtils.TotalWeekHours(fullWeekValues.HoursWeek), ShiftWorked = PeriodUtils.TotalWeekHours(realWeekValues.HoursWeek), HoursLiable = PeriodUtils.TotalMonthHours(timesheetValues.HoursMonth), HoursWorked = PeriodUtils.TotalMonthHours(worksheetValues.HoursMonth), // PROPERTIES SET }); }
private Result <IEnumerable <AbsenceEvaluateSource>, string> GetAbsenceValues() { ConfigCode filterCode = (ConfigCode)ArticleCodeCz.FACT_CONTRACT_ATTEND_ITEM; TargetHead filterHead = InternalTarget.Head(); Result <IEnumerable <AbsenceEvaluateSource>, string> absenceList = InternalValues .GetResultValuesInListAndError <ArticleGeneralResult, MonthAttendanceValue, AbsenceEvaluateSource>( TargetFilters.TargetCodePlusHeadFunc(filterCode, filterHead), ArticleFilters.SelectAllFunc, ResultFilters.MonthAttendanceFunc, BuildItem); return(absenceList); }
void setCheckBox(CheckBox checkbox, ConfigCode code) { ConfigItem<bool> item = (ConfigItem<bool>)ConfigData.Instance.GetDebugItem(code); checkbox.Checked = item.Value; checkbox.Enabled = !item.Fixed; }
void setColorBox(ColorBox colorBox, ConfigCode code) { ConfigItem<Color> item = (ConfigItem<Color>)ConfigData.Instance.GetDebugItem(code); colorBox.SelectingColor = item.Value; colorBox.Enabled = !item.Fixed; }
void setNumericUpDown(NumericUpDown updown, ConfigCode code) { ConfigItem<int> item = (ConfigItem<int>)ConfigData.Instance.GetDebugItem(code); decimal value = item.Value; if (updown.Maximum < value) updown.Maximum = value; if (updown.Minimum > value) updown.Minimum = value; updown.Value = value; updown.Enabled = !item.Fixed; }
void setTextBox(TextBox textBox, ConfigCode code) { ConfigItem<string> item = (ConfigItem<string>)ConfigData.Instance.GetDebugItem(code); textBox.Text = item.Value; textBox.Enabled = !item.Fixed; }