Ejemplo n.º 1
0
 void decDetailBase_AfterDataLoaded(object sender, UDTDetailContentEventArgs<UDT.StudentRemark> e)
 {
     this.txtRemark.Text = e.CurrentTargets[0].Remark;
     this.logAgent.Clear();
     this.logAgent.ActionType = (string.IsNullOrWhiteSpace(e.CurrentTargets[0].UID) ? Log.LogActionType.AddNew : Log.LogActionType.Update);
     this.logAgent.SetLogValue("備註", this.txtRemark.Text);
 }
        /// <summary>
        /// 當按下儲存按鈕時,要在此事件驗證資料,並將UI資料放入 UDT 物件。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void decDetailBase_OnValidatingData(object sender, UDTDetailContentEventArgs<MyUDT> e)
        {
            if (string.IsNullOrEmpty(this.FirstName.Text))
            {
                MessageBox.Show("請輸入 FirstName");
                e.Canceled = true;  //取消儲存
            }
            else
                e.CurrentTargets[0].FirstName = this.FirstName.Text;

            e.CurrentTargets[0].Gender = this.Gender.Checked;
            e.CurrentTargets[0].Country = this.Country.Text;
            e.CurrentTargets[0].StudentID = int.Parse(this.PrimaryKey);
        }
 /// <summary>
 /// 讀取完資料後會觸發此事件,以將UDT 資料填入 UI。
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void decDetailBase_OnBindingData(object sender, UDTDetailContentEventArgs<MyUDT> e)
 {
     MyUDT myData = e.CurrentTargets[0];
     if (!string.IsNullOrEmpty(myData.UID))
     {
         this.FirstName.Text = myData.FirstName;
         this.Gender.Checked = myData.Gender;
         this.Country.Text = myData.Country;
     }
     else
     {
         this.FirstName.Text = "";
         this.Gender.Checked = false;
         this.Country.Text = "";
     }
 }
Ejemplo n.º 4
0
        void decDetailBase_OnValidatingData(object sender, UDTDetailContentEventArgs<UDT.StudentBrief2> e)
        {
            UDT.StudentBrief2 data = e.CurrentTargets[0];

            //data.GraduateYear = this.txtGraduateYear.Text;
            //data.GraduateSemester = this.txtGraduateSemester.Text;

            //XmlElement elmFinal = (XmlElement)btnEmail.Tag;
            //if (elmFinal != null)
            //    elmFinal.InnerText = this.txtEmail.Text;

            StringBuilder sb = new StringBuilder();
            foreach (XmlElement elm in this.emails)
            {
                sb.Append(elm.OuterXml);
            }
            data.EmailList = sb.ToString();
        }
Ejemplo n.º 5
0
        void decDetailBase_AfterDataLoaded(object sender, UDTDetailContentEventArgs<UDT.StudentBrief2> e)
        {
            UDT.StudentBrief2 data = e.CurrentTargets[0];

            this.txtGraduateYear.Text = string.IsNullOrEmpty(data.GraduateYear) ? ( (data.UpdateCode=="G") ? data.UpdateSchoolYearSemester.Substring(0,3) : "") : data.GraduateYear ;
            this.txtGraduateSemester.Text = string.IsNullOrEmpty(data.GraduateSemester) ? ((data.UpdateCode == "G") ? data.UpdateSchoolYearSemester.Substring(3, 1) : "") : data.GraduateSemester;

            //parseEmail(data.EmailList);

            /* Log */
            this.logAgent.Clear();
            this.logAgent.ActionType = string.IsNullOrWhiteSpace(data.UID) ? Log.LogActionType.AddNew : Log.LogActionType.Update;
            this.AddLog(data);
        }
Ejemplo n.º 6
0
 void decDetailBase_OnValidatingData(object sender, UDTDetailContentEventArgs<UDT.StudentRemark> e)
 {
     e.CurrentTargets[0].Remark = this.txtRemark.Text;
 }
Ejemplo n.º 7
0
        void decDetailBase_OnValidatingData(object sender, UDTDetailContentEventArgs<UDT.StudentBrief2> e)
        {
            if (!string.IsNullOrWhiteSpace(this.txtEmail.Text))
            {
                if (!this.isValidEmail(this.txtEmail.Text.Trim()))
                {
                    e.Canceled = true;
                    (new ErrorProvider()).SetError(this.txtEmail, "不正確的格式。");
                    return;
                }
                else
                    (new ErrorProvider()).SetError(this.txtEmail, "");
            }
            else
                (new ErrorProvider()).SetError(this.txtEmail, "");

            UDT.StudentBrief2 data = e.CurrentTargets[0];

            XmlElement elmFinal = (XmlElement)btnEmail.Tag;
            if (elmFinal != null)
                elmFinal.InnerText = this.txtEmail.Text;

            StringBuilder sb = new StringBuilder();
            foreach (XmlElement elm in this.emails)
            {
                sb.Append(elm.OuterXml);
            }
            data.EmailList = sb.ToString();
        }
Ejemplo n.º 8
0
        void decDetailBase_AfterDataLoaded(object sender, UDTDetailContentEventArgs<UDT.StudentBrief2> e)
        {
            UDT.StudentBrief2 data = e.CurrentTargets[0];

            parseEmail(data.EmailList);

            /* Log */
            this.logAgent.Clear();
            this.logAgent.ActionType = string.IsNullOrWhiteSpace(data.UID) ? Log.LogActionType.AddNew : Log.LogActionType.Update;
            this.AddLog(data);
        }