Beispiel #1
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);
            }
        }
Beispiel #2
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();*/
                    }
                }
            }
        }