private string GetChanges()
        {
            string commentaryUpdate = _objMedicalExamBL.GetCommentaryUpdateByComponentId(objmedicalexamDto.v_ComponentId);
            string oldCommentary    = commentaryUpdate;

            commentaryUpdate += "<FechaActualiza:" + DateTime.Now.ToString() + "|UsuarioActualiza:" + Globals.ClientSession.v_UserName + "|";
            bool change = false;

            foreach (var item in nombreCampos)
            {
                var    fields = this.Controls.Find(item, true);
                string keyTagControl;
                string value1;

                if (fields.Length > 0)
                {
                    keyTagControl = fields[0].GetType().Name;
                    value1        = GetValueControl(keyTagControl, fields[0]);

                    var ValorCampo = ListValuesCampo.Find(x => x.NombreCampo == item).ValorCampo;
                    if (ValorCampo != value1)
                    {
                        commentaryUpdate += item + ":" + ValorCampo + "|";
                        change            = true;
                    }
                }
            }
            if (change)
            {
                return(commentaryUpdate);
            }

            return(oldCommentary);
        }
Ejemplo n.º 2
0
        private void verCambiosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string commentary = _objMedicalExamBL.GetCommentaryUpdateByComponentId(strMedicalExamId);

            if (commentary == "" || commentary == null)
            {
                MessageBox.Show("Aún no se han realizado cambios.", "AVISO", MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                return;
            }
            var frm = new frmViewChanges(commentary);

            frm.ShowDialog();
        }