Exemplo n.º 1
0
 public frmFindIR(clsIR _irToSearch, string _strTitle, bool _blnInitLoadResults)
 {
     InitializeComponent();
     irToSearch = _irToSearch;
     this.Text = _strTitle;
     blnINITLOADRESULTS = _blnInitLoadResults;
 }
Exemplo n.º 2
0
        public static long fcnFindIR(string _strCompany, string _strFName, string _strLName, long _lngRecordID, string _strAddress, string _strCity, long _lngStateID, string _strZip, string _strHomePhone, string _strWorkPhone,string _strCellPhone, string _strEmail)
        {
            clsIR irToSearch = new clsIR(_lngRecordID, _lngStateID, _strFName, _strLName, _strCompany, _strAddress, _strCity, _strZip, _strHomePhone, _strWorkPhone, _strCellPhone, _strEmail);

            long lngRecordID = 0;

            using (frmFindIR objFindIR = new frmFindIR(irToSearch))
            {
                objFindIR.ShowDialog();

                lngRecordID = objFindIR.irToSearch.lngRecordID;
            }

            return lngRecordID;
        }
Exemplo n.º 3
0
        public frmAddIR(clsIR _irToAdd)
        {
            InitializeComponent();

            irToAdd = _irToAdd;

            clsCboSources.subFillStateCbo(ref cboState, _irToAdd.lngStateID);
            clsCboSources.subFillStateCbo(ref cboBillState, _irToAdd.lngBillStateID);

            chkParent.Checked = _irToAdd.blnParent;
            chkCamper.Checked = _irToAdd.blnCamper;

            radF.Checked = false;
            radM.Checked = false;

            if (_irToAdd.blnGender)
                radM.Checked = true;
            else
                radF.Checked = true;

            txtMI.Text = _irToAdd.strMI;
            txtGrade.Text = _irToAdd.intGrade.ToString();

            if (_irToAdd.dteBDate == DateTime.MinValue)
                txtBDate.Text = "";
            else
                txtBDate.Text = _irToAdd.dteBDate.ToString();

            txtRecordWebID.Text = _irToAdd.lngRecordWebID.ToString();

            txtEMail.Text = _irToAdd.strEmail;
            txtConfEmail.Text = _irToAdd.strConfEmail;
            txtWorkPhone.Text = _irToAdd.strWorkPhone;
            txtHomePhone.Text = _irToAdd.strHomePhone;
            txtCellPhone.Text = _irToAdd.strCellPhone;
            txtZip.Text = _irToAdd.strZip;
            txtCity.Text = _irToAdd.strCity;
            txtAddress.Text = _irToAdd.strAddress;
            txtCompany.Text = _irToAdd.strCompany;
            txtLName.Text = _irToAdd.strLName;
            txtFName.Text = _irToAdd.strFName;
            txtPmtType.Text = _irToAdd.strPmtType;

            txtSpecNeeds.Text = _irToAdd.strSpecialNeeds;

            if (_irToAdd.strSpecialNeeds.Length > 0)
                btnSpecialNeeds.Visible = true;
            else
                btnSpecialNeeds.Visible = false;

            txtNotes.Text = _irToAdd.strNotes;
            txtPmtRef.Text = _irToAdd.strPmtRef;
            txtBankName.Text = _irToAdd.strBankName;
            txtFather.Text = _irToAdd.strFather;
            txtMother.Text = _irToAdd.strMother;
            txtBillName.Text = _irToAdd.strBillName;
            txtBillAddress.Text = _irToAdd.strBillAddress;
            txtBillCity.Text = _irToAdd.strBillCity;
            txtBillZip.Text = _irToAdd.strBillZip;
            txtBillPhone.Text = _irToAdd.strBillPhone;

            //check caps and convert if necessary
            bool blnCapsWebProcessing = false;

            string strSQL = "SELECT blnCapsWebProcessing " +
                    "FROM tblCampDefaults";

            using (OleDbConnection conDB = new OleDbConnection(clsAppSettings.GetAppSettings().strCTConn))
            {
                conDB.Open();

                using (OleDbCommand cmdDB = new OleDbCommand(strSQL, conDB))
                {
                    try { blnCapsWebProcessing = Convert.ToBoolean(cmdDB.ExecuteScalar()); }
                    catch { blnCapsWebProcessing = false; }
                }

                conDB.Close();
            }

            if (blnCapsWebProcessing)
            {
                txtMI.Text = txtMI.Text.ToUpper();
                txtCity.Text = txtCity.Text.ToUpper();
                txtAddress.Text = txtAddress.Text.ToUpper();
                txtCompany.Text = txtCompany.Text.ToUpper();
                txtLName.Text = txtLName.Text.ToUpper();
                txtFName.Text = txtFName.Text.ToUpper();

                txtSpecNeeds.Text = txtSpecNeeds.Text.ToUpper();

                txtNotes.Text = txtNotes.Text.ToUpper();
                txtBankName.Text = txtBankName.Text.ToUpper();
                txtFather.Text = txtFather.Text.ToUpper();
                txtMother.Text = txtMother.Text.ToUpper();
                txtBillName.Text = txtBillName.Text.ToUpper();
                txtBillAddress.Text = txtBillAddress.Text.ToUpper();
                txtBillCity.Text = txtBillCity.Text.ToUpper();
            }

            //custom field defs and vals

            using (OleDbConnection conDB = new OleDbConnection(clsAppSettings.GetAppSettings().strCTConn))
            {
                conDB.Open();

                strSQL = "SELECT tblCustomFieldDefIR.lngCustomFieldDefIRID, " +
                               "tblCustomFieldDefIR.strFieldType, tblCustomFieldDefIR.strLocalCaption " +
                           "FROM tblCustomFieldDefIR " +
                           "WHERE tblCustomFieldDefIR.blnUseLocal=True "+
                           "ORDER BY tblCustomFieldDefIR.lngSortOrder, " +
                               "tblCustomFieldDefIR.strLocalCaption";

                using (OleDbCommand cmdDB = new OleDbCommand(strSQL, conDB))
                {
                    using (OleDbDataReader drCustDef = cmdDB.ExecuteReader())
                    {
                        bool blnCustIRRightCol = false;
                        int intCustIRTop = 6;

                        while (drCustDef.Read())
                        {
                            long lngCustomFieldDefIRID = 0;
                            string strFieldType = "";
                            string strLocalCaption = "";

                            try { lngCustomFieldDefIRID = Convert.ToInt32(drCustDef["lngCustomFieldDefIRID"]); }
                            catch { lngCustomFieldDefIRID = 0; }
                            try { strFieldType = Convert.ToString(drCustDef["strFieldType"]); }
                            catch { strFieldType = ""; }
                            try { strLocalCaption = Convert.ToString(drCustDef["strLocalCaption"]); }
                            catch { strLocalCaption = ""; }

                            //add field def
                            Panel panCustIR = new Panel();
                            panCustIR.Name = "panCustomIR_" + lngCustomFieldDefIRID.ToString();
                            panCustIR.BackColor = ColorTranslator.FromHtml("#E0E0E0");
                            panCustIR.Width = 355;
                            panCustIR.Top = intCustIRTop;

                            switch (strFieldType)
                            {
                                case "FIELD":
                                    Label lblCustFieldIR = new Label();
                                    lblCustFieldIR.Name = "lblCustFieldIR_" + lngCustomFieldDefIRID.ToString();
                                    lblCustFieldIR.Text = strLocalCaption;
                                    lblCustFieldIR.Top = 6;
                                    lblCustFieldIR.Left = 6;
                                    lblCustFieldIR.Width = 175;

                                    TextBox txtCustFieldIR = new TextBox();
                                    txtCustFieldIR.Name = "txtCustFieldIR_" + lngCustomFieldDefIRID.ToString();
                                    txtCustFieldIR.Left = 187;
                                    txtCustFieldIR.Top = 6;
                                    txtCustFieldIR.Width = 156;
                                    txtCustFieldIR.Height = 20;

                                    for (int intI = 0; intI < irToAdd.strCustom.Count; intI++)
                                        if (irToAdd.strCustom[intI][0] == strLocalCaption) txtCustFieldIR.Text = irToAdd.strCustom[intI][1];

                                    if (blnCapsWebProcessing) txtCustFieldIR.Text = txtCustFieldIR.Text.ToUpper();

                                    panCustIR.Height = 32;
                                    panCustIR.Controls.Add(lblCustFieldIR);
                                    panCustIR.Controls.Add(txtCustFieldIR);

                                    break;

                                case "MULTI-LINE TEXT":
                                    Label lblCustMLIR = new Label();
                                    lblCustMLIR.Name = "lblCustFieldIR_" + lngCustomFieldDefIRID.ToString();
                                    lblCustMLIR.Text = strLocalCaption;
                                    lblCustMLIR.Top = 6;
                                    lblCustMLIR.Left = 6;
                                    lblCustMLIR.Width = 175;

                                    TextBox txtCustMLIR = new TextBox();
                                    txtCustMLIR.Name = "txtCustFieldIR_" + lngCustomFieldDefIRID.ToString();
                                    txtCustMLIR.Left = 187;
                                    txtCustMLIR.Top = 6;
                                    txtCustMLIR.Width = 156;
                                    txtCustMLIR.Height = 40;

                                    for (int intI = 0; intI < irToAdd.strCustom.Count; intI++)
                                        if (irToAdd.strCustom[intI][0] == strLocalCaption) txtCustMLIR.Text = irToAdd.strCustom[intI][1];

                                    if (blnCapsWebProcessing) txtCustMLIR.Text = txtCustMLIR.Text.ToUpper();

                                    panCustIR.Height = 52;
                                    panCustIR.Controls.Add(lblCustMLIR);
                                    panCustIR.Controls.Add(txtCustMLIR);

                                    break;

                                case "FLAG":
                                    CheckBox chkCustIR = new CheckBox();
                                    chkCustIR.Name = "chkCustIR_" + lngCustomFieldDefIRID.ToString();
                                    chkCustIR.Text = strLocalCaption;
                                    chkCustIR.Top = 6;
                                    chkCustIR.Left = 6;
                                    chkCustIR.Width = 226;

                                    panCustIR.Height = 32;
                                    panCustIR.Controls.Add(chkCustIR);

                                    for (int intI = 0; intI < irToAdd.strCustom.Count; intI++)
                                    {
                                        if (irToAdd.strCustom[intI][0] == strLocalCaption)
                                        {
                                            string strVal = irToAdd.strCustom[intI][1];
                                            bool blnChecked = false;

                                            if (strVal.ToLower() == "true")
                                                blnChecked = true;
                                            else if (strVal.ToLower() == "false")
                                                blnChecked = false;
                                            else if (strVal.ToLower() == "-1")
                                                blnChecked = true;
                                            else
                                                blnChecked = false;

                                            chkCustIR.Checked = blnChecked;
                                        }
                                    }

                                    break;

                                case "DROPDOWN":
                                    Label lblCustCboIR = new Label();
                                    lblCustCboIR.Name = "lblCustFieldIR_" + lngCustomFieldDefIRID.ToString();
                                    lblCustCboIR.Text = strLocalCaption;
                                    lblCustCboIR.Top = 6;
                                    lblCustCboIR.Left = 6;
                                    lblCustCboIR.Width = 175;

                                    ComboBox cboCustFieldIR = new ComboBox();
                                    cboCustFieldIR.Name = "cboCustFieldIR_" + lngCustomFieldDefIRID.ToString();
                                    cboCustFieldIR.Left = 187;
                                    cboCustFieldIR.Top = 6;
                                    cboCustFieldIR.Width = 156;
                                    cboCustFieldIR.Height = 20;
                                    //add options
                                    subSetCboItems(cboCustFieldIR, strLocalCaption);

                                    for (int intI = 0; intI < irToAdd.strCustom.Count; intI++)
                                        if (irToAdd.strCustom[intI][0] == strLocalCaption) cboCustFieldIR.SelectedItem = irToAdd.strCustom[intI][1];

                                    panCustIR.Height = 32;
                                    panCustIR.Controls.Add(lblCustCboIR);
                                    panCustIR.Controls.Add(cboCustFieldIR);

                                    break;
                            }

                            if (blnCustIRRightCol)
                            {
                                panCustIR.Left = 387;
                                intCustIRTop += panCustIR.Height + 6;
                            }
                            else
                                panCustIR.Left = 6;

                            pagCustom.Controls.Add(panCustIR);

                            blnCustIRRightCol = !blnCustIRRightCol;
                        }

                        drCustDef.Close();
                    }
                }

                conDB.Close();
            }
        }
Exemplo n.º 4
0
 public frmFindIR(clsIR _irToSearch, string _strTitle)
 {
     InitializeComponent();
     irToSearch = _irToSearch;
     this.Text = _strTitle;
 }
Exemplo n.º 5
0
 public frmFindIR(clsIR _irToSearch)
 {
     InitializeComponent();
     irToSearch = _irToSearch;
 }