示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Myserver.Repairer re     = new Myserver.Repairer();
            Myserver.Service1 server = new Myserver.Service1();
            int  id   = int.Parse(txtrexist.Text);
            bool spec = true;

            re = server.Search_Repairer(id, spec);
            Utility.selected_repairer = re;
            if (comboBox1.Text == "Check Account")
            {
                frmadmin_checkAccountR frm = new frmadmin_checkAccountR();
                this.Hide();
                frm.Show();
            }
            if (comboBox1.Text == "Delete Account")
            {
                server.del_repairer(id, spec);
                MessageBox.Show("Account Deleted!");
            }
            if (comboBox1.Text == "Issue Warning")
            {
                MessageBox.Show("Warning Issued!");
            }
        }
示例#2
0
        private void cmdproceed_Click(object sender, EventArgs e)
        {
            bool valid = false;

            Myserver.Service1        server = new Myserver.Service1();
            List <Myserver.Repairer> list   = server.Get_repairers_list().ToList <Myserver.Repairer>();

            foreach (Myserver.Repairer r in list)
            {
                if (txtrepair.Text == r.Id.ToString())
                {
                    {
                        valid = true;
                        Utility.curr_repairer = r;
                        break;
                    }
                }
            }
            if (valid == true)
            {
                MessageBox.Show("Login Successful!");
                frmrepairPortal frm = new frmrepairPortal();
                this.Hide();
                frm.Show();
            }
            else
            {
                MessageBox.Show("Invalid!");
            }
            txtrepair.Hide();
            txtrepair.Text = "Enter Passcode!";
            cmdrepairid.Hide();
        }
示例#3
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (txtcproblem.Text == "Enter Problem" || txtcdevice.Text == "Enter Device")
            {
                MessageBox.Show("Enter Problem and Device first!");
            }
            else
            {
                Myserver.Service1 server = new Myserver.Service1();
                bool            done;
                bool            pass;
                Myserver.client edi = new Myserver.client();
                edi         = Utility.curr_login_client;
                edi.Device  = txtcdevice.Text;
                edi.Problem = txtcproblem.Text;
                Utility.curr_login_client = edi;
                server.Assign_client(Utility.curr_login_client, out done, out pass);
                if (done == true)
                {
                    MessageBox.Show("Your Request has been sent!");
                }
                else
                {
                    MessageBox.Show("System Failure!");
                }
            }

            /*Myserver.client c = new Myserver.client();
             * Myserver.Service1 server = new Myserver.Service1();
             * List<Myserver.client> list = server.Get_clients_list().ToList<Myserver.client>();*/
        }
示例#4
0
        private void cmddone_Click(object sender, EventArgs e)
        {
            bool x, id = true;

            Myserver.Service1      server = new Myserver.Service1();
            List <Myserver.client> list   = server.Get_client_list().ToList <Myserver.client>();

            if (comboBox1.Text == "Completed")
            {
                bool stat = true;
                Utility.curr_repairer.Account = Utility.curr_repairer.Account + 300;

                server.remove_order(Utility.selected_client, Utility.curr_repairer.Id, stat);
                server.edit_repairer(Utility.curr_repairer, out x, out id);

                BindingSource S = new BindingSource();
                S.DataSource             = null;
                dataGridView2.DataSource = S;
                MessageBox.Show("300Rs is added to your account!");
            }
            if (comboBox1.Text == "Delete")
            {
                /*foreach(Myserver.client c in Utility.curr_repairer.Orders1)
                 * {
                 *  if(txtid.Text == c.Id_client.ToString())
                 *  {
                 *      server.remove_order(c, Utility.curr_repairer.Id, id);
                 *  }
                 * }*/
                BindingSource S = new BindingSource();
                S.DataSource             = null;
                dataGridView2.DataSource = S;

                MessageBox.Show("Client is removed from Record!");
            }
            if (comboBox1.Text == "Fix Appointment")
            {
                foreach (Myserver.client c in list)
                {
                    if (c.Id_client.ToString() == txtid.Text)
                    {
                        bool stat = true;
                        server.fix_app(c, Utility.curr_repairer.Id, stat);
                        MessageBox.Show("Appointment Fixed!");
                    }
                }
            }
        }
示例#5
0
        private void cmdselect_Click(object sender, EventArgs e)
        {
            Myserver.Service1      server = new Myserver.Service1();
            List <Myserver.client> list   = server.Get_client_list().ToList <Myserver.client>();

            foreach (Myserver.client c in list)
            {
                if (c.Id_client.ToString() == txtid.Text)
                {
                    BindingSource S = new BindingSource();
                    S.DataSource             = c;
                    dataGridView2.DataSource = S;
                    Utility.selected_client  = c;
                }
            }
        }
示例#6
0
        private void button3_Click(object sender, EventArgs e)
        {
            Myserver.Service1 server = new Myserver.Service1();
            bool done;
            bool pass;

            server.Assign_client(Utility.curr_reg_client, out done, out pass);
            if (done == true)
            {
                MessageBox.Show("Your Request has been sent!");
            }
            else
            {
                MessageBox.Show("System Failure!");
            }
        }
示例#7
0
 private void button2_Click(object sender, EventArgs e)
 {
     Myserver.Service1 server = new Myserver.Service1();
     Myserver.Admin    admin  = server.get_admin();
     if (txtadmin.Text == admin.Id)
     {
         frmadmin frm = new frmadmin();
         this.Hide();
         frm.Show();
         txtadmin.Hide();
         cmdadminId.Hide();
     }
     else
     {
         MessageBox.Show("Invalid!");
     }
     txtadmin.Hide();
     cmdadminId.Hide();
 }
示例#8
0
 private void cmdcreg_Click(object sender, EventArgs e)
 {
     if (txtcname.Text == "" || txtccell.Text == "" || txtcaddress.Text == "" || txtcdevice.Text == "" || txtcmail.Text == "" || txtcproblem.Text == "")
     {
         MessageBox.Show("Enter all the entries!");
     }
     else
     {
         if (!txtcname.Text.Any(Char.IsLetter) || !txtcaddress.Text.Any(Char.IsLetter) || !txtcproblem.Text.Any(Char.IsLetter) || !txtcdevice.Text.Any(Char.IsLetter) || !txtcmail.Text.Any(Char.IsLetter)) //agr letter nahi hai
         {
             MessageBox.Show("Name,Address,Problem,Device & Mail should be Letters!");
         }
         else
         {
             if (txtccell.Text.Any(Char.IsLetter))
             {
                 MessageBox.Show("Phone Number Should be Digits!");
             }
             else
             {
                 Myserver.Service1 server = new Myserver.Service1();
                 int  x;
                 bool ok = true;
                 server.Add_Clients(txtcname.Text, txtcproblem.Text, txtcaddress.Text, txtccell.Text, txtcdevice.Text, txtcmail.Text, out x, out ok);
                 MessageBox.Show("User has been Registered!");
                 List <Myserver.client> list = server.Get_client_list().ToList <Myserver.client>();
                 foreach (Myserver.client c in list)
                 {
                     if (c.Id_client == x)
                     {
                         Utility.curr_reg_client = c;
                         break;
                     }
                 }
                 lblid.Text = x.ToString();
                 lblid.Show();
                 lblidtext.Show();
                 cmdrepair.Show();
             }
         }
     }
 }
示例#9
0
 private void button2_Click(object sender, EventArgs e)
 {
     Myserver.Service1 server = new Myserver.Service1();
     if (txtadmin.Text == server.get_admin_id())
     {
         txtadmin.Hide();
         txtadmin.Text = "Enter Passcode!";
         cmdadminId.Hide();
         frmadmin frm = new frmadmin();
         this.Hide();
         frm.Show();
     }
     else
     {
         MessageBox.Show("Invalid!");
     }
     txtadmin.Hide();
     txtadmin.Text = "Enter Passcode!";
     cmdadminId.Hide();
 }
示例#10
0
        private void button3_Click(object sender, EventArgs e)
        {
            Myserver.Service1 server = new Myserver.Service1();
            bool done;
            bool pass;

            server.Assign_client(Utility.curr_login_client, out done, out pass);
            if (done == true)
            {
                MessageBox.Show("Your Request has been sent!");
            }
            else
            {
                MessageBox.Show("System Failure!");
            }

            /*Myserver.client c = new Myserver.client();
             * Myserver.Service1 server = new Myserver.Service1();
             * List<Myserver.client> list = server.Get_clients_list().ToList<Myserver.client>();*/
        }
示例#11
0
        private void frmhome_Load(object sender, EventArgs e)
        {
            txtrepair.Hide();
            txtadmin.Hide();
            cmdrepairid.Hide();
            cmdadminId.Hide();
            Utility.curr_repairer = null;
            int  x;
            bool id = true, start;

            Myserver.Service1 server = new Myserver.Service1();
            server.start(out start, out id);
            if (start == true)
            {
                server.Add_Clients("Junaid Ali", "LCD damage", "Johar Town Lahore", "03216964902", "Laptop", "Johhny424@gmail", out x, out id);
                server.Add_Clients("Adnan Ashiq", "Charging Jeck", "Mumtaz hall UET Lahore", "03022149193", "Mobile", "AdnanAashiq457@gmail", out x, out id);
                server.Add_Clients("Rafay", "Battery Dead", "Garden Town Lahore", "03217353212", "IPhone", "Rafay420@gmail", out x, out id);
                server.Add_Repairer("Sohaib Arif", "Mumtaz HAll UET lahore", "03054238171", "352027362810662", 1, id);
                server.Add_Repairer("Bilal Sheikh", "Muslim Town Lahore", "032198761234", "35202312009662", 2, id);
            }
        }
示例#12
0
        private void cmdclogin_Click(object sender, EventArgs e)
        {
            Myserver.Service1 server = new Myserver.Service1();
            bool isvalid;
            bool passed;
            bool specified = true;
            int  id        = int.Parse(txtcid.Text);

            server.is_login(id, specified, out isvalid, out passed);
            txtcid.Text = id.ToString();
            if (isvalid == true)
            {
                MessageBox.Show("Login Successful!");
                List <Myserver.client> list = server.Get_client_list().ToList <Myserver.client>();
                foreach (Myserver.client c in list)
                {
                    if (c.Id_client == id)
                    {
                        Utility.curr_login_client = c;
                        break;
                    }
                }
                txtcname.Text    = Utility.curr_login_client.Name_client;
                txtcaddress.Text = Utility.curr_login_client.Address;
                txtccell.Text    = Utility.curr_login_client.Cell_client;
                txtcmail.Text    = Utility.curr_login_client.Mail;
                txtcproblem.Show();
                txtcdevice.Show();
                cmdfeedback.Show();
                txtcname.Show();
                txtcaddress.Show();
                txtccell.Show();
                txtcmail.Show();
                cmdrepair.Show();
            }
            else
            {
                MessageBox.Show("Invalid Login!");
            }
        }
示例#13
0
        private void cmdpay_Click(object sender, EventArgs e)
        {
            bool asd = false;
            bool x, id = true;

            Myserver.Service1 server = new Myserver.Service1();
            if (txtacountnmbr.Text.Any(Char.IsLetter) || txtamount.Text.Any(Char.IsLetter))
            {
                MessageBox.Show("Account & Amount Number be Digits!");
            }
            else
            {
                /*List<Myserver.Repairer> list = server.Get_repairers_list().ToList<Myserver.Repairer>();
                 * foreach(Myserver.Repairer r in list)
                 * {
                 *  if(r.Appointment == Utility.curr_login_client)
                 *  {
                 *      asd = true;
                 *      int a = int.Parse(txtamount.Text);
                 *      r.Account = r.Account + a;
                 *      server.edit_repairer(r, out x, out id);
                 *      txtamount.Text = a.ToString();
                 *
                 *  }
                 * }*/
                bool l = true;
                int  a = int.Parse(txtamount.Text);
                server.pay(Utility.curr_login_client, a, l, out asd, out id);
                txtamount.Text = a.ToString();
            }
            if (asd == false)
            {
                MessageBox.Show("You are not Appointed by any repirer yet!");
            }
            this.Hide();
            frmregister_user frm     = new frmregister_user();

            frm.Show();
        }
示例#14
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            Myserver.Service1        server = new Myserver.Service1();
            List <Myserver.Repairer> list   = server.Get_repairers_list().ToList <Myserver.Repairer>();

            if (txtid.Text == "" || txtid.Text == "Enter Id to select Order")
            {
                MessageBox.Show("Page can not be refreashed!");
            }
            else
            {
                foreach (Myserver.Repairer r in list)
                {
                    if (r.Id == Utility.curr_repairer.Id)
                    {
                        BindingSource S = new BindingSource();
                        S.DataSource             = r.Orders;
                        dataGridView1.DataSource = S;
                        lblaccount.Text          = r.Account.ToString();
                        break;
                    }
                }
            }
        }
示例#15
0
        private void cmdcreg_Click(object sender, EventArgs e)
        {
            if (txtrname.Text == "" || txtrcell.Text == "" || txtraddress.Text == "" || txtrid.Text == "" || txtrcnic.Text == "")
            {
                MessageBox.Show("Enter all the entries!");
            }
            else
            {
                if (!txtrname.Text.Any(Char.IsLetter) || !txtraddress.Text.Any(Char.IsLetter))  //agr letter nahi hai
                {
                    MessageBox.Show("Name & Address should be Letters!");
                }
                else
                {
                    if (txtrcell.Text.Any(Char.IsLetter) || txtrcnic.Text.Any(Char.IsLetter))
                    {
                        MessageBox.Show("Phone & Cnic Number Should be Digits!");
                    }
                    else
                    {
                        Myserver.Service1 server = new Myserver.Service1();
                        bool ok = true;
                        int  id = int.Parse(txtrid.Text);
                        server.Add_Repairer(txtrname.Text, txtraddress.Text, txtrcell.Text, txtrcnic.Text, id, ok);
                        txtrid.Text = id.ToString();
                        MessageBox.Show("Repairer Registered!");


                        /*server.(txtcname.Text, txtcproblem.Text, txtcaddress.Text, txtccell.Text, txtcdevice.Text, txtcmail.Text, out x, out ok);
                         * MessageBox.Show("User has been Registered!");
                         * txtcid.Text = x.ToString();
                         * txtcid.Show();*/
                    }
                }
            }
        }
示例#16
0
 private void frmadmin_Load(object sender, EventArgs e)
 {
     Myserver.Service1 server = new Myserver.Service1();
     lbladminname.Text = server.get_admin_name();
 }