Exemple #1
0
        private void cancel_button_Click(object sender, EventArgs e)
        {
            Job_Order_Details g = new Job_Order_Details();

            g.Show();
            this.Hide();
        }
Exemple #2
0
        private void labor_fee_button_Click(object sender, EventArgs e)
        {
            for (int a = 0; a < labor_view.Rows.Count; a++)
            {
                if (Convert.ToString(labor_view.Rows[a].Cells[1].Value) == string.Empty)
                {
                }
                else
                {
                    Conn.Open();
                    MySqlCommand cmd2 = new MySqlCommand("set foreign_key_checks=0; update job_order_services set labor_fee=@labf, subtotal_job_order=(service_fee + @labf) where job_order_services_id=@jid; set foreign_key_checks=1;", Conn);
                    cmd2.Parameters.AddWithValue("@labf", labor_view.Rows[a].Cells[2].Value);
                    cmd2.Parameters.AddWithValue("@jid", labor_view.Rows[a].Cells[3].Value);
                    cmd2.ExecuteNonQuery();
                    Conn.Close();
                }
            }
            Conn.Open();
            MySqlCommand cmd = Conn.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select subtotal_job_order from job_order_services where job_order_id_serv_fk ='" + Job_Order_Details.jobid + "'";
            cmd.ExecuteNonQuery();
            DataTable        dt = new DataTable();
            MySqlDataAdapter da = new MySqlDataAdapter(cmd);

            da.Fill(dt);
            views.DataSource = dt;
            foreach (DataGridViewRow row in views.Rows)
            {
                if (row.IsNewRow)
                {
                    continue;
                }
                int sum = 0;
                for (int i = 0; i < views.Rows.Count; i++)
                {
                    sum += Convert.ToInt32(views.Rows[i].Cells[0].Value);
                }
                newans = sum;
            }

            string q = "set foreign_key_checks=0; update job_order set total_amount='" + newans + "' where job_order_id='" + Job_Order_Details.jobid + "'; set foreign_key_checks=1;";

            main.CUD_Statement(q);
            string q2 = "set foreign_key_checks=0; insert into job_order_payment (balance, jp_job_order_id) values('" + newans + "','" + Job_Order_Details.jobid + "');  set foreign_key_checks=1;";

            main.CUD_Statement(q2);
            Conn.Close();
            Job_Order_Details g = new Job_Order_Details();

            g.Show();
            this.Hide();
        }
Exemple #3
0
 private void released_view_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex > -1)
     {
         txtid.Text = released_view.Rows[e.RowIndex].Cells["job_order_id"].Value.ToString();
         if (released_view.Rows.Count > 0)
         {
             Job_Order_Details g = new Job_Order_Details();
             jid = txtid.Text;
             g.Show();
             this.Hide();
         }
     }
 }