예제 #1
0
 public virtual void RemoveTermination(int Id)
 {
     foreach (Termination TD in Terminations)
     {
         if (TD.Id == Id)
         {
             Terminations.Remove(TD);
             break;
         }
     }
 }
        public async Task <ActionResult> VerifyAsync(Verification model)
        {
            var meta = await AppUsers.GetCurrentAsync().ConfigureAwait(true);

            try
            {
                await Terminations.VerifyAsync(this.Tenant, meta.LoginId, meta.UserId, model).ConfigureAwait(true);

                return(this.Ok());
            }
            catch (Exception ex)
            {
                return(this.Failed(ex.Message, HttpStatusCode.InternalServerError));
            }
        }
예제 #3
0
 /// <summary>
 /// Determines whether the specified geneticAlgorithm reached the termination condition.
 /// </summary>
 /// <param name="geneticAlgorithm">The genetic algorithm.</param>
 /// <returns>
 /// True if termination has been reached, otherwise false.
 /// </returns>
 protected override bool PerformHasReached(IGeneticAlgorithm geneticAlgorithm)
 {
     return(Terminations.All(t => t.HasReached(geneticAlgorithm)));
 }
예제 #4
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            //ReportCompositeRequest req = GetRequest();

            //ListResponse<Model.Reports.RT102A> resp = _reportsService.ChildGetAll<Model.Reports.RT102A>(req);
            //if (!resp.Success)
            //{
            //    if (throwException)
            //        throw new Exception(resp.Summary);
            //    else
            //    {
            //        X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
            //       Common.errorMessage(resp);
            //        return;
            //    }
            //}
            //resp.Items.ForEach(x => x.DateString = x.date.ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en")));
            //Hirings h = new Hirings();


            //h.RightToLeft = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            //h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            //h.DataSource = resp.Items;



            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;

            ListResponse <Model.Reports.RT102B> resp = _reportsService.ChildGetAll <Model.Reports.RT102B>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            resp.Items.ForEach(x => x.DateString = x.date.ToString(_systemService.SessionHelper.GetDateformat()));

            //string from = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            //string to = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            string user = _systemService.SessionHelper.GetCurrentUser();


            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);

            Terminations t = new Terminations(parameters);

            t.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            t.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;


            t.Parameters["User"].Value = user;
            //t.Parameters["BranchName"].Value = jobInfo1.GetBranch();

            //   t.Parameters["DepartmentName"].Value = jobInfo1.GetDepartment();
            t.DataSource = resp.Items;
            //if (resp.Items.Count > 0)
            //{
            //    if (req.Parameters["_departmentId"] != "0")
            //        t.Parameters["DepartmentName"].Value = resp.Items[0].departmentName;
            //    else
            //        t.Parameters["DepartmentName"].Value = GetGlobalResourceObject("Common", "All");

            //    if (req.Parameters["_branchId"] != "0")
            //        t.Parameters["BranchName"].Value = resp.Items[0].branchName;
            //    else
            //        t.Parameters["BranchName"].Value = GetGlobalResourceObject("Common", "All");
            //}

            t.CreateDocument();

            //h.Pages.AddRange(t.Pages);
            t.CreateDocument();
            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(t);
        }
예제 #5
0
 public virtual void Terminate(IInternalChannel channel) => Terminations?.Invoke();