private void brnAddUser_Click(object sender, EventArgs e)
 {
     try
     {
         var obj = new Person();
         var srv = new Personservices();
         if (!string.IsNullOrEmpty(txtuserid.Text.ToString()) && !string.IsNullOrEmpty(txtpass.Text.ToString()) && !string.IsNullOrEmpty(txthint.Text.ToString()) && !string.IsNullOrEmpty(txtconfrmpass.Text.ToString()))
         {
             obj.adduser_id   = txtuserid.Text.ToString();
             obj.addPass      = txtpass.Text.ToString();
             obj.addcnfrmPass = txtconfrmpass.Text.ToString();
             obj.addhint      = txthint.Text.ToString();
             srv.adduser(obj);
             MessageBox.Show("User Added Successfully");
             obj.adduser_id   = "";
             obj.addPass      = "";
             obj.addcnfrmPass = "";
             obj.addhint      = "";
         }
         else
         {
             MessageBox.Show("Enter values in all fields");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void btnAddStudent_Click(object sender, EventArgs e)
        {
            try
            {
                var srv = new Personservices();
                if (!string.IsNullOrEmpty(txtreno.Text.ToString()) && !string.IsNullOrEmpty(txtreceviedby.Text.ToString()) && !string.IsNullOrEmpty(txtstdno.Text.ToString()) && !string.IsNullOrEmpty(txtpaidfee.Text.ToString()) && !string.IsNullOrEmpty(txttotalfee.Text.ToString()))
                {
                    string s = txtreno.Text.ToString();
                    obj.f_receipt = Convert.ToDouble(s);
                    string f = txtstdno.Text.ToString();
                    obj.f_stdno = Convert.ToDouble(f);
                    string g = txtded.Text.ToString();
                    obj.f_ded = Convert.ToDouble(g);
                    string h = txttotalfee.Text.ToString();
                    obj.f_total = Convert.ToDouble(h);
                    string j = txtpaidfee.Text.ToString();
                    obj.f_paid     = Convert.ToDouble(j);
                    obj.f_received = txtreceviedby.Text.ToString();
                    obj.f_date     = dateTimePicker1.Text.ToString();
                    srv.addfees(obj);
                    MessageBox.Show("Data Entered Successfully");
                }

                else
                {
                    MessageBox.Show("Enter data in mandatory fields");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #3
0
        private void btnAddStudent_Click(object sender, EventArgs e)
        {
            try {
                var srv = new Personservices();
                if (!string.IsNullOrEmpty(RmNo.Text.ToString()) && !string.IsNullOrEmpty(txtstdnm.Text.ToString()) && !string.IsNullOrEmpty(txtvisname.Text.ToString()))
                {
                    obj.vis_rm       = RmNo.Text.ToString();
                    obj.vis_date     = vis_date.Text.ToString();
                    obj.vis_stdnt    = txtstdnm.Text.ToString();
                    obj.vis_name     = txtvisname.Text.ToString();
                    obj.vis_relation = txtvstrelation.Text.ToString();
                    obj.vis_timein   = timein.Text.ToString();
                    obj.vis_timeout  = timeout.Text.ToString();
                    obj.vis_add      = txtvisaddress.Text.ToString();
                    obj.vis_city     = txtcity.Text.ToString();

                    string s = txtvisphone.Text.ToString();
                    obj.vis_ph = Convert.ToDouble(s);
                    srv.addvisitor(obj);
                    MessageBox.Show("Data Entered Successfully");
                }

                else
                {
                    MessageBox.Show("Enter data in all mandatory fields");
                }
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
 private void btnAddStudent_Click(object sender, EventArgs e)
 {
     try {
         var srv = new Personservices();
         if (!string.IsNullOrEmpty(txteno.Text.ToString()) && !string.IsNullOrEmpty(txtemname.Text.ToString()) && !string.IsNullOrEmpty(txtemsal.Text.ToString()))
         {
             obj.emp_nam = txtemname.Text.ToString();
             obj.emp_dob = txtemdob.Text.ToString();
             obj.emp_qua = txtemqua.Text.ToString();
             obj.emp_no  = txteno.Text.ToString();
             string q = txtemsal.Text.ToString();
             obj.emp_sal = Convert.ToDouble(q);
             obj.emp_cit = txtemcit.Text.ToString();
             obj.emp_des = txtemdes.Text.ToString();
             obj.emp_add = txtemadd.Text.ToString();
             obj.emp_joi = txtemjoi.Text.ToString();
             string s = txtempho.Text.ToString();
             obj.emp_ph = Convert.ToDouble(s);
             srv.addemployee(obj);
             MessageBox.Show("Data Entered Successfully");
         }
         else
         {
             MessageBox.Show("Enter data in all mandatory fields");
         }
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
     }
 }
        private void btnAddStudent_Click(object sender, EventArgs e)
        {
            try {
                var srv = new Personservices();
                if (!string.IsNullOrEmpty(txtRmNo.Text.ToString()) && !string.IsNullOrEmpty(txtdesc.Text.ToString()) && !string.IsNullOrEmpty(txtstdname.Text.ToString()) && !string.IsNullOrEmpty(txtstdno.Text.ToString()))
                {
                    obj.s_rmno    = txtRmNo.Text.ToString();
                    obj.s_stdname = txtstdname.Text.ToString();
                    string j = txtstdno.Text.ToString();
                    obj.s_stdno = Convert.ToDouble(j);
                    obj.s_desc  = txtdesc.Text.ToString();

                    obj.s_in        = timein.Text.ToString();
                    obj.s_out       = timeout.Text.ToString();
                    obj.s_to        = to.Text.ToString();
                    obj.s_from      = from.Text.ToString();
                    obj.s_leavetype = leavetype.selectedValue.ToString();
                    srv.addstatus(obj);
                    MessageBox.Show("Data Entered Successfully");
                }

                else
                {
                    MessageBox.Show("Enter data in mandatory fields");
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
        private void btnAddStudent_Click_1(object sender, EventArgs e)
        {
            try
            { var obj = new Person();
              var srv = new Personservices();
              if (!string.IsNullOrEmpty(StdNo.Text.ToString()) && !string.IsNullOrEmpty(StdName.Text.ToString()) && !string.IsNullOrEmpty(RmNo.Text.ToString()))
              {
                  string s = StdNo.Text.ToString();
                  obj.SNo       = Convert.ToDouble(s);
                  obj.Sname     = StdName.Text.ToString();
                  obj.RmNo      = RmNo.Text.ToString();
                  obj.date      = DateTime.Now.ToString();
                  obj.Dept      = UniDept.Text.ToString();
                  obj.floor     = HFloor.Text.ToString();
                  obj.B_dt      = SDob.Text.ToString();
                  obj.B_group   = Bgrp.Text.ToString();
                  obj.Institute = InsName.Text.ToString();
                  obj.GName     = GName.Text.ToString();
                  obj.GRelation = GRelation.Text.ToString();
                  obj.GOccup    = GOccup.Text.ToString();

                  obj.email   = emai.Text.ToString();
                  obj.GAdd    = GAddress.Text.ToString();
                  obj.address = SAddress.Text.ToString();
                  string a;
                  a      = SPh.Text.ToString();
                  obj.Ph = Convert.ToDouble(a);
                  string b;
                  b          = SMobile.Text.ToString();
                  obj.mobile = Convert.ToDouble(b);
                  string c;
                  c          = Gph.Text.ToString();
                  obj.Gphone = Convert.ToDouble(c);
                  srv.addperson(obj);
                  MessageBox.Show("Data Entered Successfully");
                  obj.SNo       = 0;
                  obj.Sname     = "";
                  obj.RmNo      = "";
                  obj.date      = "";
                  obj.Dept      = "";
                  obj.floor     = "";
                  obj.B_dt      = "";
                  obj.B_group   = "";
                  obj.Institute = "";
                  obj.GName     = "";
                  obj.GRelation = "";
                  obj.GOccup    = "";

                  obj.email   = "";
                  obj.GAdd    = "";
                  obj.address = "";

                  a      = "";
                  obj.Ph = 0;

                  b          = "";
                  obj.mobile = 0;

                  c          = "";
                  obj.Gphone = 0;
              }
              else
              {
                  MessageBox.Show("Enter the values in mandatory fields");
              } }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }