Пример #1
0
 /// <summary>
 /// Determines whether this instance is connected.
 /// </summary>
 /// <returns>
 /// 	<c>true</c> if this instance is connected; otherwise, <c>false</c>.
 /// </returns>
 private static bool IsConnected()
 {
     try
     {
         var db1 = new WorkflowBase();
         var db2 = new XLPassportFormBase();
         return true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(
             string.Format(ex.Message), @"Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return false;
     }
 }
Пример #2
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;
            }
        }