private void button1_Click(object sender, EventArgs e)
 {
     this.Hide();
     var form = new Form4();
     form.Closed += (s, args) => this.Close();
     form.Show();
 }
Exemple #2
0
        //
        //  Port assignments:
        //
        //  170 (0x78) - 173 (0x7B) H37 floppy device
        //  174 (0x7C) - 177 (0x7F) H17 floppy device
        //  320 (0xD0) - 327 (0xD7) 8250 UART DCE device
        //  330 (0xD8) - 337 (0xDF) 8250 UART DTE device
        //  340 (0xE0) - 347 (0xE7) 8250 UART LP device
        //  350 (0xE8) - 357 (0xEF) 8250 UART console device
        //  360 (0xF0) - 361 (0xF1) H8 front panel
        //  362 (0xF2)              H89 control port
        //  370 (0xF8) - 371 (0xF9) TAPE control/data ports
        //  372 (0xFA) - 377 (0xFF) H8-5 Serial I/O (not used)
        //
        //  Video emulation is handled via a picturebox component using the actual
        //  H19 ROM font. All output to 350Q will draw an image of the font character
        //  to the picturebox.
        //
        //  All input from 350Q will read from the keyboard.
        //

        public H89IO(Form4 form)
        {
            Emulator = form;
        }
Exemple #3
0
        private void Helper_Click(object sender, EventArgs e)
        {
            Form4 TSH = new Form4();

            TSH.ShowDialog();
        }
Exemple #4
0
        private void button18_Click(object sender, EventArgs e)
        {
            Form4 f4 = new Form4();

            f4.Show();
        }
Exemple #5
0
        private void Formular_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            switch (Formular.Columns[e.ColumnIndex].Name)
            {
                case "but":
                    if (e.RowIndex == -1) break;

                    if (((DataGridViewDisableButtonCell)Formular.Rows[e.RowIndex].Cells["but"]).Value.ToString() == "����� ���������")
                    {
                        switch (MessageBox.Show("�� ������� ��� ������ ����� ���������? ����� ������������� ����� �������� �� ����� ������, �.�. ��� ���������� � ������ ��������� ���������.", "��������!", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                        {
                            case DialogResult.Yes:
                                this.dbw.RemPenalty(this.Formular.Rows[e.RowIndex].Cells["zi"].Value.ToString());
                                Conn.SQLDA.InsertCommand = new SqlCommand();
                                Conn.SQLDA.InsertCommand.Connection = Conn.ZakazCon;
                                Conn.SQLDA.InsertCommand.CommandText = "insert into Reservation_R..PENY_HIST (SUM, PDATE, INV, IDREADER, IDMAIN) values "+
                                                                       " ('"+Formular.Rows[e.RowIndex].Cells["peny"].Value.ToString()+
                                                                       "' , '"+DateTime.Now.ToString("yyyyMMdd")+
                                                                       "' ,  '" + Formular.Rows[e.RowIndex].Cells["inv"].Value.ToString() +
                                                                       "' , " + label25.Text + ", " + Formular.Rows[e.RowIndex].Cells["idmain"].Value.ToString() + ")";
                                if (Conn.SQLDA.InsertCommand.Connection.State == ConnectionState.Closed)
                                {
                                    Conn.SQLDA.InsertCommand.Connection.Open();
                                }
                                Conn.SQLDA.InsertCommand.ExecuteNonQuery();
                                Conn.SQLDA.InsertCommand.Connection.Close();
                                this.Formular.Rows.RemoveAt(e.RowIndex);
                                this.autoinc(Formular);
                                return;
                                //break;
                            case DialogResult.No:
                                return;
                                //break;
                        }
                    }

                    f4 = new Form4();
                    f4.ShowDialog();
                    if (f4.Days == -99)
                        return;
                    if (!dbw.Prolong(f4.Days, Formular.Rows[e.RowIndex].Cells["idmain"].Value.ToString(), Formular.Rows[e.RowIndex].Cells["inv"].Value.ToString()))
                    {
                        Formular.Rows[e.RowIndex].Cells["pen"].Value = false;
                        //Formular.Rows[e.RowIndex].Cells["pen"].ReadOnly = true;
                        ((DataGridViewDisableButtonCell)Formular.Rows[e.RowIndex].Cells["but"]).Enabled = true;
                        ((DataGridViewDisableButtonCell)Formular.Rows[e.RowIndex].Cells["but"]).Value = "��������";
                    }
                    dbw.InsertActionProlong(new DBWork.dbReader(int.Parse(label25.Text)), new DBWork.dbBook(Formular.Rows[e.RowIndex].Cells["bar"].Value.ToString()));
                    Formular.Rows[e.RowIndex].Cells["vozv"].Value = DateTime.Parse(Formular.Rows[e.RowIndex].Cells["vozv"].Value.ToString()).AddDays(f4.Days);
                    Formular.Rows[e.RowIndex].Cells["peny"].Value = CalculatePeny(Formular.Rows[e.RowIndex]).ToString() + " �.";
                    return;
                    //break;
                case "pen":
                    if (e.RowIndex == -1) break;
                    if (Formular.Rows[e.RowIndex].Cells["pen"].Value.ToString().ToLower() == "true")
                    {
                        if (Formular.Rows[e.RowIndex].Cells["fact"].Value.ToString() == "")
                        {
                            MessageBox.Show("�� �� ������ ����� ��������� �������, �.�. ����� ��� �� ����������! ��������� ��������� ��� ��������� �����.", "��������!", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                            //switch (MessageBox.Show("����� ��� �� ����������. �� ������������� ������ ����� ���������? ", "��������!", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                            //{
                            //    case DialogResult.Yes:
                            //        dbw.RemPenalty(Formular.Rows[e.RowIndex].Cells["idmain"].Value.ToString());
                            //        Formular.Rows[e.RowIndex].Cells["pen"].Value = false;
                            //        ((DataGridViewDisableButtonCell)Formular.Rows[e.RowIndex].Cells["but"]).Enabled = false;
                            //        ((DataGridViewDisableButtonCell)Formular.Rows[e.RowIndex].Cells["but"]).Value = "��� ���������";
                            //        break;
                            //    case DialogResult.No:
                            //        return;
                            //        //break;
                            //}
                        }
                        else
                        {
                            MessageBox.Show("����� ����� ��������� ������� �� ������ \"����� ���������\"", "��������!", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        }
                    }
                    else
                    {
                        MessageBox.Show("������ ���������� ��������� �������: ��� ��������������� �������������.");
                        //Formular.Rows[e.RowIndex].Cells["pen"].Value = false;
                    }
                    break;

            }
        }
Exemple #6
0
        private void graphicsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form4 f = new Form4();

            f.ShowDialog();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            string pass, name, addr;
            int? id;
            try
            {
                //id
                id = int.Parse(textBox1.Text);
                if (id == null)
                {
                    MessageBox.Show("Enter Id !!");
                }
                Console.WriteLine("id {0}", id);
                //password
                pass = textBox2.Text;
                if (pass == null)
                {
                    MessageBox.Show("Enter Password !!");
                }
                Console.WriteLine("password {0}", pass);
                //name
                name = textBox4.Text;
                if (name == null)
                {
                    MessageBox.Show("Enter Name !!");
                }
                Console.WriteLine("Name {0}", name);
                //address
                addr = (textBox3.Text);
                if (addr == null)
                {
                    MessageBox.Show("Enter Address !!");
                }
                Console.WriteLine("address {0}", addr);
                if (id != null && pass != null && name != null && addr != null )
                {
                    string cs = @"server=localhost;userid=root;password=1234;database=dairy_mgmt";
                    Console.WriteLine("inside");
                    MySqlConnection conn = null;

                    try
                    {
                        conn = new MySqlConnection(cs);
                        conn.Open();
                        //to insert data or run commands
                        //string sql = "SELECT admin_id FROM admin WHERE admin_id = id AND pwd = pass ;";
                        //MySqlScript script = new MySqlScript(conn, sql);
                        // Create Command
                        MySqlCommand cmd = new MySqlCommand();
                        cmd.Connection = conn;
                        cmd.CommandText = "INSERT INTO plant VALUES (?id, ?name, ?addr, ?pass) ;";
                        cmd.Parameters.AddWithValue("?id", id);
                        cmd.Parameters.AddWithValue("?name", name);
                        cmd.Parameters.AddWithValue("?addr", addr);
                        cmd.Parameters.AddWithValue("?pass", pass);
                        Console.WriteLine("in1");
                        try
                        {
                            cmd.ExecuteScalar();
                            FormRetailer.r_id_g = id;
                        }
                        catch (Exception ex) { Console.WriteLine("Exception : {0}", ex); }

                        Console.WriteLine("MySQL version : {0}", conn.ServerVersion);

                        //to show data
                        //MySqlDataAdapter da = new MySqlDataAdapter("SELECT * FROM admin;", conn);
                        //DataSet ds = new DataSet();
                        //da.Fill(ds);
                        //dataGridView1.DataSource = ds.Tables[0];

                    }
                    catch (MySqlException ex)
                    {
                        Console.WriteLine("Error: {0}", ex.ToString());

                    }
                    finally
                    {
                        if (conn != null)
                        {
                            conn.Close();
                        }
                    }
                }
                if (FormRetailer.r_id_g == null)
                {
                    MessageBox.Show("INVALID USER!!");
                }
                else
                {
                    this.Hide();
                    var form = new Form4();
                    form.Closed += (s, args) => this.Close();
                    form.Show();
                }
            }
            catch
            {
                MessageBox.Show("Enter valid Entries !!");
            }
        }
        private void pictureBox4_Click(object sender, EventArgs e)
        {
            Form4 o = new Form4();

            o.Show();
        }
Exemple #9
0
        private void button2_Click(object sender, EventArgs e)
        {
            Form4 f4 = new Form4();

            dataGridView1.Rows.Add(textBox1.Text, textBox33.Text);
        }
        //
        //
        //

        public H89Memory(Form4 form)
        {
            Emulator = form;
        }
Exemple #11
0
 private void kaynakAraToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form4 form4 = new Form4();
     form4.Show();
 }
Exemple #12
0
        private void goPrint(DataGridView dgvrIn, bool bSelectedOnly)
        {
            Int32 nRows = Convert.ToInt32(strRows);
            if (nRows > nPrintRows)
            {
                strRows = nPrintRows.ToString() ;
                nRows = nPrintRows;
            }

            Form4 printDialog = new Form4(this, strRows, strColour);

            if (printDialog.ShowDialog(this) == DialogResult.OK)
            {
                setupPrinter(strSelectedPrinter);

                //setup the update connection
                OdbcConnection connUpdate = new OdbcConnection(strConnect);
                OdbcCommand cmd = new OdbcCommand();
                cmd.CommandType = CommandType.Text;

                string strCheck = "";
                Int32 nCount = 0;

                if (bSelectedOnly)
                {
                    foreach (DataGridViewRow dgRow in dgvrIn.SelectedRows)
                    {
                        strName = "";
                        strBookingRef = "";
                        strChurch = "";
                        strYears = "";
                        strPhone = "";

                        //Print Name
                        if (dgRow.Cells["firstName"].Value != null)
                        {
                            strName = dgRow.Cells["firstName"].Value.ToString() + " " + dgRow.Cells["lastName"].Value.ToString();
                        }
                        //Booking ID
                        if (dgRow.Cells["bookingID"].Value != null)
                        {
                            strBookingRef = dgRow.Cells["bookingID"].Value.ToString();
                        }
                        //Church Name
                        if (dgRow.Cells["churchDesc"].Value != null)
                        {
                            strChurch = dgRow.Cells["churchDesc"].Value.ToString();
                        }

                        //Days
                        if (dgRow.Cells["Days"].Value != null)
                        {
                            strDays = dgRow.Cells["Days"].Value.ToString();
                        }

                        //StreamID
                        if (dgRow.Cells["band_streamID"].Value != null)
                        {
                            strStreamID = dgRow.Cells["band_streamID"].Value.ToString();
                        }

                        //Age Years
                        if (Convert.ToInt32(dgRow.Cells["band_streamID"].Value) <= 7 & dgRow.Cells["Age"].Value != null)
                        {
                            //this is a child under 10 years of age. Calc the age in years
                            strYears = "Age: " + dgRow.Cells["Age"].Value.ToString() + " years";
                            if (dgRow.Cells["family_phone"].Value != null)
                            {
                                strPhone = dgRow.Cells["family_phone"].Value.ToString();
                            }
                            else
                            {
                                if (dgRow.Cells["booking_phone"].Value != null)
                                {
                                    strPhone = dgRow.Cells["booking_phone"].Value.ToString();
                                }
                            }
                        }
                        else
                        {
                            strYears = "";
                        }

                        if (strCheck != strName)
                        {
                            printDocument1.Print();

                            //update the database
                            //cmd.CommandText = "update htb_focus.focus_guests set band_print_date = unix_timestamp() where guestID = " + dgRow.Cells["guestID"].Value;
                            cmd.CommandText = "insert into htb_bands.band_prints (guestID, band_print_date) values (" + dgRow.Cells["guestID"].Value + ", unix_timestamp()) on duplicate key update band_print_date = unix_timestamp() ";

                            cmd.Connection = connUpdate;
                            connUpdate.Open();
                            cmd.ExecuteNonQuery();
                            connUpdate.Close();
                        }
                        strCheck = strName;
                        nCount += 1;
                        if (nCount >= nRows)
                        {
                            break;
                        }

                    }

                }
                else
                {
                    nCount = 0;

                    foreach (DataGridViewRow dgRow in dgvrIn.Rows)
                    {
                        strName = "";
                        strBookingRef = "";
                        strChurch = "";
                        strYears = "";
                        strPhone = "";

                        //Print Name
                        if (dgRow.Cells["firstName"].Value != null)
                        {
                            strName = dgRow.Cells["firstName"].Value.ToString() + " " + dgRow.Cells["lastName"].Value.ToString();
                        }
                        //Booking ID
                        if (dgRow.Cells["bookingID"].Value != null)
                        {
                            strBookingRef = dgRow.Cells["bookingID"].Value.ToString();
                        }
                        //Church Name
                        if (dgRow.Cells["churchDesc"].Value != null)
                        {
                            strChurch = dgRow.Cells["churchDesc"].Value.ToString();
                        }

                        //Days
                        if (dgRow.Cells["Days"].Value != null)
                        {
                            strDays = dgRow.Cells["Days"].Value.ToString();
                        }

                        //StreamID
                        if (dgRow.Cells["band_streamID"].Value != null)
                        {
                            strStreamID = dgRow.Cells["band_streamID"].Value.ToString();
                        }

                        //Age Years
                        if (Convert.ToInt32(dgRow.Cells["band_streamID"].Value) <= 7 & dgRow.Cells["Age"].Value != null)
                        {
                            //this is a child under 10 years of age. Calc the age in years
                            //diff = currentDate - Convert.ToDateTime(dgRow.Cells["dateOfBirth"].Value.ToString());
                            //span = Math.Round(Convert.ToDecimal(diff.Days) / 365, 1);
                            strYears = "Age: " + dgRow.Cells["Age"].Value.ToString() + " years";
                            if (dgRow.Cells["family_phone"].Value != null)
                            {
                                strPhone = dgRow.Cells["family_phone"].Value.ToString();
                            }
                            else
                            {
                                if (dgRow.Cells["booking_phone"].Value != null)
                                {
                                    strPhone = dgRow.Cells["booking_phone"].Value.ToString();
                                }
                            }
                        }
                        else
                        {
                            strYears = "";
                        }

                        if (strCheck != strName)
                        {
                            printDocument1.Print();

                            //update the database
                            //cmd.CommandText = "update htb_focus.focus_guests set band_print_date = unix_timestamp() where guestID = " + dgRow.Cells["guestID"].Value;
                            cmd.CommandText = "insert into htb_bands.band_prints (guestID, band_print_date) values (" + dgRow.Cells["guestID"].Value + ", unix_timestamp()) on duplicate key update band_print_date = unix_timestamp() ";

                            cmd.Connection = connUpdate;
                            connUpdate.Open();
                            cmd.ExecuteNonQuery();
                            connUpdate.Close();
                        }
                        strCheck = strName;
                        nCount += 1;
                        if (nCount >= nRows)
                        {
                            break;
                        }
                    }
                }

                MessageBox.Show("Printing Completed Successfully");
            }
            else
            {
                MessageBox.Show("Print Cancelled");
            }
            printDialog.Dispose();
        }
Exemple #13
0
 private void OnFormClosed4(object sender, FormClosedEventArgs e)
 {
     Form4.Dispose();
     Form4 = null;
 }
Exemple #14
0
        private void OneDrive备份BToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form about = new Form4();

            about.Show();
        }
        private void metroLabel10_Click(object sender, EventArgs e)
        {
            Form4 form4 = new Form4();

            form4.Show();
        }
Exemple #16
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            Form4 f4 = new Form4();

            dataGridView1.Rows.Add("1", textBox1.Text, textBox33.Text, "A");
            dataGridView1.Rows[0].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("2", textBox2.Text, textBox35.Text, "A");
            dataGridView1.Rows[1].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("3", textBox3.Text, textBox34.Text, "A");
            dataGridView1.Rows[2].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("4", textBox4.Text, textBox36.Text, "A");
            dataGridView1.Rows[3].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("5", textBox5.Text, textBox37.Text, "B");
            dataGridView1.Rows[4].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("6", textBox6.Text, textBox38.Text, "B");
            dataGridView1.Rows[5].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("7", textBox7.Text, textBox39.Text, "B");
            dataGridView1.Rows[6].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("8", textBox8.Text, textBox40.Text, "B");
            dataGridView1.Rows[7].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("9", textBox9.Text, textBox41.Text, "C");
            dataGridView1.Rows[8].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("10", textBox10.Text, textBox42.Text, "C");
            dataGridView1.Rows[9].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("11", textBox11.Text, textBox43.Text, "C");
            dataGridView1.Rows[10].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("12", textBox12.Text, textBox44.Text, "C");
            dataGridView1.Rows[11].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("13", textBox13.Text, textBox45.Text, "D");
            dataGridView1.Rows[12].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("14", textBox14.Text, textBox46.Text, "D");
            dataGridView1.Rows[13].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("15", textBox15.Text, textBox47.Text, "D");
            dataGridView1.Rows[14].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("16", textBox16.Text, textBox48.Text, "D");
            dataGridView1.Rows[15].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("17", textBox17.Text, textBox49.Text, "E");
            dataGridView1.Rows[16].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("18", textBox18.Text, textBox50.Text, "E");
            dataGridView1.Rows[17].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("19", textBox19.Text, textBox51.Text, "E");
            dataGridView1.Rows[18].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("20", textBox20.Text, textBox52.Text, "E");
            dataGridView1.Rows[19].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("21", textBox21.Text, textBox53.Text, "F");
            dataGridView1.Rows[20].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("22", textBox22.Text, textBox54.Text, "F");
            dataGridView1.Rows[21].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("23", textBox23.Text, textBox55.Text, "F");
            dataGridView1.Rows[22].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("24", textBox24.Text, textBox56.Text, "F");
            dataGridView1.Rows[23].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("25", textBox25.Text, textBox57.Text, "G");
            dataGridView1.Rows[24].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("26", textBox26.Text, textBox58.Text, "G");
            dataGridView1.Rows[25].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("27", textBox27.Text, textBox59.Text, "G");
            dataGridView1.Rows[26].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("28", textBox28.Text, textBox60.Text, "G");
            dataGridView1.Rows[27].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("29", textBox29.Text, textBox61.Text, "H");
            dataGridView1.Rows[28].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("30", textBox30.Text, textBox62.Text, "H");
            dataGridView1.Rows[29].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("31", textBox31.Text, textBox63.Text, "H");
            dataGridView1.Rows[30].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("32", textBox32.Text, textBox64.Text, "H");
            dataGridView1.Rows[31].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("33", textBox171.Text, textBox172.Text, "I");
            dataGridView1.Rows[32].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("34", textBox178.Text, textBox177.Text, "I");
            dataGridView1.Rows[33].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("35", textBox182.Text, textBox181.Text, "I");
            dataGridView1.Rows[34].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("36", textBox186.Text, textBox185.Text, "I");
            dataGridView1.Rows[35].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("37", textBox190.Text, textBox189.Text, "J");
            dataGridView1.Rows[36].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("38", textBox194.Text, textBox193.Text, "J");
            dataGridView1.Rows[37].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("39", textBox198.Text, textBox197.Text, "J");
            dataGridView1.Rows[38].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("40", textBox202.Text, textBox201.Text, "J");
            dataGridView1.Rows[39].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("41", "", 999, "K");
            dataGridView1.Rows[40].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("42", "", 999, "K");
            dataGridView1.Rows[41].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("43", "", 999, "K");
            dataGridView1.Rows[42].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("44", "", 999, "K");
            dataGridView1.Rows[43].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("45", "", 999, "L");
            dataGridView1.Rows[44].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("46", "", 999, "L");
            dataGridView1.Rows[45].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("47", "", 999, "L");
            dataGridView1.Rows[46].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("48", "", 999, "L");
            dataGridView1.Rows[47].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("49", "", 999, "M");
            dataGridView1.Rows[48].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("50", "", 999, "M");
            dataGridView1.Rows[49].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("51", "", 999, "M");
            dataGridView1.Rows[50].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("52", "", 999, "M");
            dataGridView1.Rows[51].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("53", "", 999, "N");
            dataGridView1.Rows[52].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("54", "", 999, "N");
            dataGridView1.Rows[53].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("55", "", 999, "N");
            dataGridView1.Rows[54].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("56", "", 999, "N");
            dataGridView1.Rows[55].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("57", "", 999, "O");
            dataGridView1.Rows[56].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("58", "", 999, "O");
            dataGridView1.Rows[57].DefaultCellStyle.BackColor = Color.MediumTurquoise;

            dataGridView1.Rows.Add("59", "", 999, "O");
            dataGridView1.Rows[58].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            dataGridView1.Rows.Add("60", "", 999, "O");
            dataGridView1.Rows[59].DefaultCellStyle.BackColor = Color.MediumTurquoise;



            dataGridView1.Rows[60].DefaultCellStyle.BackColor = Color.PaleTurquoise;

            timer1.Enabled = false;
        }
Exemple #17
0
        private void EditoraToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form4 formEditora = new Form4();

            formEditora.ShowDialog();
        }
Exemple #18
0
        public ActionResult Edit([Bind(Include = "PropertyBookingID,PropertyID,Inward_No,TDate,NameOfApplicant,PhoneNo,HDate,AdvReceiptNo,AdvAmount,SecurityDepositAmt,ApplForSDRefund,FullPayReceiptNo,FullPayAmount,LuxTaxReceiptNo,RefundSDVoucherNo,PaymentOfLuxTax,Remarks")] PropertyBooking propertyBooking)
        {
            if (ModelState.IsValid)
            {
                using (var transaction = db.Database.BeginTransaction())
                {
                    try
                    {
                        db.Entry(propertyBooking).State = EntityState.Modified;
                        if (propertyBooking.FullPayAmount != null)
                        {
                            if (!propertyBooking.FullPayReceiptNo.HasValue)//Create a receipt only if it is the initial edit
                            {
                                var fullPayRcpt = new Form4 {
                                    CitizenID = null, Amount = propertyBooking.FullPayAmount, PayDate = DateTime.Now, LedgerID = 7, SubLedgerID = 3, RecvdFrom = propertyBooking.NameOfApplicant, HouseNo = null
                                };
                                db.Form4.Add(fullPayRcpt);
                                db.SaveChanges();
                                propertyBooking.FullPayReceiptNo = fullPayRcpt.RecieptNo;
                            }
                        }
                        if (propertyBooking.PaymentOfLuxTax != null)
                        {
                            if (!propertyBooking.LuxTaxReceiptNo.HasValue)
                            {
                                var LuxTax = new Form4 {
                                    CitizenID = null, Amount = propertyBooking.PaymentOfLuxTax, PayDate = DateTime.Now, LedgerID = 7, SubLedgerID = 3, RecvdFrom = propertyBooking.NameOfApplicant, HouseNo = null
                                };
                                db.Form4.Add(LuxTax);
                                db.SaveChanges();
                                propertyBooking.LuxTaxReceiptNo = LuxTax.RecieptNo;
                            }
                        }
                        if (propertyBooking.ApplForSDRefund != null)
                        {
                            if (!propertyBooking.RefundSDVoucherNo.HasValue)
                            {
                                string UserID = User.Identity.GetUserName();
                                var    pn     = db.Configs.Select(x => x.VP).FirstOrDefault();


                                var RefundSD = new Voucher {
                                    PassedBy = UserID, of = pn, Amount = propertyBooking.SecurityDepositAmt, ActualAmount = propertyBooking.SecurityDepositAmt, For = "Security Deposit refund of property booking", PayDate = propertyBooking.TDate, CBfolio = null, ResNo = null, HeldOn = propertyBooking.HDate, Meeting = "N/A", LedgerID = 7, SubLedgerID = 3
                                };
                                db.Vouchers.Add(RefundSD);
                                db.SaveChanges();
                                propertyBooking.RefundSDVoucherNo = RefundSD.VoucherID;
                            }
                        }
                        db.SaveChanges();
                        transaction.Commit();
                    }
                    catch (Exception ex)
                    {
                        transaction.Rollback();
                        throw ex;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewBag.PropertyID = new SelectList(db.Properties, "PropertyID", "PropertyName", propertyBooking.PropertyID);
            return(View(propertyBooking));
        }
Exemple #19
0
 private void button1_Click(object sender, EventArgs e)
 {         Form4 f1 = new Form4();
     f1.Show();
 }
Exemple #20
0
    private static Form4 smethod_1(Class394 A_0, Document A_1)
    {
        int   num  = 2;
        Form4 form = new Form4(A_1, A_0.method_12(BookmarkStart.b("䘧䬩䄫䬭", 2), ""));

        while (A_0.method_9(BookmarkStart.b("丧䔩䈫娭", num)))
        {
            string str;
            string key = A_0.method_1();
            if (key != null)
            {
                int num2;
                if (Class1160.dictionary_202 == null)
                {
                    Dictionary <string, int> dictionary1 = new Dictionary <string, int>(7);
                    dictionary1.Add(BookmarkStart.b("䤧䘩堫怭儯弱儳", num), 0);
                    dictionary1.Add(BookmarkStart.b("堧䬩䈫䄭䌯圱ᤳܵ", num), 1);
                    dictionary1.Add(BookmarkStart.b("䬧䈩䴫尭䌯圱䀳", num), 2);
                    dictionary1.Add(BookmarkStart.b("丧䬩䄫䜭尯䬱", num), 3);
                    dictionary1.Add(BookmarkStart.b("䘧䔩堫稭䈯䜱儳戵䄷䨹夻", num), 4);
                    dictionary1.Add(BookmarkStart.b("堧䌩堫䴭堯", num), 5);
                    dictionary1.Add(BookmarkStart.b("嬧䌩䬫", num), 6);
                    Class1160.dictionary_202 = dictionary1;
                }
                if (Class1160.dictionary_202.TryGetValue(key, out num2))
                {
                    switch (num2)
                    {
                    case 0:
                    {
                        form.method_34(A_0.method_28());
                        continue;
                    }

                    case 1:
                    {
                        form.method_36(new byte[10]);
                        Class114.smethod_10(A_0.method_28(), form.method_35(), 0);
                        continue;
                    }

                    case 2:
                    {
                        form.method_38(Class114.smethod_8(A_0.method_28()));
                        continue;
                    }

                    case 3:
                    {
                        form.method_40(Class911.smethod_0(A_0.method_28()));
                        continue;
                    }

                    case 4:
                    {
                        form.method_44(!A_0.method_31());
                        continue;
                    }

                    case 5:
                    {
                        form.method_42(Class417.smethod_6(A_0.method_28()));
                        continue;
                    }

                    case 6:
                        form.method_46(new byte[0x18]);
                        goto Label_02A3;
                    }
                }
            }
            goto Label_02B0;
Label_01A5:
            if ((str = A_0.method_1()) != null)
            {
                if (str != BookmarkStart.b("崧天丫̭/", num))
                {
                    if (str != BookmarkStart.b("崧天丫̭į", num))
                    {
                        if (str != BookmarkStart.b("崧天丫̭ȯ", num))
                        {
                            if (str != BookmarkStart.b("崧天丫̭̯", num))
                            {
                                if (!(str == BookmarkStart.b("䬧天丫̭/", num)))
                                {
                                    if (str == BookmarkStart.b("䬧天丫̭į", num))
                                    {
                                        Class114.smethod_11(A_0.method_3(), form.method_45(), 20);
                                    }
                                }
                                else
                                {
                                    Class114.smethod_11(A_0.method_3(), form.method_45(), 0x10);
                                }
                            }
                            else
                            {
                                Class114.smethod_11(A_0.method_3(), form.method_45(), 12);
                            }
                        }
                        else
                        {
                            Class114.smethod_11(A_0.method_3(), form.method_45(), 8);
                        }
                    }
                    else
                    {
                        Class114.smethod_11(A_0.method_3(), form.method_45(), 4);
                    }
                }
                else
                {
                    Class114.smethod_11(A_0.method_3(), form.method_45(), 0);
                }
            }
Label_02A3:
            if (A_0.method_19())
            {
                goto Label_01A5;
            }
            continue;
Label_02B0:
            A_0.vmethod_1();
        }
        return(form);
    }
Exemple #21
0
 private void button6_Click(object sender, EventArgs e)
 {
     Form4 form4 = new Form4();
     form4.ShowDialog();
 }
Exemple #22
0
 protected override DockTarget FindDockTarget(Point position)
 {
     DockTarget target;
     bool flag = rectangle_1.Contains(position);
     bool flag2 = rectangle_2.Contains(position);
     if (flag == bool_2)
     {
         if (flag2 == bool_3)
         {
             goto IL_C1;
         }
     }
     object[] array = arrayList_0.ToArray();
     int i = 0;
     while (i < array.Length)
     {
         Form4 form = (Form4)array[i];
         if (form.DockStyle != DockStyle.Fill)
         {
             goto IL_7B;
         }
         if (flag2 == bool_3)
         {
             goto IL_7B;
         }
         if (!flag2)
         {
             form.method_12();
         }
         else
         {
             form.method_13();
         }
         IL_A5:
         i++;
         continue;
         IL_7B:
         if (form.DockStyle == DockStyle.Fill)
         {
             goto IL_A5;
         }
         if (flag == bool_2)
         {
             goto IL_A5;
         }
         if (flag)
         {
             form.method_13();
             goto IL_A5;
         }
         form.method_12();
         goto IL_A5;
     }
     bool_2 = flag;
     bool_3 = flag2;
     IL_C1:
     ControlLayoutSystem controlLayoutSystem = method_23(position, out target);
     if (controlLayoutSystem == SourceControlSystem && SourceControl == null)
     {
         controlLayoutSystem = null;
     }
     if (controlLayoutSystem != controlLayoutSystem_1)
     {
         if (form4_0 != null)
         {
             form4_0.method_11();
             form4_0 = null;
         }
         controlLayoutSystem_1 = controlLayoutSystem;
         if (controlLayoutSystem_1 != null)
         {
             form4_0 = new Form4(this, controlLayoutSystem_1);
             form4_0.method_13();
         }
     }
     if (target != null && target.type == DockTargetType.Undefined)
     {
         target = null;
     }
     if (form4_0 != null && form4_0.Rectangle_5.Contains(position) && target == null)
     {
         target = form4_0.method_4(position);
     }
     object[] array2 = arrayList_0.ToArray();
     for (int j = 0; j < array2.Length; j++)
     {
         Form4 form2 = (Form4)array2[j];
         if (target == null && form2.Rectangle_5.Contains(position))
         {
             target = form2.method_4(position);
         }
     }
     return target;
 }
        private void button2_Click(object sender, EventArgs e)
        {
            int? id, sid,qty, amt, numberOfRecords;
            string source;
            DateTime date;
            float? fat;
            try
            {
                //id
                id = int.Parse(textBox1.Text);
                if (id == null)
                {
                    MessageBox.Show("Enter Bill number !!");
                }
                Console.WriteLine("id {0}", id);
                //source
                source = (textBox2.Text);
                if (source == null)
                {
                    MessageBox.Show("Enter Source !!");
                }
                Console.WriteLine("source  {0}", source);
                //date
                date = dateTimePicker1.Value;
                //date = DateTime.Parse(textBox3.Text);
                if (date == null)
                {
                    MessageBox.Show("Enter date !!");
                }
                Console.WriteLine("date  {0}", date);
                //qty
                qty = int.Parse(textBox4.Text);
                if (qty == null)
                {
                    MessageBox.Show("Enter Quantity !!");
                }
                Console.WriteLine("qty  {0}", qty);
                //Price
                amt = int.Parse(textBox5.Text);
                if (amt == null)
                {
                    MessageBox.Show("Enter amount !!");
                }
                Console.WriteLine("amt  {0}", amt);
                //Fat
                fat = float.Parse(textBox6.Text);
                if (fat == null)
                {
                    MessageBox.Show("Enter fat%age !!");
                }
                Console.WriteLine("fat  {0}", fat);

                //seller-id
                sid = int.Parse(textBox7.Text);
                if (sid == null)
                {
                    MessageBox.Show("Enter seller-id from which to buy !!");
                }
                Console.WriteLine("seller-id {0}", sid);
                if (id != null && sid != null && amt != null && date != null && qty != null && amt != null && source != null)
                {
                    string cs = @"server=localhost;userid=root;password=1234;database=dairy_mgmt";
                    Console.WriteLine("inside");
                    MySqlConnection conn = null;

                    try
                    {
                        conn = new MySqlConnection(cs);
                        conn.Open();
                        //to insert data or run commands
                        //string sql = "SELECT admin_id FROM admin WHERE admin_id = id AND pwd = pass ;";
                        //MySqlScript script = new MySqlScript(conn, sql);
                        // Create Command
                        MySqlCommand cmd = new MySqlCommand();
                        cmd.Connection = conn;
                        cmd.CommandText = "SELECT * FROM seller WHERE seller_id =" + sid + ";";
                        //cmd.Parameters.AddWithValue("?ssid", sid);
                        Console.WriteLine("in1");
                        try
                        {
                            numberOfRecords = Convert.ToInt32(cmd.ExecuteScalar());
                            Console.WriteLine("no. of seller : {0}", numberOfRecords);
                            if (numberOfRecords == -1 )
                            {
                                MessageBox.Show("Invalid seller-id!!!");
                            }
                            if (numberOfRecords != -1)
                            {
                                cmd.Connection = conn;
                                cmd.CommandText = "INSERT INTO seller_bill_pl VALUES (?id,?source,?date,?qty,?amt,?fat, ?sid, ?plid ) ;";
                                cmd.Parameters.AddWithValue("?id", id);
                                cmd.Parameters.AddWithValue("?source", source);
                                cmd.Parameters.AddWithValue("?date", date);
                                cmd.Parameters.AddWithValue("?qty", qty);
                                cmd.Parameters.AddWithValue("?amt", amt);
                                cmd.Parameters.AddWithValue("?fat", fat);
                                cmd.Parameters.AddWithValue("?sid", sid);
                                cmd.Parameters.AddWithValue("?plid", FormPlant.pl_id_g);
                                Console.WriteLine("in2");
                                try
                                {
                                    cmd.ExecuteScalar();
                                }
                                catch (Exception ex) { Console.WriteLine("Exception : {0}", ex); }
                            }
                        }
                        catch (Exception ex) { Console.WriteLine("Exception : {0}", ex); }

                        Console.WriteLine("MySQL version : {0}", conn.ServerVersion);

                        //to show data
                        //MySqlDataAdapter da = new MySqlDataAdapter("SELECT * FROM admin;", conn);
                        //DataSet ds = new DataSet();
                        //da.Fill(ds);
                        //dataGridView1.DataSource = ds.Tables[0];

                    }
                    catch (MySqlException ex)
                    {
                        Console.WriteLine("Error: {0}", ex.ToString());

                    }
                    finally
                    {
                        if (conn != null)
                        {
                            conn.Close();
                        }
                    }
                }

                this.Hide();
                var form = new Form4();
                form.Closed += (s, args) => this.Close();
                form.Show();

            }
            catch
            {
                MessageBox.Show("Enter valid Entries !!");
            }
        }
Exemple #24
0
        private void Busca_Click(object sender, EventArgs e)
        {
            Line.Clear();
            var Conectar     = new SQLConexao();
            var ObjectConect = Conectar.Conect();

            ObjectConect.Open();
            bool Ok      = true;
            bool Ok2     = true;
            bool control = true;

            if (Buscar())
            {
                string LineID = "", LineN = "", LineI = "", LineE = "", LineC = "", LineS = "", LineP = "";
                try
                {
                    do
                    {
                        string        Pesq         = "Select ID,Nome,Idade,Cidade,Email, Senha, PalavraChave from Cadastros";
                        var           ComandoBusca = new SqlCommand(Pesq, ObjectConect);
                        SqlDataReader DataBusca;
                        DataBusca = ComandoBusca.ExecuteReader();

                        while (DataBusca.Read())
                        {
                            LineID = DataBusca.GetValue(0).ToString();
                            LineN  = DataBusca.GetValue(1).ToString();
                            LineI  = DataBusca.GetValue(2).ToString();
                            LineC  = DataBusca.GetValue(3).ToString();
                            LineE  = DataBusca.GetValue(4).ToString();
                            LineS  = DataBusca.GetValue(5).ToString();
                            LineP  = DataBusca.GetValue(6).ToString();

                            int S = int.Parse(textSenha.Text);

                            if (DataBusca.GetValue(4).Equals(Criptografia.Encrypt(textEmail.Text)))
                            {
                                if (!(DataBusca.GetValue(5).Equals(Criptografia.Encrypt(S.ToString()))))
                                {
                                    Ok2     = true;
                                    control = false;

                                    textEmail.Enabled = false;
                                    Ver.ForeColor     = Color.Red;
                                    Ver.Text          = "Senha incorreta ! Digite novamente.";
                                    textSenha.Clear();
                                    textSenha.Focus();
                                }
                                Ok = true;
                                break;
                            }
                            else
                            {
                                Ok  = false;
                                Ok2 = false;
                            }
                        }

                        if (!Ok && !Ok2)
                        {
                            control = false;
                            textSenha.Clear();
                            textEmail.Focus();
                            textEmail.Clear();
                            Ver.ForeColor = Color.Red;
                            Ver.Text      = "Usuário e Senha incorretos ! Digite novamente.";
                        }
                        DataBusca.Close();
                    }while (!Ok);

                    if (control)
                    {
                        Line.Add(LineID);
                        Line.Add(LineN);
                        Line.Add(LineI);
                        Line.Add(LineC);
                        Line.Add(LineE);
                        Line.Add(LineS);
                        Line.Add(LineP);
                        text = Criptografia.Decrypt(LineN);
                        var Forma4 = new Form4();
                        this.Dispose();
                        Thread.Sleep(3000);
                        Forma4.Visible = true;
                    }
                }
                catch (Exception ex)
                {
                    if (control)
                    {
                        MessageBox.Show("Não foi possível realizar a busca no SQL Server !\n\nErro: " + ex.Message,
                                        "ERRO", MessageBoxButtons.OK, MessageBoxIcon.Error
                                        );
                    }
                }
                finally
                {
                    ObjectConect.Close();
                }
            }
        }