Ejemplo n.º 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            Service1 s = new Service1();
            bool     valid;
            bool     check;

            if (rbtnDesigner.Checked)
            {
                s.LoginDesigner(txtUsernsme.Text, txtPassword.Text, out valid, out check);
                if (valid)
                {
                    MessageBox.Show("logged in");
                    Designer d = Designer.GetInstance();
                    d.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("invalid");
                }
            }
            else if (rbtnAdmin.Checked)
            {
                s.LoginAdmin(txtUsernsme.Text, txtPassword.Text, out valid, out check);
                if (valid)
                {
                    MessageBox.Show("logged in");
                    Admin d = Admin.GetInstance();
                    d.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("invalid");
                }
            }
            else
            {
                MessageBox.Show("Select Admin or Designer");
            }
        }
Ejemplo n.º 2
0
        private void btnUpload_Click(object sender, EventArgs e)
        {
            Service1 s = new Service1();
            // s.AddDesignInDL(pbSelectedImage.Image);

            /*
             * TcpClient mTcpClient = new TcpClient();
             *
             * Bitmap tImage = new Bitmap(@"C:\Users\Milan\Downloads\guitarstill.gif");
             *
             * byte[] bStream;
             * //if (string.IsNullOrEmpty(tbPayload.Text)) return;
             * try
             * {
             *  bStream = imageToByteArray(tImage);
             *  if (mTcpClient != null)
             *  {
             *      if (mTcpClient.Client.Connected)
             *      {
             *          mTcpClient.GetStream().BeginWrite(imageToByteArray(tImage), 0, imageToByteArray(tImage).Length, onCompleteWriteToServer, mTcpClient);
             *      }
             *  }
             * }
             * catch (Exception exc)
             * {
             *  MessageBox.Show(exc.Message);
             * }
             *
             *
             * }
             * public byte[] imageToByteArray(System.Drawing.Image imageIn)
             * {
             * MemoryStream ms = new MemoryStream();
             * imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
             * //richTextBox1.Text = ms.ToArray().ToString();
             * return ms.ToArray();
             * }//Within another method:
             */
        }