コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        private string CreateColAction(ref SqlDataReader reader, string tdstyle = "")
        {
            string temp = "";

            temp += "<td + " + tdstyle + ">" + reader["Date"].ToString() + "</td>";
            temp += "<td + " + tdstyle + ">" + reader["Name"].ToString() + "</td>";
            temp += "<td + " + tdstyle + ">" + ShiduchActivity.ConvertStatus((ShiduchActivity.ActionStatus)(int) reader["Status"]) + "</td>";
            temp += "<td + " + tdstyle + ">" + reader["FullNameB"].ToString() + "</td>";
            temp += "<td + " + tdstyle + ">" + reader["remindDate"].ToString() + "</td>";

            return(temp);
        }