예제 #1
0
        /// <summary>
        /// receive data from edit form
        /// </summary>
        /// <param name="pro"></param>
        /// <param name="stth"></param>
        /// <param name="sttm"></param>
        /// <param name="endh"></param>
        /// <param name="endm"></param>
        public void GETEDITDATA(string pro, string stth, string sttm, string endh, string endm)
        {
            profile   = pro;
            stthour   = stth;
            sttminute = sttm;
            endhour   = endh;
            endminute = endm;

            ListBreak neww     = new ListBreak(profile, stthour, sttminute, endhour, endminute);
            int       location = l.SelectedIndex;

            if (pro == "cancel")
            {
                l.Items.RemoveAt(location);
                listBreaks.RemoveAt(location);
            }
            else
            {
                l.Items.RemoveAt(location);
                l.Items.Insert(location, neww.profile);

                listBreaks.RemoveAt(location);
                listBreaks.Insert(location, neww);
            }
        }
예제 #2
0
 private void l_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         int       location = l.SelectedIndex;
         ListBreak breaks   = listBreaks.ElementAt(location);
         frmdetail frdt     = new frmdetail(breaks.profile, breaks.stthour, breaks.sttminute, breaks.endhour, breaks.endminute);
         frdt.editeddata = new frmdetail.EDITDATA(GETEDITDATA);
         frdt.ShowDialog();
     }
     catch { }
 }
예제 #3
0
        // ham nhan data break vua dc khoi tao
        public void GETVALUE(string pro, string stth, string sttm, string endh, string endm)
        {
            profile   = pro;
            stthour   = stth;
            sttminute = sttm;
            endhour   = endh;
            endminute = endm;

            ListBreak breaks = new ListBreak(profile, stthour, sttminute, endhour, endminute);

            listBreaks.Add(breaks);
            l.Items.Add(breaks.stthour + ":" + breaks.sttminute);
        }