Beispiel #1
0
        public override bool IsValid()
        {
            if (!Endereco.IsValidEmailAddress(Endereco.AddressEmail))
            {
                ErrorList.Add("Enderço de Email Inválido");
            }

            return(!ErrorList.Any());
        }
Beispiel #2
0
 public override bool IsValid()
 {
     return(!ErrorList.Any());
 }
Beispiel #3
0
 public Response(IEnumerable <string> errorList = null)
 {
     ErrorList = errorList ?? new string[0];
     Error     = ErrorList.Any();
 }
        public async Task QueryResultsAndNodeCoord(string plates,
                                                   IProgress <ProgressModelObject <double> > progress,
                                                   CancellationToken ct)
        {
            IRobotResultQueryReturnType Res;

            var selecPlate = str.Selections.Create(IRobotObjectType.I_OT_PANEL);

            selecPlate.FromText(plates);

            RobotResultQueryParams parm = new RobotResultQueryParams();

            parm.Selection.Set(IRobotObjectType.I_OT_PANEL, selecPlate);

            parm.SetParam(IRobotResultParamType.I_RPT_ELEMENT, 11);
            parm.SetParam(IRobotResultParamType.I_RPT_NODE, 3);
            parm.SetParam(IRobotResultParamType.I_RPT_PANEL, 2);
            parm.SetParam(IRobotResultParamType.I_RPT_RESULT_POINT_COORDINATES, 31);

            parm.ResultIds.SetSize(8);

            parm.ResultIds.Set(1, (int)T_DATA_TYPES.T_FERA_NOD_LONG_UP);
            parm.ResultIds.Set(2, (int)T_DATA_TYPES.T_FERA_NOD_TRAN_UP);
            parm.ResultIds.Set(3, (int)T_DATA_TYPES.T_FERA_NOD_LONG_DOWN);
            parm.ResultIds.Set(4, (int)T_DATA_TYPES.T_FERA_NOD_TRAN_DOWN);
            parm.ResultIds.Set(5, (int)T_DATA_TYPES.T_NODE_COORD_CART_X);
            parm.ResultIds.Set(6, (int)T_DATA_TYPES.T_NODE_COORD_CART_Y);
            parm.ResultIds.Set(7, (int)T_DATA_TYPES.T_NODE_COORD_CART_Z);


            var t = new RSATableQueryingResult();

            Panel = await t.ReadFromTableAsync(plates.ToIntArrayFromRobotStringSelection(), progress, ct);

            if (Panel.Count == 0)
            {
                throw new SlabNotCalculatedExpetation("None of selected slabs are meshed and calculated");
            }


            RobotResultRowSet RobResRowSet = new RobotResultRowSet();

            Res = robot.Project.Structure.Results.Query(parm, RobResRowSet);
            bool ok;
            int  i = 0;

            ok = RobResRowSet.MoveFirst();

            progress.Report(new ProgressModelObject <double>
            {
                ProgressToString = "Getting reinforcements and node coordinations", Progress = 9 * 10
            });


            while (ok)
            {
                ///geting slab number
                int p = (int)RobResRowSet.CurrentRow.GetParam(IRobotResultParamType.I_RPT_PANEL);
                ///if already got in error list
                if (ErrorList.Any(g => g.Contains($"number {p} isn't")))
                {
                    goto ExitPlate;
                }

                var nodeId = (int)RobResRowSet.CurrentRow.GetParam(IRobotResultParamType.I_RPT_NODE);
                //var eeId = (int)RobResRowSet.CurrentRow.GetParam(IRobotResultParamType.I_RPT_ELEMENT);
                for (int x = 0; x < Panel.Count; x++)
                {
                    for (int y = 0; y < Panel[x].nodes.Count; y++)
                    {
                        if (Panel[x].nodes[y].NodeId == nodeId)
                        {
                            ///check if there is result for slab
                            if (!RobResRowSet.CurrentRow.IsAvailable(RobResRowSet.ResultIds.Get(3)))
                            {
                                ErrorList.Add($"Slabs with number {p} isn't calculated for reinforcement");
                                goto ExitPlate;
                            }

                            Panel[x].nodes[y].AX_BOTTOM = Math.Round((double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(3)) * 10000, 3);
                            Panel[x].nodes[y].AY_BOTTOM = Math.Round((double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(4)) * 10000, 3);
                            Panel[x].nodes[y].AX_TOP    = Math.Round((double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(1)) * 10000, 3);
                            Panel[x].nodes[y].AY_TOP    = Math.Round((double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(2)) * 10000, 3);
                            Panel[x].nodes[y].X         = (double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(5));
                            Panel[x].nodes[y].Y         = (double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(6));
                            Panel[x].nodes[y].Z         = (double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(7));
                        }
                    }
                }
ExitPlate:
                i++;
                ok = RobResRowSet.MoveNext();
            }

            if (ErrorList.Count == ObjNumbers.Length)
            {
                throw new SlabNotCalculatedForReinfException
                          ("None of selected slabs are calculated for reinforcement");
            }

            progress.Report(new ProgressModelObject <double>
            {
                ProgressToString = "Done collectiong done!", Progress = 10 * 10
            });
            IsDataCollected = true;
        }
Beispiel #5
0
 public override bool IsValid()
 {
     ConfirmaValidacaoEmail();
     return(!ErrorList.Any());
 }
Beispiel #6
0
 public override bool IsValid() => !ErrorList.Any();