Пример #1
0
        public frmSenetDurum(int senetId, SenetTip senetTip, SenetDurum senetDurum) : base()
        {
            InitializeComponent();
            //_mngFac = new ManagerFactory(Engine.GetConString(), Engine.GetSqlServerType());

            //_mngCari = _mngFac.GetCariManager();
            //_mngCahar = _mngFac.GetCariHareketManager();
            //_mngBanka = _mngFac.GetBankaHesapManager();
            //_mngHesapHar = _mngFac.GetHesapHareketManager();
            //_mngKasa = _mngFac.GetKasaManager();
            //_mngKasaHar = _mngFac.GetKasaHarManager();
            _mngSenet   = _mngFac.GetSenetManager();
            _senetId    = senetId;
            _senetTip   = senetTip;
            _senetDurum = senetDurum;
            SetData();

            txtBankaHesap.DataSource = () =>
            {
                try {
                    return(_mngBanka.GetBankaHesapNoBySubeKodu(UserInfo.Sube.Id, txtBankaHesap.Text));
                } catch (Exception exc) {
                    LogWrite.Write(exc);
                    MessageBox.Show(exc.Message);
                }
                return(null);
            };
            txtCari.DataSource = () =>
            {
                try {
                    return(_mngCari.GetCariKodsBySubeKodu(UserInfo.Sube.Id, txtCari.Text).ToStringList(15, txtCari.Ayirac));
                } catch (Exception exc) {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
                return(null);
            };
            LoadKasa(cmbKasa);
            InitializeScreenValues();
            SetControlLocation();
        }
Пример #2
0
        void Duzelt()
        {
            DataGridViewRow dr = dataGridViewSenet.CurrentRow;

            if (dr != null)
            {
                SenetDurum durum = (SenetDurum)Enum.Parse(typeof(SenetDurum), dr.Cells[clDurum.Name].Value.ToString());
                if (durum == SenetDurum.Beklemede)
                {
                    int      id  = dr.Cells[clId.Name].Value.ToStringOrEmpty().ParseStruct(x => int.Parse(x));
                    SenetTip tip = (SenetTip)Enum.Parse(typeof(SenetTip), dr.Cells[clSenetTip.Name].Value.ToString());

                    frmYeniSenet frm = new frmYeniSenet(id, durum, tip);
                    frm.ShowDialog();
                    LoadGrid();
                }
                else
                {
                    MessageBox.Show("Seneti düzeltebilmek için senetin durumunu Beklemede durumuna getirmeniz gerekli.");
                }
            }
        }