Example #1
0
        private void cal_Click(object sender, EventArgs e)
        {
            Expence exp1 = new Expence();

            if (IsValidate())
            {
                exp1.MONTH       = tm.Text;
                exp1.DECPURCHASE = tpd.Text;
                exp1.TOTALSAL    = Convert.ToInt32(ts.Text);
                exp1.ELECBILL    = Convert.ToInt32(teb.Text);
                exp1.WATERBILL   = Convert.ToInt32(twb.Text);
                exp1.MAINTCOST   = Convert.ToInt32(tmain.Text);
                exp1.PURCHASES   = Convert.ToInt32(tp.Text);
            }
            exp1.TOTAL = exp1.TOTALSAL + exp1.ELECBILL + exp1.WATERBILL + exp1.MAINTCOST + exp1.PURCHASES;
            total.Text = Convert.ToString(exp1.TOTAL);
        }
Example #2
0
        private void tsave_Click(object sender, EventArgs e)
        {
            try
            {
                Expence exp2 = new Expence();



                string        connString = ConfigurationManager.ConnectionStrings["testdb"].ConnectionString;
                SqlConnection conn       = new SqlConnection(connString);

                SqlCommand cmd = new SqlCommand("AddExpence", conn);
                cmd.CommandType = CommandType.StoredProcedure;


                exp2.MONTH       = tm.Text;
                exp2.TOTALSAL    = Convert.ToInt32(ts.Text);
                exp2.ELECBILL    = Convert.ToInt32(teb.Text);
                exp2.WATERBILL   = Convert.ToInt32(twb.Text);
                exp2.MAINTCOST   = Convert.ToInt32(tmain.Text);
                exp2.DECPURCHASE = tpd.Text;
                exp2.PURCHASES   = Convert.ToInt32(tp.Text);
                exp2.TOTAL       = Convert.ToInt32(total.Text);


                cmd.Parameters.Add("@m", SqlDbType.VarChar, 50).Value    = exp2.MONTH;
                cmd.Parameters.Add("@sal", SqlDbType.Int).Value          = exp2.TOTALSAL;
                cmd.Parameters.Add("@eb", SqlDbType.Int).Value           = exp2.ELECBILL;
                cmd.Parameters.Add("@wb", SqlDbType.Int).Value           = exp2.WATERBILL;
                cmd.Parameters.Add("@main", SqlDbType.Int).Value         = exp2.MAINTCOST;
                cmd.Parameters.Add("@pdes", SqlDbType.VarChar, 50).Value = exp2.DECPURCHASE;
                cmd.Parameters.Add("@p", SqlDbType.Int).Value            = exp2.PURCHASES;
                cmd.Parameters.Add("@total", SqlDbType.Int).Value        = exp2.TOTAL;

                conn.Open();
                cmd.ExecuteNonQuery();
                conn.Close();

                MessageBox.Show("Data is Saved Successfuly!");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error! " + ex.Message);
            }
        }
Example #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new trn());
            //Application.Run(new tfetch());
            //Application.Run(new menu());
            Application.Run(new login());
            // Application.Run(new Pable());
            //Application.Run(new Expencefetch());



            Trainer trainer1 = new Trainer();
            Expence p1       = new Expence();

            p1.agert(trainer1);


            Employee employee1 = new Employee();

            p1.agere(employee1);
        }