Exemplo n.º 1
0
        public static void subCloseGGCCRegDetails()
        {
            try
            {
                objGGCCRegDetails.Close();
                objGGCCRegDetails.Dispose();
                objGGCCRegDetails = null;
            }
            catch (Exception ex)
            {

                clsErr.subLogErr("subCloseGGCCRegDetails", ex);
            }
        }
Exemplo n.º 2
0
        public static void subShowGGCCRegDetails(Form _mdiParent, long _lngGGCCRegWebID)
        {
            try
            {
                if (objGGCCRegDetails == null) objGGCCRegDetails = new GGCC.frmGGCCRegDetails();

                objGGCCRegDetails.lngGGCCRegWebID = _lngGGCCRegWebID;

                objGGCCRegDetails.MdiParent = _mdiParent;

                objGGCCRegDetails.Show();
            }
            catch (Exception ex)
            {
                clsErr.subLogErr("subShowGGCCRegDetails", ex);
            }
        }
Exemplo n.º 3
0
        public static long fcnGetWebRegIR(frmGGCCRegDetails _objGGCCRegDetails)
        {
            //match existing or add new ir for received ggccregweb id.
            //return matched or new ir id.
            long lngRes = 0;

            try
            {
                long lngStateID = 0;

                try { lngStateID = ((clsCboItem)_objGGCCRegDetails.cboState.SelectedItem).ID; }
                catch { lngStateID = 0; }

                clsIR irToSearch = new clsIR(0, lngStateID, _objGGCCRegDetails.txtFName.Text, _objGGCCRegDetails.txtLName.Text, _objGGCCRegDetails.txtCompanyName.Text, _objGGCCRegDetails.txtAddress.Text, _objGGCCRegDetails.txtCity.Text, _objGGCCRegDetails.txtZip.Text, _objGGCCRegDetails.txtHomePhone.Text, _objGGCCRegDetails.txtWorkPhone.Text, _objGGCCRegDetails.txtCellPhone.Text, _objGGCCRegDetails.txtEMail.Text);

                //fill in ir details to pass to search screen
                irToSearch.blnGender = true;

                irToSearch.lngRecordWebID = _objGGCCRegDetails.lngRecordWebID;
                irToSearch.lngRecordID = _objGGCCRegDetails.lngRecordID;

                irToSearch.strEmail = _objGGCCRegDetails.txtEMail.Text;
                irToSearch.strHomePhone = _objGGCCRegDetails.txtHomePhone.Text;
                irToSearch.strCellPhone = _objGGCCRegDetails.txtCellPhone.Text;
                irToSearch.strZip = _objGGCCRegDetails.txtZip.Text;
                irToSearch.strCity = _objGGCCRegDetails.txtCity.Text;
                irToSearch.strAddress = _objGGCCRegDetails.txtAddress.Text;
                irToSearch.strLName = _objGGCCRegDetails.txtLName.Text;
                irToSearch.strFName = _objGGCCRegDetails.txtFName.Text;

                using (frmFindIR objFindIR = new frmFindIR(irToSearch, "Find camper record"))
                {
                    if (objFindIR.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        if (objFindIR.irToSearch.lngRecordID == 0)
                            return 0;
                        else
                        {
                            lngRes = objFindIR.irToSearch.lngRecordID;

                            if (!objFindIR.blnAddNew)
                            {
                                using (IRUtils.frmReconcileIR objReconcileIR = new global::CTWebMgmt.IRUtils.frmReconcileIR("tblWebRecordsGGCCReg", _objGGCCRegDetails.lngRecordID, _objGGCCRegDetails.lngRecordWebID))
                                {
                                    if (objReconcileIR.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
                                        return 0;
                                    else
                                        _objGGCCRegDetails.lngRecordID = objReconcileIR.lngDBID;
                                }
                            }
                        }
                    }
                    else
                        return 0;
                }

                if (lngRes > 0)
                {
                    string strSQL = "";

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

                        strSQL = "UPDATE tblRecords " +
                                "SET blnCamper=-1 " +
                                "WHERE lngRecordID=" + lngRes.ToString();

                        using (OleDbCommand cmdDB = new OleDbCommand(strSQL, conDB))
                        {
                            try { cmdDB.ExecuteNonQuery(); }
                            catch { }
                        }

                        conDB.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                clsErr.subLogErr("fcnGetWebRegIR", ex);
            }

            return lngRes;
        }