Esempio n. 1
0
        private void frmStdHisView_Load(object sender, EventArgs e)
        {
            groupBox1.Focus();
            txtstdno.Focus();
            txtstdno.SelectAll();

            System.Globalization.CultureInfo inp = new System.Globalization.CultureInfo("fa-IR");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(inp);

            dataGridView1.AutoGenerateColumns = true;

            DataGridViewCellStyle objAlternatingCellStyle = new DataGridViewCellStyle();

            objAlternatingCellStyle.BackColor             = Color.Khaki;
            dataGridView1.AlternatingRowsDefaultCellStyle = objAlternatingCellStyle;

            if (sabegheh == true)
            {
                btnfilter.PerformClick();
            }
            else
            {
                std       si     = new std();
                DataTable dtname = new DataTable();
                dtname                = si.Search("SELECT stdno,name FROM std");
                txtname.DataSource    = dtname;
                txtname.DisplayMember = "name";
                txtname.ValueMember   = "name";
                txtstdno.DataBindings.Clear();
                txtstdno.DataBindings.Add("Text", dtname, "stdno");
            }
            //dataGridView1.Columns["mandeh"].HeaderText = "Column1";
            //dataGridView1.Columns["mandeh"].Name = "Column1";
            //dataGridView1.Columns["mandeh"].ReadOnly = true;
        }
Esempio n. 2
0
        private void frmGhabzDaryaft_Load(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo inp = new System.Globalization.CultureInfo("fa-IR");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(inp);
            cur_date = Date.currentDate_Getter();

            newform();

            Courses   co     = new Courses();
            DataTable dtname = new DataTable();

            dtname = co.Search("SELECT coursename FROM courses order by coursename");
            txtartcourse.DataSource    = dtname;
            txtartcourse.DisplayMember = "coursename";
            txtartcourse.ValueMember   = "coursename";

            std       st        = new std();
            DataTable dtstdname = new DataTable();

            dtstdname             = st.Search("SELECT name, stdno FROM std order by name");
            txtname.DataSource    = dtstdname;
            txtname.DisplayMember = "name";
            txtname.ValueMember   = "name";
            txtstdno.DataBindings.Clear();
            txtstdno.DataBindings.Add("Text", dtstdname, "stdno");
        }
        private void fillInfo()
        {
            ghabz gh = new ghabz();

            txtid.Text = gh.Selectmaxid();

            DataTable lastmablagh = gh.Search("select top 1(mablagh) from ghabz order by id desc");

            if (lastmablagh.Rows.Count > 0)
            {
                txtmablagh.Text = lastmablagh.Rows[0][0].ToString();
            }
            else
            {
                txtmablagh.Text = "0";
            }

            txtdate.Text  = cur_date;
            txtsharh.Text = "";

            std       st        = new std();
            DataTable dtstdname = new DataTable();

            dtstdname     = st.Search("SELECT stdno,name FROM std where stdno=" + stdno);
            txtname.Text  = dtstdname.Rows[0]["name"].ToString();
            txtstdno.Text = dtstdname.Rows[0]["stdno"].ToString();

            txtlastdate.Text = Date.returnLastDateOfaDate(txtdate.Text);

            groupBox1.Focus();
            txtname.Focus();
        }
Esempio n. 4
0
        public void Search_Click()
        {
            Courses   co     = new Courses();
            DataTable dtname = new DataTable();

            dtname = co.Search("SELECT coursename FROM courses");
            txtartcourse.DataSource    = dtname;
            txtartcourse.DisplayMember = "coursename";
            txtartcourse.ValueMember   = "coursename";

            std       st        = new std();
            DataTable dtstdname = new DataTable();

            dtstdname                = st.Search("SELECT name, stdno FROM std order by name");
            txtstdname.DataSource    = dtstdname;
            txtstdname.DisplayMember = "name";
            txtstdname.ValueMember   = "name";

            txtstdno.DataBindings.Clear();
            txtstdno.DataBindings.Add("Text", dtstdname, "stdno");

            teachers  te       = new teachers();
            DataTable dttename = new DataTable();

            dttename = te.Search("SELECT name FROM teachers");
            txtteacher.DataSource    = dttename;
            txtteacher.DisplayMember = "name";
            txtteacher.ValueMember   = "name";

            DataTable dt = new DataTable();
            classes   cu = new classes();

            cu.classno = long.Parse(txtclassno.Text);
            dt         = cu.Selectforedit();
            if (dt.Rows.Count > 0)
            {
                btnUpdate.Enabled  = true;
                txtclassno.Enabled = false;
                //idsearch.Enabled = false;
                grpinfo_box.Enabled = true;

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

                txtartcourse.Focus();
            }
            else
            {
                MessageBox.Show("مشخصه کلاس در سیستم موجود نمی باشد", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 5
0
        private void frmGhabzView_Load(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo inp = new System.Globalization.CultureInfo("fa-IR");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(inp);
            cur_date = Date.currentDate_Getter();

            Courses   co     = new Courses();
            DataTable dtname = new DataTable();

            dtname = co.Search("SELECT coursename FROM courses order by coursename");
            txtartcourse.DataSource    = dtname;
            txtartcourse.DisplayMember = "coursename";
            txtartcourse.ValueMember   = "coursename";

            std       st        = new std();
            DataTable dtstdname = new DataTable();

            dtstdname             = st.Search("SELECT name FROM std order by name");
            txtname.DataSource    = dtstdname;
            txtname.DisplayMember = "name";
            txtname.ValueMember   = "name";

            txtartcourse.Text = "";
            txtname.Text      = "";



            checkBox1.Checked = true;
            btnfilter.PerformClick();

            grdDataViewer.AutoGenerateColumns = true;

            string[] col_headers = { "شماره قبض", "ش هنرجویی", "نام و نام خانوادگی", "کلاس", "تاریخ", "تاریخ پایان تسویه", "ماه تسویه", "هزینه دوره", "مبلغ دریافتی", "توضیحات" };
            int[]    col_width   = { 70, 60, 120, 90, 80, 80, 70, 70, 70, 180 };

            for (int i = 0; i < col_headers.Length; i++)
            {
                grdDataViewer.Columns[i].HeaderText = col_headers[i].ToString();
                grdDataViewer.Columns[i].Width      = col_width[i];
            }

            DataGridViewCellStyle objAlternatingCellStyle = new DataGridViewCellStyle();

            objAlternatingCellStyle.BackColor             = Color.Khaki;
            grdDataViewer.AlternatingRowsDefaultCellStyle = objAlternatingCellStyle;

            DataGridViewCellStyle dataGridViewCellStyle1 = new DataGridViewCellStyle();

            dataGridViewCellStyle1.Format    = "N0";
            dataGridViewCellStyle1.NullValue = null;
            grdDataViewer.Columns["mablagh"].DefaultCellStyle = dataGridViewCellStyle1;
            grdDataViewer.Columns["paid"].DefaultCellStyle    = dataGridViewCellStyle1;
        }
Esempio n. 6
0
        public void idsearch_Click()
        {
            Courses   co     = new Courses();
            DataTable dtname = new DataTable();

            dtname = co.Search("SELECT coursename FROM courses order by coursename");
            txtartcourse.DataSource    = dtname;
            txtartcourse.DisplayMember = "coursename";
            txtartcourse.ValueMember   = "coursename";

            std       st        = new std();
            DataTable dtstdname = new DataTable();

            dtstdname             = st.Search("SELECT name, stdno FROM std order by name");
            txtname.DataSource    = dtstdname;
            txtname.DisplayMember = "name";
            txtname.ValueMember   = "name";
            txtstdno.DataBindings.Clear();
            txtstdno.DataBindings.Add("Text", dtstdname, "stdno");

            ghabz gh = new ghabz();

            gh.id = txtid.Text;
            DataTable dt = gh.Selectforedit();

            if (dt.Rows.Count > 0)
            {
                btnUpdate.Enabled = true;
                txtid.Enabled     = false;
                groupBox1.Enabled = true;
                // Clear any previous bindings & Add new bindings to the DataView object...
                foreach (Control c in groupBox1.Controls)
                {
                    if (c.GetType() == typeof(FiveCharTextBox) || c.GetType() == typeof(NormalCombobox) || c.GetType() == typeof(DateMaskedTextbox) || c.GetType() == typeof(CurrencyTextBox) || c.GetType() == typeof(NormalTextbox))
                    {
                        if (c != txtlastdate && c != txtmandeh && c != txtlastcheck)
                        {
                            c.Text = dt.Rows[0][c.Name.Substring(3)].ToString();
                        }
                    }
                }
                txtlastdate.Text  = dt.Rows[0]["lastdate"].ToString();
                txtlastcheck.Text = dt.Rows[0]["lastcheck"].ToString();
                // End of Clearing & Adding of Controls Binding

                txtstdno.Focus();
            }
            else
            {
                MessageBox.Show("شماره قبض در سیستم موجود نمی باشد", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 7
0
        public void idsearch_Click()
        {
            std       st        = new std();
            DataTable dtstdname = new DataTable();

            dtstdname                = st.Search("SELECT stdno, name FROM std order by name");
            txtstdname.DataSource    = dtstdname;
            txtstdname.DisplayMember = "name";
            txtstdname.ValueMember   = "name";

            txtstdno.DataBindings.Clear();
            txtstdno.DataBindings.Add("Text", dtstdname, "stdno");

            hozoorclass gha = new hozoorclass();

            gha.stdno   = OLD_STDNO;
            gha.classno = long.Parse(OLD_CLASSNO);
            gha.date    = OLD_DATE;
            DataTable dt = gha.Selectforedit();

            if (dt.Rows.Count > 0)
            {
                btnUpdate.Enabled = true;
                txtstdno.Enabled  = false;
                groupBox1.Enabled = true;
                // Clear any previous bindings & Add new bindings to the DataView object...
                foreach (Control c in groupBox1.Controls)
                {
                    if (c.GetType() == typeof(NormalTextbox) || c.GetType() == typeof(NormalCombobox) || c.GetType() == typeof(DateMaskedTextbox))
                    {
                        c.Text = dt.Rows[0][c.Name.Substring(3)].ToString();
                    }
                }

                if (dt.Rows[0]["status"].ToString() == "حاضر")
                {
                    rdoHazer.Checked = true;
                }
                else
                {
                    rdoGhayeb.Checked = true;
                }
                // End of Clearing & Adding of Controls Binding
                btnUpdate.Enabled = true;
                txtstdname.Focus();
            }
            else
            {
                MessageBox.Show("مشخصات در سیستم موجود نمی باشد", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 8
0
        private void frmMain_Shown(object sender, EventArgs e)
        {
            // fill the quick search bar
            std       st        = new std();
            DataTable dtstdname = new DataTable();

            //dtstdname = st.Search("SELECT name, stdno FROM std where (stdno in (select stdno from classes where payan_date is null OR payan_date=N'')) order by name")
            dtstdname = st.Search("SELECT name, stdno FROM std");
            txtQuickSearchName.DataSource    = dtstdname;
            txtQuickSearchName.DisplayMember = "name";
            txtQuickSearchName.ValueMember   = "name";
            txtQuickSearchStdno.DataBindings.Clear();
            txtQuickSearchStdno.DataBindings.Add("Text", dtstdname, "stdno");
        }
Esempio n. 9
0
        private void btnfilter_Click(object sender, EventArgs e)
        {
            Boolean check = false;

            string SQL  = "select stdno, reg_date,name,father,idno,job,degree,course,tel, mob,hesab, status,address,resume from std where ";
            string SQL2 = "select * from std where ";

            check = false;


            if (txtstdname.Text != "")
            {
                SQL  = SQL + "name like N'%" + txtstdname.Text.Trim() + "%'AND ";
                SQL2 = SQL2 + "name like N'%" + txtstdname.Text.Trim() + "%'AND ";
                checkBox1.Checked = false;
                check             = true;
            }
            if (checkBox1.Checked)
            {
                SQL   = SQL + "(stdno in (select stdno from classes where payan_date is null OR payan_date=N''))AND ";
                check = true;
            }



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

            std       st = new std();
            DataTable dt = new DataTable();

            dt = st.Search(SQL);
            dataGridView1.DataSource = dt;


            if (dataGridView1.RowCount == 0)
            {
                cmddel.Enabled  = false;
                cmdedit.Enabled = false;
            }
            else
            {
                cmddel.Enabled  = true;
                cmdedit.Enabled = true;
            }
        }
Esempio n. 10
0
        private void frmHozoorView_Load(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo inp = new System.Globalization.CultureInfo("fa-IR");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(inp);
            cur_date = Date.currentDate_Getter();


            Courses   co     = new Courses();
            DataTable dtname = new DataTable();

            dtname = co.Search("SELECT coursename FROM courses order by coursename");
            txtartcourse.DataSource    = dtname;
            txtartcourse.DisplayMember = "coursename";
            txtartcourse.ValueMember   = "coursename";

            std       st        = new std();
            DataTable dtstdname = new DataTable();

            dtstdname             = st.Search("SELECT name FROM std order by name");
            txtname.DataSource    = dtstdname;
            txtname.DisplayMember = "name";
            txtname.ValueMember   = "name";

            txtartcourse.Text = "";
            txtname.Text      = "";



            checkBox1.Checked = true;
            btnfilter.PerformClick();

            grdDataViewer.AutoGenerateColumns = true;

            string[] col_headers = { "ردیف", "مشخصه هنرجو", "نام و نام خانوادگی", "مشخصه کلاس", "رشته هنری", "تاریخ", "روز", "وضعیت" };
            int[]    col_width   = { 60, 70, 120, 70, 90, 80, 80, 77 };

            for (int i = 0; i < col_headers.Length; i++)
            {
                grdDataViewer.Columns[i].HeaderText = col_headers[i].ToString();
                grdDataViewer.Columns[i].Width      = col_width[i];
            }

            DataGridViewCellStyle objAlternatingCellStyle = new DataGridViewCellStyle();

            objAlternatingCellStyle.BackColor             = Color.Khaki;
            grdDataViewer.AlternatingRowsDefaultCellStyle = objAlternatingCellStyle;
        }
Esempio n. 11
0
        private void classview_Load(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo inp = new System.Globalization.CultureInfo("fa-IR");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(inp);
            cur_date = Date.currentDate_Getter();


            Courses   co     = new Courses();
            DataTable dtname = new DataTable();

            dtname = co.Search("SELECT coursename FROM courses order by coursename");
            txtartcourse.DataSource    = dtname;
            txtartcourse.DisplayMember = "coursename";
            txtartcourse.ValueMember   = "coursename";

            std       st        = new std();
            DataTable dtstdname = new DataTable();

            dtstdname                = st.Search("SELECT name FROM std order by name");
            txtstdname.DataSource    = dtstdname;
            txtstdname.DisplayMember = "name";
            txtstdname.ValueMember   = "name";

            teachers  te       = new teachers();
            DataTable dttename = new DataTable();

            dttename = te.Search("SELECT name FROM teachers order by name");
            txtteacher.DataSource    = dttename;
            txtteacher.DisplayMember = "name";
            txtteacher.ValueMember   = "name";

            txtartcourse.Text = "";
            txtteacher.Text   = "";
            txtstdname.Text   = "";
            txtday.Text       = "";



            cmddel.Enabled  = true;
            cmdedit.Enabled = true;

            checkBox1.Checked = true;
        }
Esempio n. 12
0
        private void stdview_Load(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo inp = new System.Globalization.CultureInfo("fa-IR");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(inp);

            std       st  = new std();
            DataTable dt2 = new DataTable();

            dt2 = st.Search("select distinct name from std");
            txtstdname.DataSource    = dt2;
            txtstdname.DisplayMember = "name";
            txtstdname.ValueMember   = "name";
            txtstdname.Text          = "";

            cmddel.Enabled  = true;
            cmdedit.Enabled = true;

            checkBox1.Checked = true;
        }
Esempio n. 13
0
        private void frmHozoor_Load(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo inp = new System.Globalization.CultureInfo("fa-IR");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(inp);
            cur_date = Date.currentDate_Getter();


            Courses   co     = new Courses();
            DataTable dtname = new DataTable();

            dtname = co.Search("SELECT coursename FROM courses order by coursename");
            class_txtartcourse.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            class_txtartcourse.AutoCompleteSource = AutoCompleteSource.ListItems;
            class_txtartcourse.Items.Add("");
            foreach (DataRow dr in dtname.Rows)
            {
                class_txtartcourse.Items.Add(dr[0].ToString());
            }


            std       st        = new std();
            DataTable dtstdname = new DataTable();

            dtstdname                = st.Search("SELECT stdno, name FROM std order by name");
            txtstdname.DataSource    = dtstdname;
            txtstdname.DisplayMember = "name";
            txtstdname.ValueMember   = "name";

            txtstdno.DataBindings.Clear();
            txtstdno.DataBindings.Add("Text", dtstdname, "stdno");


            txtday.SelectedIndex = DayReader(DateTime.Now.DayOfWeek.ToString());

            DataGridViewCellStyle ghabzGridViewStyle = new DataGridViewCellStyle();

            ghabzGridViewStyle.Format    = "N0";
            ghabzGridViewStyle.NullValue = null;
            ghabzGridView.Columns["mablagh"].DefaultCellStyle = ghabzGridViewStyle;

            newform();
        }
Esempio n. 14
0
        private void btnstd_Click(object sender, EventArgs e)
        {
            int    cmbPos = txtstdname.SelectedIndex;
            addstd ac     = new addstd();

            ac.ShowDialog();

            std       st        = new std();
            DataTable dtstdname = new DataTable();

            dtstdname                = st.Search("SELECT name, stdno FROM std order by name");
            txtstdname.DataSource    = dtstdname;
            txtstdname.DisplayMember = "name";
            txtstdname.ValueMember   = "name";

            txtstdname.SelectedIndex = cmbPos;

            txtstdno.DataBindings.Clear();
            txtstdno.DataBindings.Add("Text", dtstdname, "stdno");
        }
Esempio n. 15
0
        private void frmHozoor_Load(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo inp = new System.Globalization.CultureInfo("fa-IR");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(inp);


            std       st        = new std();
            DataTable dtstdname = new DataTable();

            dtstdname                = st.Search("SELECT stdno, name FROM std order by name");
            txtstdname.DataSource    = dtstdname;
            txtstdname.DisplayMember = "name";
            txtstdname.ValueMember   = "name";

            txtstdno.DataBindings.Clear();
            txtstdno.DataBindings.Add("Text", dtstdname, "stdno");


            txtday.SelectedIndex = DayReader(DateTime.Now.DayOfWeek.ToString());

            newform();
        }
Esempio n. 16
0
        private void addclass_Load(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo inp = new System.Globalization.CultureInfo("fa-IR");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(inp);
            cur_date = Date.currentDate_Getter();


            Courses   co     = new Courses();
            DataTable dtname = new DataTable();

            dtname = co.Search("SELECT coursename FROM courses");
            txtartcourse.DataSource    = dtname;
            txtartcourse.DisplayMember = "coursename";
            txtartcourse.ValueMember   = "coursename";


            teachers  te       = new teachers();
            DataTable dttename = new DataTable();

            dttename = te.Search("SELECT name FROM teachers");
            txtteacher.DataSource    = dttename;
            txtteacher.DisplayMember = "name";
            txtteacher.ValueMember   = "name";

            FillDataSetAndView();

            if (objCurrencyManager.Count == 0)
            {
                foreach (Control c in grpinfo_box.Controls)
                {
                    if (c.GetType() == typeof(NormalTextbox) || c.GetType() == typeof(NormalCombobox) || c.GetType() == typeof(TimeMaskedTextbox) || c.GetType() == typeof(DateMaskedTextbox))
                    {
                        c.Enabled = false;
                    }
                }
                txtopen_date.Text = cur_date;

                btnAdd.Enabled             = false;
                btnMoveFirst.Enabled       = false;
                btnMovePrevious.Enabled    = false;
                btnMoveNext.Enabled        = false;
                btnMoveLast.Enabled        = false;
                btnUpdate.Enabled          = false;
                btnNew.Visible             = true;
                txtRecordPosition.Text     = "No Record";
                toolStripStatusLabel1.Text = "آماده ایجاد رکورد جدید";
            }
            else
            {
                BindFields();
                objCurrencyManager.Position = objCurrencyManager.Count - 1;
                ShowPosition();
                btnAdd.Enabled = false;
            }

            std       st        = new std();
            DataTable dtstdname = new DataTable();

            dtstdname                = st.Search("SELECT name, stdno FROM std order by name");
            txtstdname.DataSource    = dtstdname;
            txtstdname.DisplayMember = "name";
            txtstdname.ValueMember   = "name";
            txtstdno.DataBindings.Clear();
            txtstdno.DataBindings.Add("Text", dtstdname, "stdno");
        }