Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _messageSender = (Person)Session["CurrentUser"];
            if (!IsPostBack)
            {
                var toList = new List<string>();

                if (_messageSender is Teacher)
                {
                    toList.Add("ילד ספציפי");
                    toList.Add("כל ילדי הגן");
                    toList.Add("מפקחת");
                }
                if (_messageSender is Supervisor)
                {
                    toList.Add("גננת");
                    toList.Add("ילדי המחוז");
                    toList.Add("גננות המחוז");
                }

                Who.DataSource = toList;
                Who.AutoPostBack = true;
                Who.DataBind();
                if (_messageSender is Child)
                {
                    Who.Visible = false;
                    WhoLable.Visible = true;
                }

            }
        }
Exemplo n.º 2
0
        public void SendMessage(Person sender, string title, string body, List<Person> recipients)
        {
            var msg = new Message
            {
                Body = body,
                Sender = sender,
                Recipients = recipients,
                Title = title,
                SendTime = DateTime.Now
            };

            MessageEdit.Instance.Add(msg);
        }
Exemplo n.º 3
0
        private void FillFields(Entities.Person current)
        {
            Id.Text        = current.IdNum;
            FirstName.Text = current.FirstName;
            LastName.Text  = current.LastName;
            BirthDate.Text = current.BirthDay.ToShortDateString();
            Phone.Text     = current.PhoneNum;

            if (current is Entities.Child)
            {
                var child = current as Entities.Child;
                PersonTypes.SelectedValue = "1";
                foreach (var sensitivity in child.Sensitivitieses)
                {
                    var sen = Sensetivities.Items.FindByValue(sensitivity.Id.ToString());
                    sen.Selected = true;
                }

                ChildData.Visible      = true;
                TeacherData.Visible    = false;
                SupervisorData.Visible = false;
            }
            else if (current is Entities.Teacher)
            {
                var teacher = current as Entities.Teacher;
                PersonTypes.SelectedValue = "2";
                Teachers.SelectedValue    = teacher.Substitute != null?teacher.Substitute.Id.ToString() : "";

                Sen.Text = teacher.Seniority.ToString();

                ChildData.Visible      = false;
                TeacherData.Visible    = true;
                SupervisorData.Visible = false;
            }
            else
            {
                var supervisor = current as Entities.Supervisor;
                PersonTypes.SelectedValue = "3";
                Cities.SelectedValue      = ((int)supervisor.City).ToString();

                ChildData.Visible      = false;
                TeacherData.Visible    = false;
                SupervisorData.Visible = true;
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindList();

                var userCode = Request.QueryString["code"];
                if (userCode != null)
                {
                    var current = new PersonQuery().Get(int.Parse(userCode));
                    CurrentUser = current;
                    FillFields(current);
                    PersonTypes.Enabled = false;

                    InitByUser();
                }
            }
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindList();

                var userCode = Request.QueryString["code"];
                if (userCode != null)
                {
                    var current = new PersonQuery().Get(int.Parse(userCode));
                    CurrentUser = current;
                    FillFields(current);
                    PersonTypes.Enabled = false;

                    InitByUser();
                }
            }
        }
Exemplo n.º 6
0
 public List<Message> GetPersonMessages(Person recipient)
 {
     return new MessageQuery{Person = recipient}.GetByFilter().ToList();
 }
Exemplo n.º 7
0
 protected bool Equals(Person other)
 {
     return Id == other.Id;
 }