private void LoadMyActivities()
        {
            SqlDataReader reader = ShiduchActivity.GetActivities(true, MyPeople);

            lstMyActivity.Items.Clear();
            ListView     lst = lstMyActivity;
            ListViewItem item;

            lstMyActivity.BeginUpdate();
            while (reader.Read())
            {
                string notes = reader["NotesSummary"].ToString();
                string name  = reader["FullNameB"] != System.DBNull.Value ? (string)reader["FullNameB"] : "";
                if ((ShiduchActivity.ActionType)(int) reader["Action"] == ShiduchActivity.ActionType.other)
                {
                    notes = notes.Substring(notes.IndexOf('^') + 3);
                }
                item = new ListViewItem(new string[] {
                    DateTime.Parse(reader["Date"].ToString()).ToShortDateString(),
                    ShiduchActivity.ConvertAction((ShiduchActivity.ActionType)(int) reader["Action"], reader),
                    name,
                    ShiduchActivity.ConvertStatus((ShiduchActivity.ActionStatus)(int) reader["Status"]),
                    notes,
                    reader["IdSideB"].ToString()
                });
                item.Tag = reader["Id"];
                lst.Items.Add(item);
            }
            lstMyActivity.EndUpdate();
            reader.Close();
        }
        public void DiaryListResult(ref SqlDataReader reader)
        {
            List <ShiduchActivity> s = new List <ShiduchActivity>();
            ListViewItem           item;

            olstActivityDiary.Items.Clear();
            olstActivityDiary.BeginUpdate();
            while (reader.Read())
            {
                ShiduchActivity sh = new ShiduchActivity();
                ShiduchActivity.readerToShiduchActivity(ref reader, ref sh);
                string nameA = reader["FullNameA"] != System.DBNull.Value ? (string)reader["FullNameA"] : "";
                string nameB = reader["FullNameB"] != System.DBNull.Value ? (string)reader["FullNameB"] : "";

                sh.FullNameA     = nameA;
                sh.FullNameB     = nameB;
                sh.ActionConvert = ShiduchActivity.ConvertAction((ShiduchActivity.ActionType)sh.Action, reader);
                sh.StatusConvert = ShiduchActivity.ConvertStatus((ShiduchActivity.ActionStatus)sh.Status);
                sh.UserName      = (string)reader["Name"];
                item             = new ListViewItem(new string[] {
                    sh.Date.ToShortDateString(),
                    sh.ActionConvert,
                    sh.FullNameA,
                    sh.FullNameB,
                    sh.StatusConvert,
                    sh.reminder.Date.ToShortDateString(),
                    sh.NotesSummary
                });
                item.Tag = sh.Id;
                s.Add(sh);

                olstActivityDiary.Items.Add(item);
            }
            olstActivityDiary.EndUpdate();
        }
Beispiel #3
0
        public void LoadReminder()
        {
            SqlDataReader reader = ShiduchActivity.GetActivities(false, null, false, true);

            lstReminder.Items.Clear();
            ListView     lst = lstReminder;
            ListViewItem item;

            ShiduchActivity.ActionType action;
            lstReminder.BeginUpdate();
            while (reader.Read())
            {
                string name = reader["FullNameB"] != System.DBNull.Value ? (string)reader["FullNameB"] : "";
                action = (ShiduchActivity.ActionType)(int) reader["Action"];
                item   = new ListViewItem(new string[] {
                    DateTime.Parse(reader["Date"].ToString()).ToShortDateString(),
                    (string)reader["FullNameA"],
                    ShiduchActivity.ConvertAction(action, reader),
                    name
                });
                item.Tag = reader["Id"];
                //item.ImageKey = "phone-icon (1).png";
                switch (action)
                {
                case ShiduchActivity.ActionType.proposal:
                    item.BackColor = Color.FromArgb(234, 195, 152);
                    break;

                case ShiduchActivity.ActionType.date:
                    item.BackColor = Color.FromArgb(234, 133, 129);
                    break;

                case ShiduchActivity.ActionType.details:
                    item.BackColor = Color.FromArgb(234, 206, 187);
                    break;

                case ShiduchActivity.ActionType.other:
                    item.BackColor = Color.FromArgb(183, 183, 183);
                    break;
                }
                lst.Items.Add(item);
            }
            lstReminder.EndUpdate();
            reader.Close();
        }
        private void LoadAllActivities()
        {
            SqlDataReader reader = ShiduchActivity.GetActivities(false, MyPeople, true);

            lstAllActivity.Items.Clear();
            ListView     lst = lstAllActivity;
            ListViewItem item;

            lstAllActivity.BeginUpdate();
            while (reader.Read())
            {
                string name = reader["FullNameB"] != System.DBNull.Value ? (string)reader["FullNameB"] : "";

                item = new ListViewItem(new string[] {
                    DateTime.Parse(reader["Date"].ToString()).ToShortDateString(),
                    (string)reader["Name"],
                    ShiduchActivity.ConvertAction((ShiduchActivity.ActionType)(int) reader["Action"], reader),
                    name
                });
                lst.Items.Add(item);
            }
            lstAllActivity.EndUpdate();
            reader.Close();
        }
        private void LoadTxt()
        {
            groupBoxSideA.Text += MyPeople.FirstName + " " + MyPeople.Lasname;
            if (MyPeople.Sexs == 2)
            {
                lblSearchShiduch.Visible = false;
            }
            lblActiveFor.Text += MyPeople.FirstName + " " + MyPeople.Lasname;
            //if (lblActiveFor.Location.X + lblActiveFor.Width > btnSaveOpenB.Location.X)
            //{
            //    lblActiveFor.Location = new Point(btnSaveOpenB.Location.X - lblActiveFor.Width - 20, lblActiveFor.Location.Y);
            //}
            txtName.Text     = MyPeople.FirstName + " " + MyPeople.Lasname;
            txtAge.Value     = decimal.Parse(MyPeople.Age.ToString());
            txtSchool.Text   = MyPeople.Details.YeshivaGorSeminary;
            txtAdress.Text   = MyPeople.Details.Street + " " + MyPeople.City;
            txtWork.Text     = MyPeople.WorkPlace;
            txtPhoneDad.Text = MyPeople.Details.Tel1;
            txtPhoneMom.Text = MyPeople.Details.Tel2;
            txtPhone.Text    = MyPeople.Details.Telephone;

            txtDate.Text = DateTime.Now.ToString();
            if (newActivity && ShiduchActivity.IdSideB == 0)
            {
                LoadSearchShiduch();
            }
            // if (updateActivity || ShiduchActivity.IdSideB > 0)

            //אם הפעילות נוצרה עם צד' ב
            if (ShiduchActivity.IdSideB != -1 && ShiduchActivity.IdSideB != 0)
            {
                SqlDataReader reader = People.ReadById(ShiduchActivity.IdSideB);
                if (reader.Read())
                {
                    Shiduch = new People();
                    PeopleManipulations.ReaderToPeople(ref Shiduch, ref reader, true, true);
                }
                reader.Close();
                KeyValueClass item = new KeyValueClass();
                item.Text = Shiduch.FirstName + " " + Shiduch.Lasname + " " + Shiduch.Details.YeshivaGorSeminary
                            + " " + Shiduch.Details.Street + " " + Shiduch.City;
                item.Value = Shiduch.ID.ToString();
                txtSearchShiduch.Items.Add(item);
                txtSearchShiduch.SelectedIndex = 0;
                //שיהיה אותה הפעילות לשני הצדדים ולא לאפשר לשנות
                if (thisSideB || updateActivity)
                {
                    radDate.Checked      = ShiduchActivity.Action == (int)ShiduchActivity.ActionType.date;
                    radProposal.Checked  = ShiduchActivity.Action == (int)ShiduchActivity.ActionType.proposal;
                    radProposal.Enabled  = radDate.Enabled = radOther.Enabled = radDetails.Enabled = txtOther.Enabled = false;
                    txtNotesSummary.Text = ShiduchActivity.NotesSummary;
                }
            }
            if (updateActivity)
            {
                Text                  = "פעילות " + ShiduchActivity.ConvertAction((ShiduchActivity.ActionType)ShiduchActivity.Action) + " ל";
                txtDate.Text          = ShiduchActivity.Date.ToString();
                txtDateReminder.Value = ShiduchActivity.reminder.Date;
                radDate.Checked       = ShiduchActivity.Action == (int)ShiduchActivity.ActionType.date;
                radProposal.Checked   = ShiduchActivity.Action == (int)ShiduchActivity.ActionType.proposal;
                radDetails.Checked    = ShiduchActivity.Action == (int)ShiduchActivity.ActionType.details;
                radOther.Checked      = ShiduchActivity.Action == (int)ShiduchActivity.ActionType.other;
                if (radOther.Checked)
                {
                    string text = ShiduchActivity.NotesSummary.Substring(0, ShiduchActivity.NotesSummary.IndexOf('^'));
                    string t    = ShiduchActivity.NotesSummary.Substring(ShiduchActivity.NotesSummary.IndexOf('^') + 3);
                    txtOther.Text        = text;
                    txtNotesSummary.Text = t;
                }
                else
                {
                    txtNotesSummary.Text = ShiduchActivity.NotesSummary;
                }
                radComplete.Checked   = ShiduchActivity.Status == 1;
                radNoRelevant.Checked = ShiduchActivity.Status == 2;
                radProposal.Enabled   = radDate.Enabled = radOther.Enabled = radDetails.Enabled = txtOther.Enabled = false;
                //אחרי שהפעילות נוצרה רק המנהל הראשי יכול לשנות אצ בטיפול של
                if (GLOBALVARS.MyUser.Control != User.TypeControl.Admin)
                {
                    txtReminderInCare.Enabled = false;
                }
            }
            Text += MyPeople.FirstName + " " + MyPeople.Lasname;
        }