Beispiel #1
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");
        }
Beispiel #2
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);
            }
        }
Beispiel #3
0
        private void teacherview_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";

            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";

            DataTable dt = new DataTable();

            dt              = te.SelectforView();
            cmddel.Enabled  = true;
            cmdedit.Enabled = true;

            txtteacher.Text   = "";
            txtartcourse.Text = "";

            dataGridView1.DataSource          = dt;
            dataGridView1.AutoGenerateColumns = true;

            if (dataGridView1.RowCount == 0)
            {
                cmddel.Enabled  = false;
                cmdedit.Enabled = false;
            }

            string[] col_headers = { "ردیف", "نام و نام خانوادگی", "رشته هنری", "تلفن", "سوابق هنری" };
            int[]    col_width   = { 67, 130, 110, 100, 200 };

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


            DataGridViewCellStyle objAlternatingCellStyle = new DataGridViewCellStyle();

            objAlternatingCellStyle.BackColor             = Color.Khaki;
            dataGridView1.AlternatingRowsDefaultCellStyle = objAlternatingCellStyle;
        }
Beispiel #4
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;
        }
Beispiel #5
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;
        }
Beispiel #6
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;
        }
Beispiel #7
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();
        }
Beispiel #8
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");
        }