Пример #1
0
    public static void delete(string sqlDelete)
    {
        Oracle.DataAccess.Client.OracleCommand cmdDelete = new Oracle.DataAccess.Client.OracleCommand(sqlDelete, conn);

        cmdDelete.ExecuteNonQuery();
        cmdDelete.Dispose();
    }
Пример #2
0
    public static void insert(string sqlInsert)
    {
        Oracle.DataAccess.Client.OracleCommand cmdInsert = new Oracle.DataAccess.Client.OracleCommand(sqlInsert, conn);

        cmdInsert.ExecuteNonQuery();
        cmdInsert.Dispose();
    }
Пример #3
0
    public static void alter(string sqlAlter)
    {
        Oracle.DataAccess.Client.OracleCommand cmdAlter = new Oracle.DataAccess.Client.OracleCommand(sqlAlter, conn);

        cmdAlter.ExecuteNonQuery();
        cmdAlter.Dispose();
    }
Пример #4
0
        private void FillDataTypesNeeds()
        {
            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(Training_Source.TrainingClass.ConnectioString);
            Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand("BASDBA.PKG_Training.TrainingTypesNeedsRecordDesc", conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "header_record_id_", ViewState["Request_Record_ID"].ToString());
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "Step_4_record", "cursor", "out", "");

            DataSet mds = new DataSet();

            Oracle.DataAccess.Client.OracleDataAdapter da = new Oracle.DataAccess.Client.OracleDataAdapter(cmd);
            DataTable tbl = null;

            try
            {
                conn.Open();
                da.Fill(mds);
                tbl = mds.Tables[0];
                if (tbl.Rows.Count > 0)
                {
                    SetValue(txtSourseTraining, tbl.Rows[0]["source_of_training"].ToString());
                    SetValue(txtPurposeOfTraining, tbl.Rows[0]["purpose_of_training"].ToString());
                    SetValue(txtProgramCode, tbl.Rows[0]["program_code_description"].ToString());
                    SetValue(txtAccountNumber, tbl.Rows[0]["account_no"].ToString());
                    SetValue(txtDepartmentID, tbl.Rows[0]["dept_id"].ToString());
                    SetValue(txtAccomodation, tbl.Rows[0]["ee_need_accomodation"].ToString());
                    SetValue(txtAccomodationDescription, tbl.Rows[0]["accomodation_description"].ToString());
                    SetValue(txtAccomodationDescription, tbl.Rows[0]["accomodation_description"].ToString());
                    SetValue(txtPositionLevel, tbl.Rows[0]["position_level"].ToString());
                    SetValue(txTypeofAppointment, tbl.Rows[0]["type_of_appointment"].ToString());
                    SetValue(txtEducationLevel, tbl.Rows[0]["frm_education_level"].ToString());
                    SetValue(txtTrainingTypeCode, tbl.Rows[0]["frm_training_type_code"].ToString());
                    SetValue(txtTrainingSubTypeCode, tbl.Rows[0]["frm_training_sub_type_code"].ToString());
                    SetValue(txtDelivaryTypeCode, tbl.Rows[0]["training_delivery_type_code"].ToString());
                    SetValue(txtDesignationTypeCode, tbl.Rows[0]["training_designation_code"].ToString());
                    SetValue(txtCreditTypeCode, tbl.Rows[0]["training_credit_type_code"].ToString());
                    SetValue(txtAccredetionIndicator, tbl.Rows[0]["accredetion_indicator"].ToString());
                    SetValue(txtTrainingCredit, tbl.Rows[0]["training_credit"].ToString());
                    SetValue(txtTypeofDevelopmentOther182, tbl.Rows[0]["Type_Of_Development_Other"].ToString());
                    SetValue(txtTypeOfDevelopmentSummary, tbl.Rows[0]["TypeofDevelopment"].ToString());
                    if (txtTypeOfDevelopmentSummary.Text.Length > 2)
                    {
                        txtTypeOfDevelopmentSummary.Text = txtTypeOfDevelopmentSummary.Text.Substring(2);
                    }

                    txtAccomodationDescription.Visible = (txtAccomodation.Text == "Yes");
                    lblAccomodationDescription.Visible = txtAccomodationDescription.Visible;
                }
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                mds.Dispose();
                if (tbl != null)
                {
                    tbl.Dispose();
                }
            }
        }
Пример #5
0
		private void FillData()
		{
			if (ViewState["Request_Record_ID"].ToString()=="-1")
			{
				txtCourseCode.Text = "";
				txtCourseTitle.Text = "";
				txtLocation.Text = "";
				txtVedorName.Text = "";
				txtPhoneNumber.Text = "";
				txtFaxNumber.Text = "";
				txtAddressLine1.Text = "";
				txtAddressLine2.Text = "";
				txtCity.Text = "";
				ddlStates.SelectedIndex = 0;
				txtZipCode.Text = "";
				txtWebSite.Text = "";
				lblDescribtion.Text = "";
				return;
			}
			Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(PLA_Approval.TrainingClass.ConnectionString);
			Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand("BASDBA.PKG_Training.GetHeaderRecord",conn);
			cmd.CommandType = System.Data.CommandType.StoredProcedure;
			cmd.CommandTimeout = 30;
			SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "record_id_",ViewState["Request_Record_ID"].ToString());
			SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "header_record","cursor","out","");

			DataSet mds = new DataSet();
			Oracle.DataAccess.Client.OracleDataAdapter da = new Oracle.DataAccess.Client.OracleDataAdapter(cmd);
			DataTable tbl=null;
			try
			{
				conn.Open();
				da.Fill(mds);
				tbl=mds.Tables[0];
				txtCourseCode.Text = tbl.Rows[0]["course_code"].ToString();
				txtCourseTitle.Text = tbl.Rows[0]["course_title"].ToString();
				txtLocation.Text = tbl.Rows[0]["location_of_training"].ToString();
				txtVedorName.Text = tbl.Rows[0]["vendor_name"].ToString();
				txtVendorContact.Text = tbl.Rows[0]["vendor_contact"].ToString();
				txtPhoneNumber.Text = tbl.Rows[0]["vendor_phone_number"].ToString();
				txtFaxNumber.Text = tbl.Rows[0]["vendor_fax_number"].ToString();
				txtAddressLine1.Text = tbl.Rows[0]["vendor_address1"].ToString();
				txtAddressLine2.Text = tbl.Rows[0]["vendor_address2"].ToString();
				txtCity.Text = tbl.Rows[0]["vendor_city"].ToString();
				string strState = tbl.Rows[0]["vendor_state"].ToString();
				txtZipCode.Text = tbl.Rows[0]["vendor_zip_code"].ToString();
				txtWebSite.Text = tbl.Rows[0]["vendor_website"].ToString();
				if (tbl.Rows[0]["desription_of_course_value"].ToString().Length >100)
					lblDescribtion.Text = tbl.Rows[0]["desription_of_course_value"].ToString().Substring(0,95)+"...";
				else
					lblDescribtion.Text = tbl.Rows[0]["desription_of_course_value"].ToString();
				ViewState["application_status"]= tbl.Rows[0]["application_status"].ToString();
				ViewState["description"]=tbl.Rows[0]["description"].ToString();
				ViewState["Application_Processing_Year"]=tbl.Rows[0]["processing_year"].ToString();
				for (int i=0;i<ddlStates.Items.Count;i++)
					if (ddlStates.Items[i].Value==strState)
					{
						ddlStates.SelectedIndex = i;
						break;
					}
				txtState.Text=ddlStates.SelectedItem.Text;
				txtTrainingType.Text = tbl.Rows[0]["training_type"].ToString()=="1" ? "Within Employee’s Occupation" : "Outside Employee’s Occupation";
			}
			finally
			{
				conn.Close();
				conn.Dispose();
				cmd.Dispose();
				mds.Dispose();
				if (tbl != null)
					tbl.Dispose();
			}
			if (txtCourseCode.Text!="")
				lblCourseTitle.Text= txtCourseCode.Text+" - "+txtCourseTitle.Text;
			else
				lblCourseTitle.Text=txtCourseTitle.Text;
		}
        private void GetExistingData()
        {
            DataTable tbl = null;

            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(PLA_Approval.TrainingClass.ConnectionString);
            Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand("BASDBA.pkg_training.GetExpenseList", conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "record_id_", Request.Params["expid"]);
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "expenses_list_", "cursor", "out", "");

            DataSet mds = new DataSet();

            Oracle.DataAccess.Client.OracleDataAdapter da = new Oracle.DataAccess.Client.OracleDataAdapter(cmd);
            try
            {
                conn.Open();
                da.Fill(mds);
                tbl = mds.Tables[0];
                foreach (DataRow dr in tbl.Rows)
                {
                    txtExpenseName.Text    = dr["expense_type"].ToString();
                    lblAmount.Text         = Convert.ToDouble(dr["amount"].ToString()).ToString("$#,##0.00");
                    lblApprovedAmount.Text = Convert.ToDouble(dr["approved_amount"].ToString()).ToString("$#,##0.00");
                    lblPaidAmount.Text     = Convert.ToDouble(dr["Paid_amount"].ToString()).ToString("$#,##0.00");

                    if (Request.Params["w"] == "s")
                    {
                        txtApprovedAmount.Text    = dr["approved_amount"].ToString();
                        txtApprovedAmount.Visible = true;
                        lblApprovedAmount.Visible = false;
                    }
                    else
                    {
                        txtPaidAmount.Text    = dr["approved_amount"].ToString();
                        txtPaidAmount.Visible = true;
                        lblPaidAmount.Visible = false;
                    }

                    txtDescription.Text = dr["note"].ToString();
                    ListItem li0 = new ListItem("--Select--", " ");
                    ddlExpenseType.Items.Add(li0);
                    if (dr["expense_type_ID"].ToString() != "1000")
                    {
                        ListItem li = new ListItem(txtExpenseName.Text, dr["expense_type_ID"].ToString());
                        ddlExpenseType.Items.Add(li);
                    }
                    for (int i = 0; i < ddlExpenseType.Items.Count; i++)
                    {
                        if (ddlExpenseType.Items[i].Value == dr["expense_type_ID"].ToString())
                        {
                            ddlExpenseType.SelectedIndex = i;
                            break;
                        }
                    }
                    txtVedorName.Text     = dr["vendor_name"].ToString();
                    txtVendorContact.Text = dr["vendor_contact_name"].ToString();
                    txtAddressLine1.Text  = dr["vendor_address_1"].ToString();
                    txtAddressLine2.Text  = dr["vendor_address2"].ToString();
                    txtCity.Text          = dr["vendor_city"].ToString();
                    string strState = dr["vendor_state"].ToString();
                    txtZipCode.Text     = dr["vendor_zip"].ToString();
                    txtPhoneNumber.Text = dr["vendor_phone"].ToString();
                    txtFaxNumber.Text   = dr["vendor_fax"].ToString();
                    txtemail.Text       = dr["vendor_email"].ToString();
                    txtProvince.Text    = dr["province"].ToString();
                    string strCountry = dr["country_code"].ToString();

                    foreach (ListItem li in ddlContries.Items)
                    {
                        li.Selected = li.Value == strCountry;
                    }

                    for (int i = 0; i < ddlStates.Items.Count; i++)
                    {
                        if (ddlStates.Items[i].Value == strState)
                        {
                            ddlStates.SelectedIndex = i;
                            break;
                        }
                    }
                    ddlExpenseType_SelectedIndexChanged(null, null);
                    txtExpenseName.Text = dr["expense_type"].ToString();
                }
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                mds.Dispose();
                tbl.Dispose();
            }
            setCountryFields();
        }
Пример #7
0
        private void FillData()
        {
            if (ViewState["Request_Record_ID"].ToString() == "-1")
            {
                txtCourseCode.Text       = "";
                txtCourseTitle.Text      = "";
                txtVedorName.Text        = "";
                txtPhoneNumber.Text      = "";
                txtFaxNumber.Text        = "";
                txtAddressLine1.Text     = "";
                txtAddressLine2.Text     = "";
                txtCity.Text             = "";
                ddlStates.SelectedIndex  = 0;
                txtZipCode.Text          = "";
                txtWebSite.Text          = "";
                txtEmail.Text            = "";
                txtDescribtion.Text      = "";
                txtProvince.Text         = "";
                txtLearningProvince.Text = "";
                SetValue(ddlContries, "USA");
                SetValue(ddlTrainingContries, "USA");
                SQLStatic.Sessions.SetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "CoursePY", ViewState["Processing_Year"].ToString(), Data.ConnectioString);
                Data.FillBudgetYears(ddlBudgetYear, lblBalance, ViewState["Employee_Number"].ToString(), ViewState["Processing_Year"].ToString());
                ddlContries_SelectedIndexChanged(null, null);
                ddlTrainingContries_SelectedIndexChanged(null, null);
                return;
            }
            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(Data.ConnectioString);
            Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand("BASDBA.PKG_Training.GetHeaderRecord", conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "record_id_", ViewState["Request_Record_ID"].ToString());
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "header_record", "cursor", "out", "");

            DataSet mds = new DataSet();

            Oracle.DataAccess.Client.OracleDataAdapter da = new Oracle.DataAccess.Client.OracleDataAdapter(cmd);
            DataTable tbl   = null;
            string    strPY = "";

            try
            {
                conn.Open();
                da.Fill(mds);
                tbl = mds.Tables[0];
                SetValue(txtCourseCode, tbl.Rows[0]["course_code"].ToString());
                SetValue(txtCourseTitle, tbl.Rows[0]["course_title"].ToString());
                SetValue(txtVedorName, tbl.Rows[0]["vendor_name"].ToString());
                SetValue(txtVendorContact, tbl.Rows[0]["vendor_contact"].ToString());
                SetValue(txtPhoneNumber, stripPhoneNumber(tbl.Rows[0]["vendor_phone_number"].ToString()));
                SetValue(txtFaxNumber, stripPhoneNumber(tbl.Rows[0]["vendor_fax_number"].ToString()));
                SetValue(txtAddressLine1, tbl.Rows[0]["vendor_address1"].ToString());
                SetValue(txtAddressLine2, tbl.Rows[0]["vendor_address2"].ToString());
                SetValue(txtCity, tbl.Rows[0]["vendor_city"].ToString());
                SetValue(ddlStates, tbl.Rows[0]["vendor_state"].ToString());
                SetValue(txtZipCode, tbl.Rows[0]["vendor_zip_code"].ToString());
                SetValue(txtWebSite, tbl.Rows[0]["vendor_website"].ToString());
                SetValue(txtEmail, tbl.Rows[0]["vendor_email"].ToString());
                SetValue(txtDescribtion, tbl.Rows[0]["desription_of_course_value"].ToString());
                SetValue(txtLearningAddress1, tbl.Rows[0]["training_address1"].ToString());
                SetValue(txtLearningAddress2, tbl.Rows[0]["training_address2"].ToString());
                SetValue(txtLearningCity, tbl.Rows[0]["training_city"].ToString());
                SetValue(txtProvince, tbl.Rows[0]["province"].ToString());
                SetValue(ddlLearningState, tbl.Rows[0]["training_state"].ToString());
                SetValue(ddlContries, tbl.Rows[0]["country_code"].ToString());
                SetValue(ddlTrainingContries, tbl.Rows[0]["training_country_code"].ToString());
                SetValue(txtLearningZipCode, tbl.Rows[0]["training_zip"].ToString());
                SetValue(txtLearningProvince, tbl.Rows[0]["training_province"].ToString());
                ViewState["application_status"] = tbl.Rows[0]["application_status"].ToString();
                ViewState["description"]        = tbl.Rows[0]["description"].ToString();
                strPY             = tbl.Rows[0]["processing_year"].ToString();
                ViewState["Book"] = tbl.Rows[0]["book_request"].ToString();
                if (ViewState["Book"].ToString() == "1")
                {
                    SetupForBook();
                    txtBookCost.Text = tbl.Rows[0]["BookAmount"].ToString();
                    txtDeptID.Text   = tbl.Rows[0]["dept_id"].ToString();
                }
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                mds.Dispose();
                if (tbl != null)
                {
                    tbl.Dispose();
                }
            }
            txtRemaining.Text = (4000 - txtDescribtion.Text.Length).ToString();
            if (txtCourseCode.Text != "")
            {
                lblCourseTitle.Text = txtCourseCode.Text + " - " + txtCourseTitle.Text + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Request For: " + SQLStatic.EmployeeData.employee_name_(ViewState["Employee_Number"].ToString());
            }
            else
            {
                lblCourseTitle.Text = txtCourseTitle.Text + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Request For: " + SQLStatic.EmployeeData.employee_name_(ViewState["Employee_Number"].ToString());
            }
            SQLStatic.Sessions.SetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "CoursePY", strPY, Data.ConnectioString);
            Data.FillBudgetYears(ddlBudgetYear, lblBalance, ViewState["Employee_Number"].ToString(), strPY);
            ddlContries_SelectedIndexChanged(null, null);
            ddlTrainingContries_SelectedIndexChanged(null, null);
        }
Пример #8
0
        private DataTable GetTable()
        {
            DataTable tbl = null;
            string    strProcedureName = "";

            if ((Request.Params["who"] != null) && (Request.Params["who"] == "pla_admin"))
            {
                strProcedureName = "pkg_training_2.EmployeesList_adin";
                if (chkTerminated.Checked)
                {
                    strProcedureName = "pkg_training_2.EmployeesList_adin_withterm";
                }
            }
            else if ((Request.Params["who"] != null) && (Request.Params["who"] == "pla_adminee"))
            {
                strProcedureName = "pkg_training_2.EmployeesList_adin";
                if (chkTerminated.Checked)
                {
                    strProcedureName = "pkg_training_2.EmployeesList_adin_withterm";
                }
            }
            else if ((Request.Params["who"] != null) && (Request.Params["who"] == "Super"))
            {
                strProcedureName = "pkg_training_3.supervisorslist";
            }
            else
            {
                strProcedureName = "pkg_training_2.employeeslist";
                if (chkTerminated.Checked)
                {
                    strProcedureName = "pkg_training_2.employeeslistwithterminated";
                }
            }

            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(ConnectionString);
            Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand(strProcedureName, conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            if ((Request.Params["who"] != null) && (Request.Params["who"] == "pla_adminee"))
            {
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "search_name_", txtSearch.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "admin_ee_number", "number", "in", ViewState["Employee_Number"].ToString());
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "retresult_", "cursor", "out", "");
            }
            else if ((Request.Params["who"] != null) && (Request.Params["who"] == "pla_admin"))
            {
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "admin_ee_number", "number", "in", ViewState["Employee_Number"].ToString());
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "retresult_", "cursor", "out", "");
            }
            else if ((Request.Params["who"] != null) && (Request.Params["who"] == "Super"))
            {
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "searchfor_", txtSearch.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "accountnumber_", ViewState["Selected_Account_Number"].ToString());
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "retresult_", "cursor", "out", "");
            }
            else
            {
                string strShow_cannot_access = "0";
                if (chbShowCannotAccess.Checked)
                {
                    strShow_cannot_access = "1";
                }
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "search_name_", txtSearch.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "Show_cannot_access_", strShow_cannot_access);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "retresult_", "cursor", "out", "");
            }

            DataSet mds = new DataSet();

            Oracle.DataAccess.Client.OracleDataAdapter da = new Oracle.DataAccess.Client.OracleDataAdapter(cmd);

            try
            {
                conn.Open();
                da.Fill(mds);
                tbl = mds.Tables[0];
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                mds.Dispose();
            }
            FilterTable(tbl);
            //---- commeted out per Art Email Re: PLA Manager Search Results Fri 6/10/2016 12:58 PM

            //foreach (DataRow dr in tbl.Rows)
            //{
            //    if (!dr["email_number"].ToString().ToUpper().EndsWith("@FDIC.GOV"))
            //        dr.Delete();
            //}
            //tbl.AcceptChanges();
            if (tbl.Rows.Count > 10)
            {
                for (int i = 10; i <= tbl.Rows.Count - 1; i++)
                {
                    tbl.Rows[i].Delete();
                }
                tbl.AcceptChanges();
            }
            return(tbl);
        }
Пример #9
0
    public static bool isExist(string table, string where)
    {
        string cmdQuery = "select * from " + table + " where " + where;

        Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand(cmdQuery, conn);
        Oracle.DataAccess.Client.OracleDataReader reader = cmd.ExecuteReader();

        while (reader.Read())
        {
            reader.Close();
            cmd.Dispose();

            return true;
        }

        reader.Close();
        cmd.Dispose();

        return false;
    }
Пример #10
0
    public static string selectStr(string cmdQuery, string nullValue)
    {
        Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand(cmdQuery, conn);
        Oracle.DataAccess.Client.OracleDataReader reader = cmd.ExecuteReader();

        string value = nullValue;
        while (reader.Read())
            value = reader.GetString(0);

        reader.Close();
        cmd.Dispose();

        return value;
    }
Пример #11
0
    public static long selectLong(string cmdQuery, long nullValue)
    {
        Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand(cmdQuery, conn);
        Oracle.DataAccess.Client.OracleDataReader reader = cmd.ExecuteReader();

        long value = nullValue;
        while (reader.Read())
            value = System.Int32.Parse(reader.GetValue(0).ToString());

        reader.Close();
        cmd.Dispose();

        return value;
    }
Пример #12
0
    public static System.Collections.Generic.List<string> selectListStr(string cmdQuery)
    {
        System.Collections.Generic.List<string> list = new System.Collections.Generic.List<string>();

        Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand(cmdQuery, conn);
        Oracle.DataAccess.Client.OracleDataReader reader = cmd.ExecuteReader();

        while (reader.Read())
            list.Add(reader.GetString(0));

        reader.Close();
        cmd.Dispose();

        return list;
    }
Пример #13
0
    public static System.Collections.Generic.List<int> selectListInt(string cmdQuery)
    {
        System.Collections.Generic.List<int> list = new System.Collections.Generic.List<int>();

        Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand(cmdQuery, conn);
        Oracle.DataAccess.Client.OracleDataReader reader = cmd.ExecuteReader();

        while (reader.Read())
            list.Add(System.Int32.Parse(reader.GetValue(0).ToString()));

        reader.Close();
        cmd.Dispose();

        return list;
    }
Пример #14
0
        public bool CaptureTIS(IList <TISDataModel> models)
        {
            try
            {
                using (var connection = new Oracle.DataAccess.Client.OracleConnection(DataContextConnectionString))

                    using (var command = new Oracle.DataAccess.Client.OracleCommand())
                    {
                        if (connection.State != ConnectionState.Open)
                        {
                            connection.Open();
                        }

                        var tisObjects = models.Select(
                            model => new TISType
                        {
                            //ID = model.ID,
                            REFERENCE_NUMBER            = model.ReferenceNumber,
                            VEHICLE_REGISTRATION_NUMBER = model.VehicleRegistrationNumber,
                            VEHICLE_MAKE_ID             = model.VehicleMakeID,
                            VEHICLE_MAKE        = model.VehicleMake,
                            VEHICLE_MODEL_ID    = model.VehicleModelID,
                            VEHICLE_MODEL       = model.VehicleModel,
                            VEHICLE_TYPE_ID     = model.VehicleTypeID,
                            VEHICLE_TYPE        = model.VehicleType,
                            VEHICLE_USAGE_ID    = model.VehicleUsageID,
                            VEHICLE_COLOUR_ID   = model.VehicleColourID,
                            YEAR_OF_MAKE        = model.YearOfMake,
                            LICENSE_EXPIRE_DATE = model.LicenseExpireDate,
                            CLEARENCE_CERT_NO   = model.ClearanceCertificateNumber,
                            OWNER_ID            = model.OwnerID,
                            OWNER_ID_TYPE       = model.OwnerIDType,
                            OWNER_NAME          = model.OwnerName,
                            OWNER_INIT          = model.OwnerInitials,
                            OWNER_SURNAME       = model.Surname,
                            OWNER_GENDER        = model.OwnerGender,
                            OWNER_POSTAL        = model.OwnerPostal,
                            OWNER_POSTAL_STREET = model.OwnerPostalStreet,
                            OWNER_POSTAL_SUBURB = model.OwnerPostalSuburb,
                            OWNER_POSTAL_TOWN   = model.OwnerPostalTown,
                            OWNER_POSTAL_CODE   = model.PostalCode,
                            OWNER_PHYS          = model.OwnerPhysical,
                            OWNER_PHYS_STREET   = model.OwnerPhysicalStreet,
                            OWNER_PHYS_SUBURB   = model.OwnerPhysicalSuburb,
                            OWNER_PHYS_TOWN     = model.OwnerPhysicalTown,
                            OWNER_PHYS_CODE     = model.PhysicalCode,
                            OWNER_TELEPHONE     = model.OwnerTelephone,
                            OWNER_CELLPHONE     = model.OwnerCellphone,
                            OWNER_COMPANY       = model.OwnerCompany,
                            DATE_OF_OWNERSHIP   = model.DateOfOwnership,
                            IMPORT_FILE_NAME    = model.ImportFileName,
                            NATURE_OF_OWNERSHIP = model.NatureOfOwnership,
                            PROXY_INDICATOR     = model.ProxyIndicator,
                            EMAIL_ADDRESS       = model.EmailAddress,
                        })
                                         .ToList();

                        var par = new Oracle.DataAccess.Client.OracleParameter("P_CREDENTIAL_ID", _credentialID);
                        par.Direction    = ParameterDirection.Input;
                        par.OracleDbType = Oracle.DataAccess.Client.OracleDbType.Int32;
                        command.Parameters.Add(par);

                        var param =
                            new Oracle.DataAccess.Client.OracleParameter("P_TABLE_NATIS_VEH_DETAIL_TYPE", Oracle.DataAccess.Client.OracleDbType.Array)
                        {
                            Value       = tisObjects.ToArray(),
                            UdtTypeName = "ITS.TABLE_NATIS_VEH_DETAIL_TYPE"
                        };
                        command.Parameters.Add(param);


                        //par = new Oracle.DataAccess.Client.OracleParameter();
                        //par.ParameterName = "O_MESSAGE";
                        //par.Direction = ParameterDirection.Output;
                        //par.OracleDbType = Oracle.DataAccess.Client.OracleDbType.Varchar2;
                        //par.Size = 4000;
                        //command.Parameters.Add(par);

                        command.BindByName = true;
                        try
                        {
                            ExcecuteNonQuery(command, "ITS.INFO_HANDLING.CAPTURE_NATIS", connection);

                            //if (!(command.Parameters["O_MESSAGE"].Value is DBNull))
                            //{
                            //    var isSuccessful = command.Parameters["O_MESSAGE"].Value.ToString();
                            //}
                        }
                        catch (Exception ex)
                        {
                            _error = ex.Message;
                            ErrorCheckFriendly();
                            return(false);
                        }
                        finally
                        {
                            command.Dispose();
                        }
                    }
            }
            catch (Exception e)
            {
                _error = e.Message;
                ErrorCheckFriendly();
                return(false);
            }

            return(true);
        }
Пример #15
0
        private void GetInvolvedEmployeesData()
        {
            string strProcedureName = "basdba.PKG_Training.Get_Possible_CommEEs";

            if (ViewState["Product_Code"].ToString() == "11001")
            {
                strProcedureName = "basdba.PKG_Training_cdp.Get_Possible_CommEEs";
            }

            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(PLA_Approval.TrainingClass.ConnectionString);
            Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand(strProcedureName, conn);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            conn.Open();
            try
            {
                int intFileLen = txtMemo.Text.Length;
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "Communication_record_id_", "number", "in", Request.Params["indx"]);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "user_employee_number_", "number", "in", ViewState["Employee_Number"].ToString());

                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "sprvsr_employee_number_", "varchar2", "out", "");
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "sprvsr_name_", "varchar2", "out", "");

                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "payor_employee_number_", "varchar2", "out", "");
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "payor_name_", "varchar2", "out", "");

                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "applicant_employee_number_", "varchar2", "out", "");
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "applicant_name_", "varchar2", "out", "");

                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "from_employee_number_", "varchar2", "out", "");
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "from_name_", "varchar2", "out", "");
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "from_position_", "varchar2", "out", "");

                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "to_employee_number_", "varchar2", "out", "");
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "to_name_", "varchar2", "out", "");
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "to_position_", "varchar2", "out", "");

                cmd.ExecuteNonQuery();

                lblFromPosition.Text = cmd.Parameters["from_position_"].Value.ToString();
                lblFromName.Text     = cmd.Parameters["from_name_"].Value.ToString();

                lblToPosition.Text = cmd.Parameters["to_position_"].Value.ToString();
                lblToName.Text     = cmd.Parameters["to_name_"].Value.ToString();

                chklstEmailTo.Items.Clear();
                if (cmd.Parameters["sprvsr_employee_number_"].Value != null)
                {
                    AddItemToSelection("Supervisor", cmd.Parameters["sprvsr_employee_number_"].Value.ToString(), cmd.Parameters["sprvsr_name_"].Value.ToString());
                }
                if (cmd.Parameters["payor_employee_number_"].Value != null)
                {
                    AddItemToSelection("Administrator", cmd.Parameters["payor_employee_number_"].Value.ToString(), cmd.Parameters["payor_name_"].Value.ToString());
                }
                if (cmd.Parameters["applicant_employee_number_"].Value != null)
                {
                    AddItemToSelection("Applicant", cmd.Parameters["applicant_employee_number_"].Value.ToString(), cmd.Parameters["applicant_name_"].Value.ToString());
                }
            }
            finally
            {
                cmd.Dispose();
                conn.Close();
                conn.Dispose();
            }
        }