Exemple #1
0
        //Main Aktion, Key_Down alles starten
        private void Game_KeyDown(object sender, KeyEventArgs e)
        {
            Random.Start();
            MonstersMove.Start();
            Label7.Hide();

            string Geschwindgkeit = "15";
            int    PositionX      = Tank.Location.X;
            int    PositionY      = Tank.Location.Y;
            int    PositionLabelX = Bullet1.Location.X;
            int    PositionLabelY = Bullet1.Location.Y;

            if (e.KeyCode == Keys.Right && PositionX + Tank.Width < this.Width - 20)
            {
                Tank.Location = new Point(PositionX += Convert.ToInt32(Geschwindgkeit), Tank.Location.Y);
                if (PositionLabelY == 525)
                {
                    Bullet1.Location = new Point(PositionLabelX += Convert.ToInt32(Geschwindgkeit), Bullet1.Location.Y);
                }
            }

            if (e.KeyCode == Keys.Left && PositionX > 15)
            {
                Tank.Location = new Point(PositionX -= Convert.ToInt32(Geschwindgkeit), Tank.Location.Y);
                if (PositionLabelY == 525)
                {
                    Bullet1.Location = new Point(PositionLabelX -= Convert.ToInt32(Geschwindgkeit), Bullet1.Location.Y);
                }
            }
            PositionLabelY = Bullet1.Location.Y;

            if (e.KeyCode == Keys.Space &&
                tankBullet == null)
            {
                bool ID = false;

                tankBullet = new Bullet(new Point(PositionX += 24, PositionY), ID);
                Controls.Add(tankBullet.Label);
                panel2.BringToFront();
            }
            if (Over && e.KeyCode == Keys.Space)
            {
                GameOver();
            }
        }
Exemple #2
0
        protected void patientSaveButton_Click(object sender, EventArgs e)
        {
            DateTime localDate   = DateTime.Now;
            var      dateAndTime = DateTime.Now;
            var      date        = dateAndTime.Date;


            aPatient.PatientName = patientNameTextBox.Text;
            aPatient.DateofBirth = dateOfBirthTextBox.Text;
            aPatient.MobileNo    = mobileNoTextBox.Text;
            aPatient.BillNo      = "Bill No-" + localDate.ToString("yyMMddHHmmss");
            aPatient.TotalFee    = Convert.ToDouble(totalFeeTextBox.Text);
            aPatient.DateofIssue = date.ToString("yyyy-MM-dd");
            aPatient.Status      = "N";



            patientAddButton.Enabled  = false;
            patientSaveButton.Enabled = false;

            timeLabel.Text = aPatientManager.SavePatient(aPatient);

            aPatient.PatientId = aPatientManager.GetPatientId(aPatient.BillNo);

            List <Patient> myPatient1 = (List <Patient>)ViewState["List"];

            timeLabel.Text = aPatientManager.InsertTestRequest(myPatient1, aPatient.PatientId);



            //pdf
            Response.ContentType = "application/pdf";
            Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.pdf");
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            StringWriter   swr    = new StringWriter();
            HtmlTextWriter htmlwr = new HtmlTextWriter(swr);

            patientGridView.AllowPaging = false;
            List <Patient> myPatient = GetGridViewListForPatient1();

            patientGridView.DataSource = myPatient;
            patientGridView.DataBind();



            Label10.Text = " " + aPatient.BillNo + "";
            Label7.Text  = "NAME : " + patientNameTextBox.Text + "------";
            Label8.Text  = "Date of Birth : " + dateOfBirthTextBox.Text + "------";
            Label9.Text  = "Mobile Number : " + mobileNoTextBox.Text + "";

            Label11.Text = "_______________________________________________________________________________";
            Label12.Text = " ...................................................................................................Total Fee :" + totalFeeTextBox.Text + "";
            Label13.Text = "Issued Date: " + aPatient.DateofIssue + "........................................................................................\n";


            Label13.RenderControl(htmlwr);
            Label10.RenderControl(htmlwr);
            Label7.RenderControl(htmlwr);
            Label8.RenderControl(htmlwr);
            Label9.RenderControl(htmlwr);


            //ShowGridViewForPatient();
            //timeLabel.RenderControl(htmlwr);

            patientGridView.RenderControl(htmlwr);
            Label11.RenderControl(htmlwr);
            Label12.RenderControl(htmlwr);

            patientSaveButton.Enabled = false;

            StringReader srr = new StringReader(swr.ToString());

            Document   pdfdoc     = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
            HTMLWorker htmlparser = new HTMLWorker(pdfdoc);

            PdfWriter.GetInstance(pdfdoc, Response.OutputStream);
            pdfdoc.Open();
            htmlparser.Parse(srr);
            pdfdoc.Close();
            Response.Write(pdfdoc);
            Response.End();
        }