Пример #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());
     }
 }
Пример #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();
            }
        }
Пример #3
0
 public static void AssetSearch(ExtendedForm parentForm)
 {
     try
     {
         Device device = new Device();
         using (var newDialog = new Dialog(parentForm))
         {
             newDialog.Text = "Asset Search";
             newDialog.AddTextBox("AssetNumber", "Asset:");
             newDialog.AddTextBox("SerialNumber", "Serial:");
             newDialog.ShowDialog();
             if (newDialog.DialogResult == DialogResult.OK)
             {
                 device.AssetTag = newDialog.GetControlValue("AssetNumber").ToString().Trim();
                 device.Serial   = newDialog.GetControlValue("SerialNumber").ToString().Trim();
                 LoadMunisInfoByDevice(device, parentForm);
             }
         }
     }
     catch (Exception ex)
     {
         ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod());
     }
 }
Пример #4
0
        //public void ListFieldNames()
        //{
        //    PdfReader pdfReader = new PdfReader(Properties.Resources.Exh_K_02_Asset_Disposal_Form);
        //    StringBuilder sb = new StringBuilder();
        //    // var de = new KeyValuePair<string, AcroFields.Item>();

        //    foreach (KeyValuePair<string, AcroFields.Item> de in pdfReader.AcroFields.Fields)
        //    {
        //        sb.Append(de.Key.ToString() + Environment.NewLine);
        //    }
        //    Debug.Print(sb.ToString());
        //}

        private string GetUnitPrice()
        {
            using (var newDialog = new Dialog(parentForm))
            {
                currentDialog  = newDialog;
                newDialog.Text = "Input Unit Price";
                newDialog.AddTextBox(unitPriceTxtName, "Enter Unit Price:");
                newDialog.AddButton("cmdReqSelect", "Select From Req.", PriceFromMunis);
                newDialog.ShowDialog();
                if (newDialog.DialogResult == DialogResult.OK)
                {
                    return(newDialog.GetControlValue(unitPriceTxtName).ToString());
                }
            }

            return(string.Empty);
        }
Пример #5
0
 public static void POSearch(ExtendedForm parentForm)
 {
     try
     {
         string po = "";
         using (var newDialog = new Dialog(parentForm))
         {
             newDialog.Text = "PO Search";
             newDialog.AddTextBox("PO", "PO #:");
             newDialog.ShowDialog();
             if (newDialog.DialogResult == DialogResult.OK)
             {
                 po = newDialog.GetControlValue("PO").ToString();
                 NewMunisPOSearch(po, parentForm);
             }
         }
     }
     catch (Exception ex)
     {
         ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod());
     }
 }
Пример #6
0
 public static void NameSearch(ExtendedForm parentForm)
 {
     try
     {
         using (var newDialog = new Dialog(parentForm))
         {
             newDialog.Text = "Employee Search";
             newDialog.AddTextBox("Name", "First or Last Name:");
             newDialog.ShowDialog();
             if (newDialog.DialogResult == DialogResult.OK)
             {
                 var strName = newDialog.GetControlValue("Name").ToString();
                 if (strName.Trim() != "")
                 {
                     NewMunisEmployeeSearch(strName.Trim(), parentForm);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod());
     }
 }
Пример #7
0
        private AcroFields DisposalFormFields(Device device, PdfStamper pdfStamper)
        {
            AcroFields tmpFields = pdfStamper.AcroFields;

            using (var newDialog = new Dialog(parentForm, true))
            {
                newDialog.Text = "Additional Input Required";

                #region Section2

                newDialog.AddLabel("Reason for asset disposal-please check one:", true);
                newDialog.AddCheckBox("chkAuction", "Prep for public auction:");
                newDialog.AddCheckBox("chkObsolete", "Functional obsolescence:");
                newDialog.AddCheckBox("chkTradeIn", "Trade-in or exchange:");
                newDialog.AddCheckBox("chkDamaged", "Asset is damaged beyond repair:");
                newDialog.AddCheckBox("chkScrap", "Sold as scrap, not at a public sale:");
                newDialog.AddCheckBox("chkParts", "Used for parts:");
                newDialog.AddCheckBox("chkOther", "Other:");
                newDialog.AddRichTextBox("rtbOther", "If Other, Please explain:");

                #endregion

                #region Section3

                newDialog.AddLabel("Method of asset disposal-please check one:", true);
                newDialog.AddCheckBox("chkHand", "Hand carried by:");
                newDialog.AddRichTextBox("rtbHand", "");
                newDialog.AddCheckBox("chkCarrier", "Carrier company:");
                newDialog.AddRichTextBox("rtbCarrier", "");
                newDialog.AddCheckBox("chkShipping", "Shipping receipt number:");
                newDialog.AddRichTextBox("rtbShipping", "");
                newDialog.AddCheckBox("chkDisposed", "Disposed of on premises:");
                newDialog.AddRichTextBox("rtbDisposed", "");
                newDialog.AddCheckBox("chkOtherMethod", "Other. Please explain:");
                newDialog.AddRichTextBox("rtpOtherMethod", "");

                #endregion

                #region Section4

                newDialog.AddTextBox("txtSaleAmount", "List the amount of proceeds from the sale of the disposed asset, if any.");
                newDialog.AddLabel("If the asset item was traded, provide the following information for the asset BEGING ACQUIRED:", true);
                newDialog.AddTextBox("txtAssetTag", "Asset/Tag Number:");
                newDialog.AddTextBox("txtSerial", "Serial Number:");
                newDialog.AddTextBox("txtDescription", "Description:");

                #endregion

                newDialog.ShowDialog();
                if (newDialog.DialogResult != DialogResult.OK)
                {
                    return(null);
                }
                tmpFields.SetField("topmostSubform[0].Page1[0].AssetTag_number[0]", device.AssetTag);
                tmpFields.SetField("topmostSubform[0].Page1[0].Mfg_serial_number_1[0]", device.Serial);
                tmpFields.SetField("topmostSubform[0].Page1[0].Mfg_serial_number_2[0]", device.Description);
                tmpFields.SetField("topmostSubform[0].Page1[0].Mfg_serial_number_3[0]", AttributeFunctions.DepartmentOf(device.Location));
                tmpFields.SetField("topmostSubform[0].Page1[0].County_s_possession[0]", DateTime.Now.ToString("MM/dd/yyyy"));

                #region Section 2

                tmpFields.SetField("topmostSubform[0].Page1[0].Preparation_for_public_auction[0]", CheckValueToString(System.Convert.ToBoolean(newDialog.GetControlValue("chkAuction"))));
                tmpFields.SetField("topmostSubform[0].Page1[0].Functional_obsolescence[0]", CheckValueToString(System.Convert.ToBoolean(newDialog.GetControlValue("chkObsolete"))));
                tmpFields.SetField("topmostSubform[0].Page1[0].Trade-in_or_exchange[0]", CheckValueToString(System.Convert.ToBoolean(newDialog.GetControlValue("chkTradeIn"))));
                tmpFields.SetField("topmostSubform[0].Page1[0].Asset_is_damaged_beyond_repair[0]", CheckValueToString(System.Convert.ToBoolean(newDialog.GetControlValue("chkDamaged"))));
                tmpFields.SetField("topmostSubform[0].Page1[0].Sold_as_scrap__not_at_a_public_sale[0]", CheckValueToString(System.Convert.ToBoolean(newDialog.GetControlValue("chkScrap"))));
                tmpFields.SetField("topmostSubform[0].Page1[0].Used_for_parts[0]", CheckValueToString(System.Convert.ToBoolean(newDialog.GetControlValue("chkParts"))));
                tmpFields.SetField("topmostSubform[0].Page1[0].undefined[0]", CheckValueToString(System.Convert.ToBoolean(newDialog.GetControlValue("chkOther"))));
                tmpFields.SetField("topmostSubform[0].Page1[0].Other__Please_explain_2[0]", newDialog.GetControlValue("rtbOther").ToString());

                #endregion

                #region Section 3

                tmpFields.SetField("topmostSubform[0].Page1[0].Method_of_asset_disposal_please_check_one[0]", CheckValueToString(System.Convert.ToBoolean(newDialog.GetControlValue("chkHand"))));
                tmpFields.SetField("topmostSubform[0].Page1[0].Hand_carried_by[0]", newDialog.GetControlValue("rtbHand").ToString());
                tmpFields.SetField("topmostSubform[0].Page1[0]._1[0]", CheckValueToString(System.Convert.ToBoolean(newDialog.GetControlValue("chkCarrier"))));
                tmpFields.SetField("topmostSubform[0].Page1[0].Carrier_company[0]", newDialog.GetControlValue("rtbCarrier").ToString());
                tmpFields.SetField("topmostSubform[0].Page1[0]._2[0]", CheckValueToString(System.Convert.ToBoolean(newDialog.GetControlValue("chkShipping"))));
                tmpFields.SetField("topmostSubform[0].Page1[0].Shipping_receipt_number[0]", newDialog.GetControlValue("rtbShipping").ToString());
                tmpFields.SetField("topmostSubform[0].Page1[0]._3[0]", CheckValueToString(System.Convert.ToBoolean(newDialog.GetControlValue("chkDisposed"))));
                tmpFields.SetField("topmostSubform[0].Page1[0].Disposed_of_on_premises[0]", newDialog.GetControlValue("rtbDisposed").ToString());
                tmpFields.SetField("topmostSubform[0].Page1[0]._4[0]", CheckValueToString(System.Convert.ToBoolean(newDialog.GetControlValue("chkOtherMethod"))));
                tmpFields.SetField("topmostSubform[0].Page1[0].Other__Please_explain_3[0]", newDialog.GetControlValue("rtpOtherMethod").ToString());

                #endregion

                #region Section 4

                tmpFields.SetField("topmostSubform[0].Page1[0].List_the_amount_of_proceeds_from_the_sale_of_the_disposed_asset__if_any[0]", newDialog.GetControlValue("txtSaleAmount").ToString());
                tmpFields.SetField("topmostSubform[0].Page1[0].AssetTag_number_2[0]", newDialog.GetControlValue("txtAssetTag").ToString());
                tmpFields.SetField("topmostSubform[0].Page1[0].Serial_number[0]", newDialog.GetControlValue("txtSerial").ToString());
                tmpFields.SetField("topmostSubform[0].Page1[0].Description_of_asset[0]", newDialog.GetControlValue("txtDescription").ToString());
                tmpFields.SetField("topmostSubform[0].Page1[0].Department_1[0]", AttributeFunctions.DepartmentOf(device.Location));
                tmpFields.SetField("topmostSubform[0].Page1[0].Date[0]", DateTime.Now.ToString("MM/dd/yyyy"));

                #endregion
            }

            return(tmpFields);
        }