Example #1
0
        private void PrintRemission()
        {
            ConverseNumberToText numberToTextInstance = new ConverseNumberToText();
            _remission.TotalInLetters = numberToTextInstance.enletras(_remission.Total.ToString());
            _remissionSaveModel.Client = _client;
            _remissionSaveModel.Remission = _remission;
            _remissionSaveModel.RemissionDetail = _remissionDetail;

            if (System.Configuration.ConfigurationSettings.AppSettings["PrintFormat"].ToString().ToUpper().Equals("CARTA"))
            {
                VisorRemision visorRemision = new VisorRemision(_remissionSaveModel);
                visorRemision.Show(this);
            }
            else
            {
                VisorRemisionMediaCarta visorRemision = new VisorRemisionMediaCarta(_remissionSaveModel);
                visorRemision.Show(this);
            }
        }
        private void dtgRemision_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn &&
                e.RowIndex >= 0)
            {
                var remissionTemp = ((List<RemissionModel>)senderGrid.DataSource)[e.RowIndex];
                ConverseNumberToText numberToTextInstance = new ConverseNumberToText();
                remissionTemp.TotalInLetters = numberToTextInstance.enletras(remissionTemp.Total.ToString());
               
                if (System.Configuration.ConfigurationSettings.AppSettings["PrintFormat"].ToString().ToUpper().Equals("CARTA"))
                {
                    VisorRemision visorRemision = new VisorRemision(_remissionData.GetRemissionData(remissionTemp), true);
                    visorRemision.Show();
                }
                else
                {
                    VisorRemisionMediaCarta visorRemision = new VisorRemisionMediaCarta(_remissionData.GetRemissionData(remissionTemp), true);
                    visorRemision.Show();
                }
            }
        }