예제 #1
0
        private void FrmMojodiAnbarVKala_Load(object sender, EventArgs e)
        {
            cmbNoeGozaresh.SelectedIndex = 0;
            chkIsEdgham.Checked          = false;
            //cmbAnbarName.Properties.Items[3].CheckState = CheckState.Checked ;

            HelpClass1.DateTimeMask(txtAzTarikh);
            HelpClass1.DateTimeMask(txtTaTarikh);
            using (var db = new MyContext())
            {
                try
                {
                    int _DoreMaliId = Convert.ToInt32(lblSalId.Text);
                    var q           = db.MsDoreMalis.FirstOrDefault(s => s.MsDoreMaliId == _DoreMaliId).StartDoreMali;
                    if (q != null)
                    {
                        txtAzTarikh.Text = q.ToString();
                    }
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show("عملیات با خطا مواجه شد" + "\n" + ex.Message,
                                        "پیغام", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            txtTaTarikh.Text = DateTime.Now.ToString();
            textEdit1.Focus();

            FillcmbAnbarName();
            int a = _ListAnbarha.FirstOrDefault(s => s.SalId == _SalId).Id;

            if (_EditValueId != 0)
            {
                cmbAnbarName.SetEditValue(_EditValueId);
            }
            else
            {
                cmbAnbarName.SetEditValue(a);
            }

            FillbandedGridView();
        }