Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Doctor d = (Doctor)Session["doctor"];
            HelloLabel.Text = d.CDoctorName;
            Pharmcy.PharmcyWS webser = new Pharmcy.PharmcyWS();
            DataSet           ds     = webser.GetMedinceNameAndId();
            List <ListItem>   LI     = GetAllData.getListItemsForDDL(ds, "Medicine");
            foreach (ListItem l in LI)
            {
                MedicineNameDDL.Items.Add(l);
            }
            MedicineNameDDL.DataBind();

            UserService us = new UserService();
            ds = us.GetUserNameAndId();
            LI = GetAllData.getListItemsForDDL(ds, "User");
            foreach (ListItem l in LI)
            {
                UserNameDDL.Items.Add(l);
            }
            UserNameDDL.DataBind();
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //put the exit button in the menu
        //
        //EXIT BUTTON
        //the exit button will delete the user shopping bag(set the value to be null)
        //and doesnt change the current stock of the medicine.
        //
        //do a method that rrecives object, the session value of myShoppingbag will be an object
        //and a shopping bag variable.
        if (!Page.IsPostBack)
        {
            if (Session["myShoppingBag"] == null)
            {
                //create shopping list
                Session["myShoppingBag"] = new ShoppingBag();
            }
            else
            {
                myShoppingBag = (ShoppingBag)Session["myShoppingBag"];
            }
            if (Session["presList"] == null)
            {
                Session["presList"] = new List <DataSet>();
            }
            else
            {
                presList = (List <DataSet>)Session["presList"];
            }

            //put the catagorys and the producers in the DDL
            Pharmcy.PharmcyWS webser = new Pharmcy.PharmcyWS();
            DataSet           pro = webser.GetProducer(), cat = webser.GetCatagory();
            List <ListItem>   proList = GetAllData.getListItemsForDDL(pro, "MedicineProducer");
            List <ListItem>   catList = GetAllData.getListItemsForDDL(cat, "MedicineCatagory");
            foreach (ListItem l in proList)
            {
                ProducerDDL.Items.Add(l);
            }
            foreach (ListItem l in catList)
            {
                DropDownListMedicineCatagory.Items.Add(l);
            }
        }
        CheckoutButton.Visible = true;
        SeeShoppingBag.Visible = true;
        User u = (User)Session["user"];

        if (u == null)
        {
            CheckoutButton.Visible = false;
            SeeShoppingBag.Visible = false;
        }
    }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         UserService     us    = new UserService();
         DataSet         ds    = us.GetCity();
         List <ListItem> list  = GetAllData.getListItemsForDDL(ds, "City");
         int             index = 0;
         foreach (ListItem l in list)
         {
             if (index != 1)
             {
                 CityList.Items.Add(l);
             }
             index++;
         }
     }
 }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         User u = (User)Session["user"];
         HelloLabel.Text = u.CUserName;
         DoctorService   docser = new DoctorService();
         DataSet         ds     = docser.GetSpecailty();
         List <ListItem> list   = GetAllData.getListItemsForDDL(ds, "Speciality");
         SpecailtyDropDownList.Items.Clear();
         foreach (ListItem l in list)
         {
             SpecailtyDropDownList.Items.Add(l);
         }
         SpecailtyDropDownList.DataBind();
         GetAllData.VacationsForDoctor();
     }
 }
Exemplo n.º 5
0
    protected void WhoDDL_SelectedIndexChanged(object sender, EventArgs e)
    {
        DoctorIdL.Visible = false;
        DoctorNameDropDownList.Visible = false;
        DataSet         ds;
        List <ListItem> list = new List <ListItem>();
        int             x    = WhoDDL.SelectedIndex;

        if (x == 0)
        {
            WhoValid.Text = "לא בחרת";
            return;
        }
        else if (x == 1)
        {
            //doctor
            Session["adress"] = "doctor";
            DoctorService docser = new DoctorService();
            DoctorNameDropDownList.Items.Clear();
            ds   = docser.GetDoctorName("");
            list = GetAllData.getListItemsForDDL(ds, "Doctor");
        }
        else if (x == 2)
        {
            //manager
            Session["adress"] = "manager";
            ManagerService ms = new ManagerService();
            ds = ms.GetManager();
            DoctorNameDropDownList.Items.Clear();
            list = GetAllData.getListItemsForDDL(ds, "Manager");
        }
        //add the listitems to the dropdown list
        foreach (ListItem l in list)
        {
            DoctorNameDropDownList.Items.Add(l);
        }
        DoctorNameDropDownList.DataBind();
        DoctorNameDropDownList.Visible = true;
        DoctorIdL.Visible = true;
    }
Exemplo n.º 6
0
    protected void SpecailtyDropDownList_SelectedIndexChanged(object sender, EventArgs e)
    {
        /*
         * לעשות שאילתה שלפי הקטגוריה שנבחרה מציגה את הרופאים
         * לעשות feedback
         * לשמור בענן את הקטגוריה שנבחרה
         */

        //init

        int    docSpec = Convert.ToInt32(SpecailtyDropDownList.SelectedValue);
        string s       = " where DoctorIsOnVacation=false and DoctorSpecailty=" + docSpec;

        DoctorService docser = new DoctorService();
        DataSet       ds     = docser.GetDoctorName(s);

        if (ds.Tables[0].Rows.Count > 0)
        {
            DoctorDropDownList.Visible = true;
            Label4.Visible             = true;
            List <ListItem> list = GetAllData.getListItemsForDDL(ds, "Doctor");
            DoctorDropDownList.Items.Clear();
            foreach (ListItem l in list)
            {
                DoctorDropDownList.Items.Add(l);
            }
            DoctorDropDownList.DataBind();
            Session["Spec"] = docSpec;
        }
        else
        {
            SpecalityValid.Visible = true;
            AppHour.Visible        = false;
            SubmitButton.Visible   = false;
            ResetButton.Visible    = false;
            DateTB.Visible         = false;
            Label6.Visible         = false;
            Response.Write("<script>alert('אין רופאים תחת התמחות זו')</script>");
        }
    }