protected void loginButton_Click(object sender, EventArgs e)
        {
            string centerCode = centerCodeTextBox.Text;
            string password   = passwordTextBox.Text;
            string enPassword = EncryptSHA512Managed(password);

            if (centerManager.IsCenterCodeAndPasswordExists(centerCode, enPassword))
            {
                Session["CenterId"] = centerManager.GetCenterId();
                int centerId = centerManager.GetCenterId();
                int thanaId  = centerManager.GetThanaId(centerId);
                Session["DistrictId"] = centerManager.GetDistrictId(thanaId);
                Response.Redirect("HomeCenter.aspx");
            }
            else
            {
                megLabel.Text = "Wrong centercode and password!";
            }
        }
        protected void doctorSaveButton_OnClick(object sender, EventArgs e)
        {
            doctor.Name          = nameTextBox.Text;
            doctor.Degree        = degreeTextBox.Text;
            doctor.Specialzation = specializationTextBox.Text;
            doctor.CenterId      = centerManager.GetCenterId(Session["centerCode"].ToString());

            string message = centerManager.Insert(doctor);

            label1.Text = message;
        }
示例#3
0
        protected void saveButton_Click(object sender, EventArgs e)
        {
            DataTable dt = (DataTable)ViewState["MedicineList"];

            foreach (DataRow row in dt.Rows)
            {
                CenterMedicineRelation aCenterMedicineRelation = new CenterMedicineRelation();
                aCenterMedicineRelation.CenterId         = centerManager.GetCenterId(centerDropDownList.Text, 0);
                aCenterMedicineRelation.MedicineId       = aMedicineManager.GetMedicineIdByName(row["name"].ToString());
                aCenterMedicineRelation.MedicineQuantity = Convert.ToInt32(row["quantity"].ToString());
                aCenterMedicineRelation.Date             = DateTime.Now.ToString();

                if (aCenterMedicineRelationManager.IsExist(aCenterMedicineRelation) == false)
                {
                    aCenterMedicineRelationManager.Insert(aCenterMedicineRelation);
                }
                else
                {
                    aCenterMedicineRelationManager.AddMedicine(aCenterMedicineRelation);
                }
            }
        }
        protected void loginButton_Click(object sender, EventArgs e)
        {
            Center aCenter = new Center();

            aCenter.Code     = codeTextBox.Text;
            aCenter.Password = passwordTextBox.Text;
            if (aCenter.Password == "")
            {
                massegeLabel.Text = "Error";
            }
            massegeLabel.Text = aCenter.Password;

            if (aCenterManager.AuthenticateCenterLogin(aCenter.Code, aCenter.Password) == true)
            {
                //massegeLabel.Text = "";
                Session["center_code"] = aCenter.Code;
                Session["center_id"]   = aCenterManager.GetCenterId(aCenter.Code, 1);
                Response.Redirect("CenterUI/DoctorEntryUI.aspx");
            }
            else
            {
                massegeLabel.Text = "Incorrect Center Code OR password";
            }
        }
示例#5
0
        public void GetDataLoadedInGridView()
        {
            DataTable dt = new DataTable();

            string code = Session["value"].ToString();

            int centerId = centerManager.GetCenterId(code);
            List <MedicineQuantity> medicineList = medicineManager.GetMedicineQuantities(centerId);

            dt.Columns.Add("Medicine Name", typeof(string));
            dt.Columns.Add("Present Stock", typeof(string));



            foreach (MedicineQuantity quantity in medicineList)
            {
                DataRow dr = dt.NewRow();
                dr["Medicine Name"] = quantity.Name;
                dr["Present Stock"] = quantity.Quantity;
                dt.Rows.Add(dr);
            }
            medicineStockGridView.DataSource = dt;
            medicineStockGridView.DataBind();
        }
        protected void addTreatmentButton_OnClick(object sender, EventArgs e)
        {
            /* Voter Information */

            voter.VoterId = voterIdTextBox.Text;
            voter.Name    = nameTextBox.Text;
            voter.Address = addressTextBox.Text;
            voter.Age     = int.Parse(ageTextBox.Text);


            string code = Session["centerCode"].ToString();

            voter.CenterId = centerManager.GetCenterId(code);


            /* Treatment */
            treatment.DiseaseName      = diseaseDropDownList.SelectedItem.Text;
            treatment.MedicineName     = medicineDropDownList.SelectedItem.Text;
            treatment.Dose             = doseDropDownList.SelectedItem.Text;
            treatment.Observation      = observationTextBox.Text;
            treatment.Date             = dateTextBox.Text;
            treatment.DoctorId         = int.Parse(doctornameDropDownList.SelectedValue.ToString());
            treatment.MedicineQuantity = int.Parse(quantitygivenTextBox.Text);
            treatment.Note             = noteTextBox.Text;
            string voterid = voterIdTextBox.Text;

            if (beforeMealRadioButton.Checked)
            {
                treatment.Schedule = beforeMealRadioButton.Text;
            }
            else
            {
                treatment.Schedule = afterMealRadioButton.Text;
            }



            if (ViewState["insert"] == null)
            {
                CreateColumnInGridView();
            }
            else
            {
                dt = (DataTable)ViewState["insert"];

                DataRow dr = dt.NewRow();
                dr["Disease"]           = treatment.DiseaseName;
                dr["Medicine"]          = treatment.MedicineName;
                dr["Dose"]              = treatment.Dose;
                dr["Before/After Meal"] = treatment.Schedule;
                dr["Qyt. Given"]        = treatment.MedicineQuantity;
                dr["Note"]              = treatment.Note;


                dt.Rows.Add(dr);

                ViewState["insert"]          = dt;
                treatmentGridView.DataSource = dt;
                treatmentGridView.DataBind();

                treatmentpdf.Enabled = true;
            }
        }