protected void Page_Load(object sender, EventArgs e)
 {
     logIn = (LogIn)Session["User"];
     centercode = logIn.CenterCode;
     Center aCenter = centerManager.GetCenterIdbyCenterCode(centercode);
     centerName.Text = aCenter.Name;
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         logIn = (LogIn)Session["User"];
         centercode = logIn.CenterCode;
         Center aCenter = centerManager.GetCenterIdbyCenterCode(centercode);
         CenterId = aCenter.Id;
         centerName.Text = aCenter.Name;
         centerName1.Text = aCenter.Name;
         countDoctorLabel.Text = doctorManager.CountDoctor(CenterId).ToString();
         countPatientLabel.Text = centerManager.CountPatient(CenterId).ToString();
     }
 }
 public int CompareCenterCodeAndPassword(LogIn userLogIn)
 {
     if (centerGateway.Match(userLogIn.CenterCode))
     {
         string pass = userLogIn.Password;
         string password = Decryptdata(centerGateway.GetPassword(userLogIn.CenterCode));
         if (pass==password)
         {
             return 1;
         }
         else
         {
             return -1;
         }
     }
     else
     {
         return 0;
     }
 }
 protected void logInButton_Click(object sender, EventArgs e)
 {
     LogIn userLogIn = new LogIn();
     userLogIn.CenterCode = centerCodeTextBox.Text;
     userLogIn.Password = passwordTextBox.Text;
     int msg = centerManager.CompareCenterCodeAndPassword(userLogIn);
     if (msg==1)
     {
         Session["User"] = userLogIn;
         Response.Redirect("~/UI/index.aspx");
     }
     else if (msg==0)
     {
         messageLabel.Text = "Center code does not found";
     }
     else if (msg==-1)
     {
         messageLabel.Text = "Password does not match";
     }
     else
     {
         messageLabel.Text = "Enter Center code & Password Correctly";
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            logIn = (LogIn)Session["User"];
            centercode = logIn.CenterCode;
            Center aCenter = centerManager.GetCenterIdbyCenterCode(centercode);
            centerName.Text = aCenter.Name;
            centerId = aCenter.Id;
            if (!IsPostBack)
            {

                medicineDropDownList.DataSource = medicineManager.GetAllMedicineInfobyCenterId(centerId);
                medicineDropDownList.DataTextField = "Name";
                medicineDropDownList.DataValueField = "Id";
                medicineDropDownList.DataBind();

                diseaseDropDownList.DataSource = diseasesManager.GetAllDiseases();
                diseaseDropDownList.DataTextField = "Name";
                diseaseDropDownList.DataValueField = "Id";
                diseaseDropDownList.DataBind();

                doctorDropDownList.DataSource = doctorManager.GetAllDoctor(centerId);
                doctorDropDownList.DataTextField = "Name";
                doctorDropDownList.DataValueField = "Id";
                doctorDropDownList.DataBind();

                ListItem medicineItem = new ListItem("Select Medicine", "-1");
                medicineDropDownList.Items.Insert(0, medicineItem);

                ListItem diseaseItem = new ListItem("Select Disease", "-1");
                diseaseDropDownList.Items.Insert(0, diseaseItem);

                ListItem doctorItem = new ListItem("Select Doctor", "-1");
                doctorDropDownList.Items.Insert(0, doctorItem);

                ListItem doseItem = new ListItem("Select One", "-1");
                doesDropDownList.Items.Insert(0, doseItem);
            }
        }