Exemplo n.º 1
0
 public static void OrgObjSearch(ExtendedForm parentForm)
 {
     try
     {
         using (var newDialog = new Dialog(parentForm))
         {
             string org = "";
             string obj = "";
             string fy  = "";
             newDialog.Text = "Org/Object Code Search";
             newDialog.AddTextBox("Org", "Org Code:");
             newDialog.AddTextBox("Obj", "Object Code:");
             newDialog.AddTextBox("FY", "Fiscal Year:");
             newDialog.SetControlValue("FY", DateTime.Now.Year);
             newDialog.ShowDialog();
             if (newDialog.DialogResult == DialogResult.OK)
             {
                 org = newDialog.GetControlValue("Org").ToString();
                 obj = newDialog.GetControlValue("Obj").ToString();
                 fy  = newDialog.GetControlValue("FY").ToString();
                 if (org.Trim() != "" && DataConsistency.IsValidYear(fy))
                 {
                     NewOrgObjView(org, obj, fy, parentForm);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod());
     }
 }
Exemplo n.º 2
0
        public static async void ReqSearch(ExtendedForm parentForm)
        {
            try
            {
                string reqNumber = "";
                string fy        = "";
                using (var newDialog = new Dialog(parentForm))
                {
                    newDialog.Text = "Req Search";
                    newDialog.AddTextBox("ReqNum", "Requisition #:");
                    newDialog.AddTextBox("FY", "FY:");
                    newDialog.ShowDialog();
                    if (newDialog.DialogResult == DialogResult.OK)
                    {
                        reqNumber = newDialog.GetControlValue("ReqNum").ToString();
                        fy        = newDialog.GetControlValue("FY").ToString();
                        if (DataConsistency.IsValidYear(fy))
                        {
                            parentForm.Waiting();

                            var blah = await NewMunisReqSearch(reqNumber, fy, parentForm);
                        }
                        else
                        {
                            OtherFunctions.Message("Invalid year.", MessageBoxButtons.OK, MessageBoxIcon.Information, "Invalid", parentForm);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod());
            }
            finally
            {
                parentForm.DoneWaiting();
            }
        }