Beispiel #1
0
        /// <summary>
        /// Carga de manera asincrona los Dominios relacionados entre si en la grilla.-
        /// </summary>
        public static void PopulateAsync()
        {
            Exception ex = null;
            DelegateWithOutAndRefParameters s = new DelegateWithOutAndRefParameters(Populate);

            s.BeginInvoke(out ex, new AsyncCallback(EndPopulate), null);
        }
Beispiel #2
0
        /// <summary>
        /// Carga de manera asincrona 
        /// </summary>
        public void PopulateAsync()
        {
            Exception ex = null;
            DelegateWithOutAndRefParameters s = new DelegateWithOutAndRefParameters(Populate);

            s.BeginInvoke(out ex, new AsyncCallback(EndPopulate), null);
        }
Beispiel #3
0
        /// <summary>
        /// Fin de el metodo populate que fue llamado de forma asincrona
        /// </summary>
        /// <param name="res"></param>
        void EndPopulate(IAsyncResult res)
        {
            Exception ex;

            if (this.InvokeRequired)
            {
                AsyncCallback d = new AsyncCallback(EndPopulate);
                this.Invoke(d, new object[] { res });
            }
            else
            {
                AsyncResult result = (AsyncResult)res;
                DelegateWithOutAndRefParameters del = (DelegateWithOutAndRefParameters)result.AsyncDelegate;
                del.EndInvoke(out ex, res);
                this.Cursor = System.Windows.Forms.Cursors.Default;
                if (ex != null)
                {
                    txtTExt.Text = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex);
                    //img_info.Image = this.ExceptionViewer.Icon;
                    this.img_info.Visible = true;
                    this.ExceptionViewer.Show(ex);
                }
                else
                {
                    this.MessageViewer.Show("La importación se realizo con éxito");
                    txtTExt.Text          = "La importación se realizo con éxito";
                    this.img_info.Visible = false;
                    pictureBox1.Visible   = false;
                    btnImport.Enabled     = true;
                }
            }
        }
Beispiel #4
0
        void EndPopulate(IAsyncResult res)
        {
            Exception ex;

            if (this.InvokeRequired)
            {
                AsyncCallback d = new AsyncCallback(EndPopulate);
                this.Invoke(d, new object[] { res });
            }
            else
            {
                AsyncResult result = (AsyncResult)res;
                DelegateWithOutAndRefParameters del = (DelegateWithOutAndRefParameters)result.AsyncDelegate;
                del.EndInvoke(out ex, res);

                if (_SearchSalesOrderDetailRes.Error != null)
                {
                    txtSimpleResult.Text = _SearchSalesOrderDetailRes.Error.GetXml();
                    return;
                }
                dataGridView2.DataSource = _SearchSalesOrderDetailRes.BusinessData.Times;

                _Sizes = new Measures();
                _Sizes.Add(new Measure("Result", GetSizeOfObject(_SearchSalesOrderDetailRes), false));
                _Sizes.Add(new Measure("Entity SalesOrderDetailList", GetSizeOfObject(_SearchSalesOrderDetailRes.BusinessData.SalesOrderDetailList), false));
                _Sizes.Add(new Measure("Test measures", GetSizeOfObject(_SearchSalesOrderDetailRes.BusinessData.Times), false));
                _Sizes.Add(new Measure("Result contextInformation", GetSizeOfObject(_SearchSalesOrderDetailRes.ContextInformation), false));

                dataGridView3.DataSource = _Sizes;

                string info = Fwk.HelperFunctions.SerializationFunctions.SerializeToXml(_SearchSalesOrderDetailRes.ContextInformation);
                txtSimpleResult.Text = string.Concat(info, Environment.NewLine, Environment.NewLine + "Bussiness data ", Environment.NewLine, _SearchSalesOrderDetailRes.BusinessData.SalesOrderDetailList.GetXml());
            }
        }
Beispiel #5
0
        /// <summary>
        /// Fin de el metodo populate que fue llamado de forma asincrona
        /// </summary>
        /// <param name="res"></param>
        void EndPopulate(IAsyncResult res)
        {
            Exception ex;

            if (this.InvokeRequired)
            {
                AsyncCallback d = new AsyncCallback(EndPopulate);
                this.Invoke(d, new object[] { res });
            }
            else
            {
                AsyncResult result = (AsyncResult)res;


                DelegateWithOutAndRefParameters del = (DelegateWithOutAndRefParameters)result.AsyncDelegate;
                del.EndInvoke(out ex, res);
                if (ex != null)
                {
                    throw ex;
                }
                treeList1.BeginUnboundLoad();
                this.categoryTreeBindingSource.DataSource = _CategoryTreeList;
                treeList1.RefreshDataSource();
                treeList1.EndUnboundLoad();
                treeList1.ExpandAll();

                _AllRuleList = FwkMembership.GetRulesAuxList(frmAdmin.Provider.Name);
                fwkAuthorizationRuleBindingSource.DataSource = _AllRuleList;
                grdAllRules.RefreshDataSource();
            }
        }
Beispiel #6
0
        /// <summary>
        /// Fin de el metodo populate que fue llamado de forma asincrona
        /// </summary>
        /// <param name="res"></param>
        void EndPopulate(IAsyncResult res)
        {
            Exception ex;

            if (this.InvokeRequired)
            {
                AsyncCallback d = new AsyncCallback(EndPopulate);
                this.Invoke(d, new object[] { res });
            }
            else
            {
                AsyncResult result = (AsyncResult)res;
                DelegateWithOutAndRefParameters del = (DelegateWithOutAndRefParameters)result.AsyncDelegate;
                del.EndInvoke(out ex, res);
                PatientBEBindingSource.DataSource = _PatientList;
                gridView1.RefreshData();
                grdPersonas.RefreshDataSource();
            }
        }
Beispiel #7
0
        /// <summary>
        /// Fin de el metodo populate que fue llamado de forma asincrona
        /// </summary>
        /// <param name="res"></param>
        static void EndPopulate(IAsyncResult res)
        {
            Exception   ex;
            AsyncResult result = (AsyncResult)res;

            DelegateWithOutAndRefParameters del = (DelegateWithOutAndRefParameters)result.AsyncDelegate;

            del.EndInvoke(out ex, res);
            if (ex != null)
            {
                if (OnControlerException != null)
                {
                    OnControlerException(ex, new EventArgs());
                }
                return;
            }
            if (ex == null)
            {
                _EspecialidadMedicaList.Add(new ParametroBE {
                    Nombre = Enum.GetName(typeof(CommonValuesEnum), CommonValuesEnum.Ninguno), IdParametro = (int)CommonValuesEnum.Ninguno
                });
            }
        }
Beispiel #8
0
        /// <summary>
        /// Fin de el metodo populate que fue llamado de forma asincrona
        /// </summary>
        /// <param name="res"></param>
        void EndPopulate(IAsyncResult res)
        {
            Exception ex;

            if (this.InvokeRequired)
            {
                AsyncCallback d = new AsyncCallback(EndPopulate);
                this.Invoke(d, new object[] { res });
            }
            else
            {
                AsyncResult result = (AsyncResult)res;

                DelegateWithOutAndRefParameters del = (DelegateWithOutAndRefParameters)result.AsyncDelegate;
                del.EndInvoke(out ex, res);
                if (ex != null)
                {
                    MessageBox.Show(Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex));
                    return;
                }
                gridControl_config.DataSource = _configPivotDtt;
                gridControl_config.RefreshDataSource();
                gridView_config.RefreshData();

                gridView_config.Columns[0].OptionsColumn.AllowEdit = false;
                gridView_config.Columns[0].OptionsColumn.ReadOnly  = false;
                gridView_config.Columns[1].OptionsColumn.AllowEdit = false;
                gridView_config.Columns[1].OptionsColumn.ReadOnly  = false;


                gridView_config.Columns[0].AppearanceCell.Font                 = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
                gridView_config.Columns[0].AppearanceCell.ForeColor            = System.Drawing.Color.SteelBlue;
                gridView_config.Columns[0].AppearanceCell.Options.UseBackColor = true;
                gridView_config.Columns[0].AppearanceCell.Options.UseFont      = true;
                gridView_config.Columns[0].AppearanceCell.Options.UseForeColor = true;

                gridView_config.Columns[0].GroupIndex                          = 0;
                gridView_config.Columns[1].AppearanceCell.Font                 = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
                gridView_config.Columns[1].AppearanceCell.ForeColor            = System.Drawing.Color.SteelBlue;
                gridView_config.Columns[1].AppearanceCell.Options.UseBackColor = true;
                gridView_config.Columns[1].AppearanceCell.Options.UseFont      = true;
                gridView_config.Columns[1].AppearanceCell.Options.UseForeColor = true;



                Cursor.Current = Cursors.Default;
                int rowHandler = 0;
                if (xtraTabControl1.SelectedTabPage == xtraTabPage2)
                {
                    //if (_GridHitInfoParam != null)
                    //{
                    //    if (_GridHitInfoParam.RowHandle < 0)
                    //        rowHandler = _GridHitInfoParam.RowHandle;
                    //    else
                    //        rowHandler = gridView_Params.GetParentRowHandle(_GridHitInfoParam.RowHandle);
                    //    gridView_Params.ExpandGroupRow(rowHandler);
                    //}
                }
                if (xtraTabControl1.SelectedTabPage == xtraTabPage1)
                {
                    if (_GridHitInfo != null)
                    {
                        if (_GridHitInfo.RowHandle < 0)
                        {
                            rowHandler = _GridHitInfo.RowHandle;
                        }
                        else
                        {
                            rowHandler = gridView_config.GetParentRowHandle(_GridHitInfo.RowHandle);
                        }
                        gridView_config.ExpandGroupRow(rowHandler);
                    }
                }
            }
        }
        /// <summary>
        /// Fin de el metodo populate que fue llamado de forma asincrona
        /// </summary>
        /// <param name="res"></param>
        void EndPopulate(IAsyncResult res)
        {
            Exception ex;

            if (this.InvokeRequired)
            {
                AsyncCallback d = new AsyncCallback(EndPopulate);
                this.Invoke(d, new object[] { res });
            }
            else
            {
                AsyncResult result = (AsyncResult)res;

                DelegateWithOutAndRefParameters del = (DelegateWithOutAndRefParameters)result.AsyncDelegate;
                del.EndInvoke(out ex, res);
                if (ex != null)
                {
                    if (String.IsNullOrEmpty(ex.Source))
                    {
                        ex.Source = "frmPatientAtencion.EndPopulate";
                    }
                    this.ExceptionViewer.Show(ex);
                    return;
                }

                StringBuilder s = null;

                #region Datos Patient
                lblDNI.Text    = ServiceCalls.CurrentPatient.Persona.NroDocumento;
                lblNombre.Text = ServiceCalls.CurrentPatient.Persona.ApellidoNombre;
                lblEdad.Text   = ServiceCalls.CurrentPatient.Persona.GetLabelEdad();
                //TODO: Poner fecha nacimiento
                if (ServiceCalls.CurrentPatient.Persona.Foto == null)
                {
                    this.pictureEdit1.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Clip;
                    if (ServiceCalls.CurrentPatient.Persona.Sexo.Equals((Int16)Sexo.Masculino))
                    {
                        pictureEdit1.Image = Health.Front.Base.Properties.Resource.User_M;
                    }
                    else
                    {
                        pictureEdit1.Image = Health.Front.Base.Properties.Resource.User_F;
                    }
                }
                else
                {
                    this.pictureEdit1.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Stretch;
                    pictureEdit1.Image = Fwk.HelperFunctions.TypeFunctions.ConvertByteArrayToImage(ServiceCalls.CurrentPatient.Persona.Foto);
                }
                #endregion

                #region Allergies
                if (_PatientAllergy == null)
                {
                    return;
                }
                {
                    if (!string.IsNullOrEmpty(_PatientAllergy.ToString()))
                    {
                        s = new StringBuilder();
                        btnAlertAllergy.Visible = true;


                        //Establezco los nombres de otras alergias para q se macheen con los ids de OtherAllergy
                        if (!string.IsNullOrEmpty(_PatientAllergy.OtherAllergy))
                        {
                            //Array de Ids
                            _PatientAllergy.OtherAllergy = _PatientAllergy.OtherAllergy.Replace(" ", "");
                            var listOther = _PatientAllergy.OtherAllergy.Split(',').ToList <string>();

                            //MAcheo de array con nombre de otras alergias
                            string[] x = (from p in ServiceCalls.AllergiesItemTypesList where listOther.Contains(p.IdParametro.ToString()) select p.Nombre).ToArray <string>();

                            x.ToList().ForEach(item => s.AppendLine(item));
                            _PatientAllergy.OtherNames = s.ToString();
                            s = null;
                        }
                        lblAllergiesInfo.Text = string.Empty;
                        lblAllergiesInfo.Text = _PatientAllergy.ToString();
                    }
                }

                #endregion

                #region Permanent medicaments


                if (_PatientMedicament_ViewList.Count != 0)
                {
                    s = new StringBuilder("El pasiente esta actualmente medicado: \r\n \r\n");
                    string strMedicamentRecord = "{0} {1} ";
                    _PatientMedicament_ViewList.ForEach(item =>
                                                        s.AppendLine(string.Format(strMedicamentRecord, item.MedicamentName, item.StatusDescription)));
                    lblAlertMedicament.Text    = s.ToString();
                    btnAlertMedicament.Visible = true;
                }

                #endregion


                #region Diagnosis
                if (_MedicalEventAlert_ViewList.Count != 0)
                {
                    s = new StringBuilder("Alerta de diagnosticos: \r\n \r\n");
                    _MedicalEventAlert_ViewList.ForEach(item => s.AppendLine(item.Description));
                    lblAlertDiagnosis.Text    = s.ToString();
                    btnAlertdiagnosis.Visible = true;
                }
                #endregion
            }
        }