Esempio n. 1
0
        /// <summary>
        /// Searches the data.
        /// </summary>
        private void SearchData()
        {
            if (InvokeRequired)
            {
                var o = new DelegateThis(SearchData);
                Invoke(o);
            }
            else
            {
                string teks = lblDetail.Text.Trim();

                if (string.IsNullOrEmpty(teks)) return;

                XLPassportForm pass = new XLPassportFormBase().GetById(teks);
                string msg = "";

                if (pass != null)
                {
                    lblHeader.Text = string.Format("Permh. a.n {0}", pass.Name);

                    var db = new WorkflowBase();
                    Workflow wf = db.GetById(pass.WorkFlowXID.ToString().Trim());
                    db.Dispose();

                    msg = wf != null ? wf.WorkflowDescription : "Status tidak diketahui, hubungi petugas!";
                }
                else
                {
                    msg = "No. Permohonan tidak ditemukan!";
                }

                lblDetail.Text = msg;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Handles the Validated event of the txtID control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void txtID_Validated(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtID.Text.Trim())) return;

            var db = new WorkflowBase();
            Workflow r = db.GetById(txtID.Text.Trim());
            db.Dispose();

            try
            {
                txtDescription.Text = r.WorkflowDescription;
                txtID.Enabled = false;
                _saveMode = SaveMode.EditMode;
            }
            catch (NullReferenceException)
            {
                _saveMode = SaveMode.AddMode;
            }
        }