Exemple #1
0
        private void fillBasicInfo()
        {
            DataTable dt = new DataTable();
            std       cu = new std();

            cu.stdno = txtstdno.Text;
            dt       = cu.Selectforedit();
            if (dt.Rows.Count > 0)
            {
                txtstdno.Enabled = false;
                //idsearch.Enabled = false;
                grpBasicInfo.Enabled = true;

                // Clear any previous bindings & Add new bindings to the DataView object...
                foreach (Control c in grpBasicInfo.Controls)
                {
                    if (c.GetType() == typeof(FiveCharTextBox) || c.GetType() == typeof(NormalTextbox) || c.GetType() == typeof(NormalCombobox) || c.GetType() == typeof(DateMaskedTextbox) || c.GetType() == typeof(CurrencyTextBox) || c.GetType() == typeof(CellPhoneTextBox))
                    {
                        c.Text = dt.Rows[0][c.Name.Substring(3)].ToString();
                    }
                }
                // End of Clearing & Adding of Controls Binding

                txtname.Focus();
                ShowPic();
            }
            else
            {
                MessageBox.Show("شماره هنرجو در سیستم موجود نمی باشد", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #2
0
        private void cmdedit_Click(object sender, EventArgs e)
        {
            if (dataGridView1.CurrentRow != null)
            {
                int    col = 0;
                int    row = dataGridView1.CurrentRow.Index;
                string val = dataGridView1[col, row].Value.ToString();

                std       st    = new std();
                DataTable datat = new DataTable();
                st.stdno = val;
                datat    = st.Selectforedit();

                editstd es = new editstd();
                es.txtstdno.Text = val;
                es.Search_Click();
                es.ShowDialog();

                if (btnfilter.Enabled == true)
                {
                    btnfilter.PerformClick();
                }
                else
                {
                    DataTable dt = new DataTable();
                    dt = st.SelectForView();
                    dataGridView1.DataSource = dt;
                }
            }
        }
        public void idsearch_Click()
        {
            //DataTable dt = new DataTable();
            std cu = new std();

            cu.stdno = txtstdno.Text;
            dt       = cu.Selectforedit();
            if (dt.Rows.Count > 0)
            {
                btnUpdate.Enabled   = true;
                txtstdno.Enabled    = false;
                grpinfo_box.Enabled = true;

                // Clear any previous bindings & Add new bindings to the DataView object...
                txtstatus.Text = dt.Rows[0]["status"].ToString();
                txthesab.Text  = dt.Rows[0]["hesab"].ToString();

                txtmandeh.Text   = txthesab.Text;
                txttashkhis.Text = txtstatus.Text;
                // End of Clearing & Adding of Controls Binding

                txtmandeh.Focus();
            }
            else
            {
                MessageBox.Show("شماره هنرجو در سیستم موجود نمی باشد", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #4
0
        private void btnfilter_Click(object sender, EventArgs e)
        {
            try
            {
                Boolean check = false;

                string SQL = "select * from std_history where ";
                check = false;


                if (txtstdno.Text != "")
                {
                    SQL   = SQL + "stdno=N'" + txtstdno.Text.Trim() + "'AND ";
                    check = true;
                }


                if (txtfrom_date.MaskCompleted)
                {
                    SQL   = SQL + "date>=N'" + txtfrom_date.Text.Trim() + "'AND ";
                    check = true;
                }

                if (txttodate.MaskCompleted)
                {
                    SQL   = SQL + "date<=N'" + txttodate.Text.Trim() + "'AND ";
                    check = true;
                }

                if (check == true)
                {
                    SQL = SQL.Remove(SQL.Length - 4);
                }

                std_history sickh = new std_history();
                DataTable   dt    = new DataTable();
                dt = sickh.Search(SQL);

                ///////////////////////////////////////////////////////////////////
                dataGridView1.DataSource = dt;

                dataGridView1.Columns[0].HeaderText = "ردیف";
                dataGridView1.Columns[0].Width      = 50;
                dataGridView1.Columns[1].HeaderText = "کد قبض";
                dataGridView1.Columns[1].Width      = 70;
                dataGridView1.Columns[2].HeaderText = "شماره هنرجو";
                dataGridView1.Columns[2].Width      = 100;
                dataGridView1.Columns[3].HeaderText = "شرح";
                dataGridView1.Columns[3].Width      = 170;
                dataGridView1.Columns[4].HeaderText = "تاریخ";
                dataGridView1.Columns[4].Width      = 70;
                dataGridView1.Columns[5].HeaderText = "بدهکار";
                dataGridView1.Columns[5].Width      = 80;
                dataGridView1.Columns[6].HeaderText = "بستانکار";
                dataGridView1.Columns[6].Width      = 80;
                dataGridView1.Columns[7].HeaderText = "تشخیص";
                dataGridView1.Columns[7].Width      = 80;
                dataGridView1.Columns[8].HeaderText = "مانده";
                dataGridView1.Columns[8].Width      = 80;

                std si = new std();
                si.stdno     = txtstdno.Text;
                txtname.Text = si.Selectforedit().Rows[0]["name"].ToString();

                if (dataGridView1.Rows.Count > 0)
                {
                    dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[0];
                }

                DataGridViewCellStyle dataGridViewCellStyle1 = new DataGridViewCellStyle();
                dataGridViewCellStyle1.BackColor = Color.LightBlue;
                dataGridViewCellStyle1.Font      = new Font("tahoma", 8, FontStyle.Bold);
                dataGridViewCellStyle1.Format    = "N0";
                dataGridViewCellStyle1.NullValue = null;
                dataGridView1.Columns["bedehkari"].DefaultCellStyle  = dataGridViewCellStyle1;
                dataGridView1.Columns["bestankari"].DefaultCellStyle = dataGridViewCellStyle1;
                dataGridView1.Columns["mandeh"].DefaultCellStyle     = dataGridViewCellStyle1;
            }

            catch (Exception)
            {
                MessageBox.Show("اطلاعاتی موجود نمی باشد!!!");
                txtstdno.Text = "";
            }
        }