Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        User u = (User)Session["user"];

        HelloLabel.Text = u.CUserName;
        GetAllData.VacationsForDoctor();
        GetAllData.Appointment();
        AppointmentService appser = new AppointmentService();
        string             s = "", tables = "Apointment,Doctors,Speciality,Hours,Days";

        s                 = "SELECT ApointmentId,ApointmentDate,ApointmentHour,DoctorName,HourStartTime,HourEndTime,SpecialityName,DayName FROM " + tables;
        s                += " WHERE ApointmentHour=HourNumber and ApointmentDoctorId=DoctorId and SpecialityId=DoctorSpecailty and ApointmentDay=DayId and ApointmentUserId='" + u.CUserId + "'";
        Session["s"]      = s;
        Session["tabels"] = tables;
        DataSet ds = appser.GetApointmentAndSort(s, tables, "");

        if (ds.Tables[0].Rows.Count != 0)
        {
            CloseApointment.Visible   = true;
            SortDDL.Visible           = true;
            ApointmentGrid.Visible    = true;
            ApointmentGrid.DataSource = ds;
            ApointmentGrid.DataBind();
        }
        else
        {
            Response.Write("<script>alert('לא נמצאו תורים')</script>");
        }
    }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Doctor d = (Doctor)Session["doctor"];
         HelloLabel.Text = d.CDoctorName;
         GetAllData.VacationsForDoctor();
         GetAllData.Appointment();
     }
 }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Doctor d = (Doctor)Session["doctor"];

        HelloLabel.Text = d.CDoctorName;
        DoctorService docser = new DoctorService();
        DataSet       ds     = docser.GetDoctorCityName(d.CDoctorId);

        ShowCity.Text      = ds.Tables[0].Rows[0]["CityName"].ToString();
        ShowId.Text        = d.CDoctorId;
        ShowName.Text      = d.CDoctorName;
        ShowGender.Text    = d.CDoctorGender;
        ShowBirthday.Text  = Convert.ToString(d.CDoctorBirthday);
        ShowSpecailty.Text = ds.Tables[0].Rows[0]["SpecialityName"].ToString();
        ShowLice.Text      = Convert.ToString(d.CDoctorLicense);
        ShowPassword.Text  = d.CDoctorPassword;
        if (d.CDoctorIsOnVacation == true)
        {
            showVacation.Text = "כן";
        }
        else
        {
            showVacation.Text = "לא";
        }
        ShowPhone.Text = d.CDoctorPhone;
        ShowUni.Text   = d.CDoctorUniversity;
        if (!Page.IsPostBack)
        {
            string      cityname = "", specName = "";
            int         cityid;
            DataSet     temp = docser.GetSpec();
            UserService us   = new UserService();
            ds = us.GetCity();
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                cityid   = Convert.ToInt32(ds.Tables[0].Rows[i]["CityId"].ToString()) - 1;
                cityname = ds.Tables[0].Rows[i]["CityName"].ToString();
                DropDownList1.Items.Insert(cityid, cityname);
            }
            for (int i = 0; i < temp.Tables[0].Rows.Count; i++)
            {
                cityid   = Convert.ToInt32(temp.Tables[0].Rows[i]["SpecialityId"].ToString()) - 1;
                specName = temp.Tables[0].Rows[i]["SpecialityName"].ToString();
                SpecDDL.Items.Insert(cityid, specName);
            }
            //check the vacation for the doctors
            GetAllData.VacationsForDoctor();
        }
    }
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 ShowDataGridForDoctor_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e)
 {
     try
     {
         Vacation v = new Vacation();
         //validation
         DateTime start = Convert.ToDateTime(((TextBox)(ShowDataGridForDoctor.Rows[e.RowIndex].Cells[9].FindControl("StartVac"))).Text);
         DateTime end   = Convert.ToDateTime(((TextBox)(ShowDataGridForDoctor.Rows[e.RowIndex].Cells[9].FindControl("EndVac"))).Text);
         if (start == null || end == null)
         {
             Response.Write("<script>alert('בחירת תאריך לא תקינה')</script>");
             return;
         }
         if (start < DateTime.Now || end < DateTime.Now || end < start)
         {
             Response.Write("<script>alert('בחירת תאריך לא תקינה')</script>");
             return;
         }
         v.CVacationStartDate = start;
         v.CVacationEndDate   = end;
         Manager m = (Manager)Session["manager"];
         v.CVacationManagerId = m.CManagerId;
         v.CVacationDoctorId  = ShowDataGridForDoctor.Rows[e.RowIndex].Cells[0].Text;
         VacationService vs = new VacationService();
         vs.InsertVacation(v);
         GetAllData.VacationsForDoctor();
         Response.Write("<script>alert('חופשה התקבלה')</script>");
         ShowDataGridForDoctor.EditIndex = -1;
         ShowGrid_Click(sender, e);
     }
     catch
     {
         Response.Write("<script>alert('בחירת תאריך לא תקינה')</script>");
         return;
     }
 }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Manager m = (Manager)Session["manager"];
         HelloLabel.Text = m.CManagerName;
         GetAllData.VacationsForDoctor();
         VacationService vs         = new VacationService();
         string          whereclout = " WHERE DoctorId=VacationDoctorId and ManagerId=VacationManagerId";
         DataSet         ds         = vs.SortVacation(whereclout);
         ShowVac.Visible = false;
         if (ds.Tables[0].Rows.Count != 0)
         {
             CloseVac.Visible   = true;
             ShowVac.Visible    = true;
             ShowVac.DataSource = ds;
             ShowVac.DataBind();
         }
         else
         {
             Response.Write("<script>alert('לא נמצאו חופשות')</script>");
         }
     }
 }