Exemplo n.º 1
0
        public void insertMessengerRecordIntoDB(string filePath, string startTime, string endTime, int portNumber)
        {
            try
            {
                // 오라클 연결
                conn = new Oracle.DataAccess.Client.OracleConnection(connectionInfo);
                conn.Open();

                //명령 실행을 위한 커맨드 객체 생성
                Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand();
                cmd.Connection = conn;

                // SQL문 지정 및 INSERT 실행
                cmd.CommandText = "insert into KBJ_MESSENGER(start_time, end_time, file_path, port_number) " +
                                  "values(TO_DATE('" + startTime + "', 'YYYY.MM.DD-HH24:MI:SS')," +
                                  " TO_DATE('" + endTime + "', 'YYYY.MM.DD-HH24:MI:SS'), '" +
                                  filePath + "', " + portNumber + " )";
                cmd.ExecuteNonQuery();
                conn.Close();
            }
            catch (Exception)
            {
                MessageBox.Show(LanguageResource.language_res.strExceptionMessageDBInsertFailed);
            }
            finally
            {
                conn.Close();
            }
        }
        private bool GetDataFromSession()
        {
            Oracle.DataAccess.Client.OracleConnection conn = SQLStatic.SQL.OracleConnection();
            try
            {
                lblTrustor.Text = SQLStatic.AccountData.Master_Account_Name(ViewState["Selected_Account_Number"].ToString(), conn);
                DataTable tbl = Data.AccountAndEmployeeNames(session_id, conn);
                lblEmployerName.Text = tbl.Rows[0]["account"].ToString();
                lblClass.Text        = tbl.Rows[0]["description"].ToString();
                lblAddress1.Text     = tbl.Rows[0]["address1"].ToString();
                if (!string.IsNullOrEmpty(tbl.Rows[0]["address2"].ToString()))
                {
                    lblAddress1.Text += "<br />" + tbl.Rows[0]["address2"].ToString();
                }
                lblAddress1.Text += "<br />" + tbl.Rows[0]["city"].ToString();

                lblSavedSuccessfully.Text = tbl.Rows[0]["employee_name"].ToString();
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            return(true);
        }
Exemplo n.º 3
0
        public string First_step_in_wizard()
        {
            string FirststepinWiz = null;
            string sessID         = Request.Cookies["Session_ID"].Value.ToString();

            // create the command for the function
            Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand();
            Oracle.DataAccess.Client.OracleConnection conn =
                new Oracle.DataAccess.Client.OracleConnection(Training_Source.TrainingClass.ConnectioString);
            cmd.Connection     = conn;
            cmd.CommandText    = "pkg_wizard.First_step_in_wizard";
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            cmd.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("session_id_", Oracle.DataAccess.Client.OracleDbType.Varchar2, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, sessID));
            cmd.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("first_step_id_", Oracle.DataAccess.Client.OracleDbType.Double, 20, System.Data.ParameterDirection.Output, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
            cmd.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("first_step_url_", Oracle.DataAccess.Client.OracleDbType.Varchar2, 255, System.Data.ParameterDirection.Output, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
            // execute the function
            conn.Open();
            cmd.ExecuteNonQuery();
            FirststepinWiz = Convert.ToString(cmd.Parameters[2].Value);
            cmd.Dispose();
            conn.Close();
            conn.Dispose();
            return(FirststepinWiz);
        }
        private bool DoSave()
        {
            string strProcedureName = "basdba.PKG_Training.SupervisorCancelRequest";

            if (Request.Params["who"] == "payor")
            {
                strProcedureName = "basdba.PKG_Training.AdministratorCancelRequest";
            }
            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();
            bool blnOk = true;

            try
            {
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "record_id_", "number", "in", ViewState["Request_Record_ID"].ToString());
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "reason_", "varchar2", "in", txtOther.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "user_id_", "varchar2", "in", ViewState["User_Name"].ToString());
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "error_msg_", "varchar2", "out", "");
                cmd.ExecuteNonQuery();
                if ((cmd.Parameters["error_msg_"].Value != null) && (cmd.Parameters["error_msg_"].Value.ToString() != ""))
                {
                    blnOk = false;
                    ShowError(cmd.Parameters["error_msg_"].Value.ToString());
                }
            }
            finally
            {
                cmd.Dispose();
                conn.Close();
                conn.Dispose();
            }
            return(blnOk);
        }
        private DataTable GetTable()
        {
            DataTable tbl = null;

            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(ConnectionString);
            Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand("pkg_training_2.employeeslist_sup", conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "admin_ee_number", "number", "in", ViewState["Employee_Number"].ToString());
            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();
            }
            return(tbl);
        }
Exemplo n.º 6
0
        private void SaveLife(DataRow dr)
        {
            Oracle.DataAccess.Client.OracleConnection conn = SQLStatic.SQL.OracleConnection();
            try
            {
                SQLStatic.Sessions.SetSessionValue(session_id, "Account_Number", dr["account_number"].ToString(), conn);
                SQLStatic.Sessions.SetSessionValue(session_id, "Employee_number", dr["employee_number"].ToString(), conn);
                SQLStatic.Sessions.SetSessionValue(session_id, "Category_Code", dr["category_code"].ToString(), conn);
                SQLStatic.Sessions.SetSessionValue(session_id, "Category_Plan", dr["category_plan"].ToString(), conn);
                SQLStatic.Sessions.SetSessionValue(session_id, "Family_Status_Code", dr["family_status_code"].ToString(), conn);
                SQLStatic.Sessions.SetSessionValue(session_id, "BENEFIT_LEVEL", dr["raw_multiplier_override"].ToString(), conn);
                SQLStatic.Sessions.SetSessionValue(session_id, "BENEFIT_AMOUNT", dr["raw_multiplier_override"].ToString(), conn);
                SQLStatic.Sessions.SetSessionValue(session_id, "Effective_date", ViewState["deffectiveDate"].ToString(), conn);

                SQLStatic.Sessions.SetSessionValue(session_id, "Skip", "1", conn);
                Data.CheckEnrollmentType(session_id, dr["record_id"].ToString());
                Data.SaveLifeCoverage(session_id, conn);
                Data.ProcessPendCoverages(session_id, dr["cvrg_group_header_id"].ToString(), "1", conn);
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Oracle.DataAccess.Client.OracleConnection conn = SQLStatic.SQL.OracleConnection();
            try
            {
                foreach (ListItem li in cblEnrollmentType.Items)
                {
                    if (li.Selected)
                    {
                        foreach (ListItem lia in cblAccounts.Items)
                        {
                            if (lia.Selected)
                            {
                                Data.SaveMessageData(session_id, li.Value, rblItem.SelectedValue, lia.Value, textDescription.Text, RadEditor1.Content, conn);
                            }
                        }
                    }
                }
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            rblMode.SelectedIndex = 0;
            dvEdit.Visible        = rblMode.SelectedValue.Equals("1");
            dvView.Visible        = !dvEdit.Visible;
            GetText();
            string strDone = "<script>alert('Saved Successfully !')</script>";

            Page.ClientScript.RegisterStartupScript(Page.GetType(), "strDone", strDone);
        }
        private void DoSave()
        {
            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.CancelPaidRequest", conn);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            try
            {
                string strUserID = "";
                if (ViewState["User_Name"] != null)
                {
                    strUserID = ViewState["User_Name"].ToString();
                }
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "record_id_", "number", "in", ViewState["Request_Record_ID"].ToString());
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "reason_", "varchar2", "in", txtReason.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "user_id_", "varchar2", "in", strUserID);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "error_msg_", "varchar2", "out", null);
                conn.Open();
                cmd.ExecuteNonQuery();
            }

            finally
            {
                cmd.Dispose();
                conn.Close();
                conn.Dispose();
            }
        }
        protected void btnYes_Click(object sender, EventArgs e)
        {
            txtTerminationDate.Text = stripDate(txtTerminationDate.Text);
            Validate();
            if (!IsValid)
            {
                return;
            }
            DoSave(null);
            string strCallCloseWindow = "<script>closeWindow(1)</script>";
            string strSession         = Request.Cookies["Session_ID"].Value.ToString();

            if ((ViewState["Is_COBRA"].ToString() == "T") && (ddlReason.SelectedItem.Text.IndexOf("COBRA") != -1) && (ViewState["dep_id"].ToString() != "-1"))
            {
                strCallCloseWindow = "<script>closeWindow(10)</script>";
                Oracle.DataAccess.Client.OracleConnection conn = SQLStatic.SQL.OracleConnection();
                SQLStatic.Sessions.SetSessionValue(strSession, "TYPE", "QELD_2");
                SQLStatic.Sessions.SetSessionValue(strSession, "GO_URL", "/web_projects/Dependents_Maintenance/Default.aspx?SkipCheck=YES");
                SQLStatic.Sessions.SetSessionValue(strSession, "ACCOUNT_NUMBER", ViewState["Account_Number"].ToString());
                SQLStatic.Sessions.SetSessionValue(strSession, "EMPLOYEE_NUMBER", ViewState["Employee_Number"].ToString());
                SQLStatic.Sessions.SetSessionValue(strSession, "DEPENDENT_NUMBER", ViewState["dep_id"].ToString());
                conn.Close();
                conn.Dispose();
            }
            btnCancel_Click(null, null);
            //Page.ClientScript.RegisterStartupScript(Page.GetType(), "strCallCloseWindow", strCallCloseWindow);
        }
        private void FillExpenseType()
        {
            ddlExpenseType.Items.Clear();
            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.GetExpenseTypes", 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, "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)
                {
                    ListItem li = new ListItem(dr["description"].ToString(), dr["record_id"].ToString());
                    ddlExpenseType.Items.Add(li);
                }
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                mds.Dispose();
                tbl.Dispose();
            }
        }
Exemplo n.º 11
0
        private DataTable GetGridTable()
        {
            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("pkg_trn_budget.budget_detail_list", conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "employee_number_", Request.Params["ee"]);
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "processing_year_", ddlBudgetYear.SelectedItem.Text);
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "budget_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];
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                mds.Dispose();
            }
            return(tbl);
        }
Exemplo n.º 12
0
        private bool DoSave()
        {
            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(Training_Source.TrainingClass.ConnectioString);
            conn.Open();
            Oracle.DataAccess.Client.OracleTransaction txn = conn.BeginTransaction();
            bool blnOk = true;

            try
            {
                for (int i = 0; i < chklstEmailTo.Items.Count; i++)
                {
                    if (chklstEmailTo.Items[i].Selected)
                    {
                        SaveOne(conn, chklstEmailTo.Items[i].Value);
                    }
                }
                txn.Commit();
            }
            catch
            {
                txn.Rollback();
                blnOk = false;
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            return(blnOk);
        }
Exemplo n.º 13
0
        private void GetInvolvedEmployeesData()
        {
            txtMemo.Text       = "";
            lblReplayFrom.Text = Training_Source.TrainingClass.Employee_Name(ViewState["Employee_Number"].ToString());
            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.Get_Possible_CommEEs", conn);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            conn.Open();
            try
            {
                int intFileLen = txtMemo.Text.Length;
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "Communication_record_id_", "number", "in", ViewState["comm_record_id"].ToString());
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "user_employee_number_", "number", "in", ViewState["Employee_Number"].ToString());

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

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

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

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

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

                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();
            }
        }
        private DataTable GetExpenseTable()
        {
            DataTable tbl = null;

            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.GetEmployeeExpenses", 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, "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];
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                mds.Dispose();
            }
            return(tbl);
        }
 private void DoDelete()
 {
     if (!Training_Source.TrainingClass.IsReadOnly(Request.Cookies["Session_ID"].Value.ToString()))
     {
         string strProcedure = "basdba.PKG_Training.deleteExpense";
         if (Request.Params["Admin"] == "YES")
         {
             strProcedure = "basdba.PKG_Training.deleteExpense_Admin";
         }
         string strIndex = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "deleteIndex", Training_Source.TrainingClass.ConnectioString);
         SQLStatic.Sessions.SetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "deleteIndex", "", Training_Source.TrainingClass.ConnectioString);
         Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(Training_Source.TrainingClass.ConnectioString);
         Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand(strProcedure, conn);
         cmd.CommandType    = System.Data.CommandType.StoredProcedure;
         cmd.CommandTimeout = 30;
         try
         {
             SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "record_id_", "number", "in", strIndex);
             SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "user_id_", "varchar2", "in", ViewState["User_Name"].ToString());
             conn.Open();
             cmd.ExecuteNonQuery();
         }
         finally
         {
             conn.Close();
             conn.Dispose();
             cmd.Dispose();
         }
     }
 }
        private bool DoSave()
        {
            bool            blnSaved = true;
            DataTable       tbl      = (DataTable)dgQA.DataSource;
            RadioButtonList opnlst;
            string          strID;

            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(Training_Source.TrainingClass.ConnectioString);
            conn.Open();
            Oracle.DataAccess.Client.OracleTransaction txn = conn.BeginTransaction();
            try
            {
                foreach (DataRow dr in tbl.Rows)
                {
                    strID  = "opn_" + dr["record_id"].ToString();
                    opnlst = Getopnlst(this, strID);
                    SaveOne(conn, dr["record_id"].ToString(), opnlst.SelectedValue);
                    opnlst = null;
                }
                SaveFinalizeEvaluation(conn);
                txn.Commit();
            }
            catch
            {
                txn.Rollback();
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }

            return(blnSaved);
        }
        private void GetCDAnswerList()
        {
            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_trn_fdic.get_evaluation_cd_answr", conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "questions_list_", "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];
                foreach (DataRow dr in tbl.Rows)
                {
                    ListItem li = new ListItem(dr["answer"].ToString(), dr["record_id"].ToString());
                    lbAnweres.Items.Add(li);
                }
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                mds.Dispose();
                if (tbl != null)
                {
                    tbl.Dispose();
                }
            }
        }
        private DataTable GetDataTable()
        {
            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_trn_fdic.get_evaluation_questions", conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "questions_list_", "cursor", "out", "");
            DataSet mds = new DataSet();

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

            try
            {
                conn.Open();
                da.Fill(mds);
                tbl = mds.Tables[0];
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                mds.Dispose();
            }
            return(tbl);
        }
Exemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            session_id = Request.Cookies["Session_ID"].Value.ToString();
            string ser_Group = SQLStatic.Sessions.GetUserGroupID(session_id);

            lblSelectedaaccount.Text = SQLStatic.Sessions.GetAccountNumber(session_id);
            if (!string.IsNullOrEmpty(lblSelectedaaccount.Text))
            {
                lblSelectedaaccount.Text = SQLStatic.AccountData.AccountName(lblSelectedaaccount.Text) + "   " + lblSelectedaaccount.Text;
            }
            string user_Group = SQLStatic.Sessions.GetUserGroupID(session_id);

            btnGo.Enabled = !lblSelectedaaccount.Text.EndsWith("0000424-0000-000");
            if (ser_Group.Equals("2"))
            {
                Oracle.DataAccess.Client.OracleConnection conn = SQLStatic.SQL.OracleConnection();
                try
                {
                    SQLStatic.Sessions.SetSessionValue(session_id, "NH_EMPLOYEE_NUMBER", "0", conn);
                    SQLStatic.Sessions.SetSessionValue(session_id, "2NDTITLE", "", conn);
                    Data.Clear_Session_Data(session_id, conn);
                }
                finally
                {
                    conn.Close();
                    conn.Dispose();
                }
                Response.Redirect("Account_Division_Class_PaySchedule.aspx", true);
            }
            else if (ser_Group.Equals("4"))
            {
                Oracle.DataAccess.Client.OracleConnection conn = SQLStatic.SQL.OracleConnection();
                try
                {
                    SQLStatic.Sessions.SetSessionValue(session_id, "NH_EMPLOYEE_NUMBER", "0", conn);
                    SQLStatic.Sessions.SetSessionValue(session_id, "2NDTITLE", "", conn);
                    Data.Clear_Session_Data(session_id, conn);
                }
                finally
                {
                    conn.Close();
                    conn.Dispose();
                }
            }
            else
            {
                Oracle.DataAccess.Client.OracleConnection conn = SQLStatic.SQL.OracleConnection();
                try
                {
                    SQLStatic.Sessions.SetSessionValue(session_id, "NH_EMPLOYEE_NUMBER", "0", conn);
                    SQLStatic.Sessions.SetSessionValue(session_id, "2NDTITLE", "", conn);
                    Data.Clear_Session_Data(session_id, conn);
                }
                finally
                {
                    conn.Close();
                    conn.Dispose();
                }
            }
        }
        private DataTable GetTable3()
        {
            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.employee_Number_List3", conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "record_id_", ViewState["Employee_Number"].ToString());
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "search_name_", txtSearch.Text.Replace("'", "''"));
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "emails_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];
                RemoveSupervisor(tbl);
                CleanUpTable(tbl);
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                mds.Dispose();
            }
            return(tbl);
        }
        private bool DoSave()
        {
            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(PLA_Approval.TrainingClass.ConnectionString);
            conn.Open();
            bool blnOk = true;

            Oracle.DataAccess.Client.OracleTransaction txn = conn.BeginTransaction();
            try
            {
                SaveApproval(conn);
                SaveCSA(conn);
                txn.Commit();
            }
            catch
            {
                txn.Rollback();
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            return(blnOk);
        }
Exemplo n.º 22
0
 public static void CheckBudgetForApproval(string strheader_record_id, string strCurseExpense,
                                           ref string returned_condintion, ref string returned_test)
 {
     Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(Data.ConnectioString);
     Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand("BASDBA.pkg_trn_budget.checbudgetbeforeapproval_ee", conn);
     cmd.CommandType    = System.Data.CommandType.StoredProcedure;
     cmd.CommandTimeout = 30;
     SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "pla_header_record_id_", strheader_record_id);
     SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "course_expense_", strCurseExpense);
     SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "return_condition_", "varchar2", "out", null, 10);
     SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "return_condition_text_", "varchar2", "out", null, 4000);
     conn.Open();
     try
     {
         cmd.ExecuteNonQuery();
         returned_condintion = cmd.Parameters["return_condition_"].Value.ToString();
         if (returned_condintion != "1")
         {
             returned_test = cmd.Parameters["return_condition_text_"].Value.ToString();
         }
     }
     finally
     {
         conn.Close();
         conn.Dispose();
         cmd.Dispose();
     }
 }
Exemplo n.º 23
0
        public static DataTable FillDataDateTimes(string strRecord_id)
        {
            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(PLA_Report.Data.ConnectioString);
            Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand("BASDBA.PKG_Training.gettrainingcoursedatetimerec", conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "header_record_id_", strRecord_id);
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "Step_3_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];
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                mds.Dispose();
            }
            return(tbl);
        }
        private bool SetEmployeeNumber()
        {
            bool eeFound = true;

            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(PLA_Approval.TrainingClass.ConnectionString);
            Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand("pkg_training.set_employee_number", conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "User_id_", ViewState["User_ID"].ToString());
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "Session_id_", Request.Cookies["Session_ID"].Value.ToString());
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "employee_number_", "varchar2", "out", null, 20);

            try
            {
                conn.Open();
                cmd.ExecuteNonQuery();
                if (cmd.Parameters["employee_number_"].Value == null)
                {
                    eeFound = false;
                }
                else
                {
                    ViewState["Employee_Number"] = cmd.Parameters["employee_number_"].Value.ToString();
                }
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
            }
            return(eeFound);
        }
Exemplo n.º 25
0
        public static DataTable GetHistoryTable(string strRecord_id)
        {
            DataTable tbl = null;
            string    strProcedureName = "BASDBA.pkg_training.History_List";

            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(PLA_Report.Data.ConnectioString);
            Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand(strProcedureName, conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "header_record_id_", strRecord_id);
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "hstList_", "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();
            }
            return(tbl);
        }
Exemplo n.º 26
0
        public static DataTable employee_info(string strHeader_id)
        {
            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(PLA_Report.Data.ConnectioString);
            Oracle.DataAccess.Client.OracleCommand    cmd  = new Oracle.DataAccess.Client.OracleCommand("pkg_employee_3.ee_info_for_pla_report", conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "header_record_id_", strHeader_id);
            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];
            }
            finally
            {
                cmd.Dispose();
                mds.Dispose();
                conn.Close();
                conn.Dispose();
            }
            return(tbl);
        }
Exemplo n.º 27
0
        private DataTable GetGridTable()
        {
            DataTable tbl = null;
            string    strProcedureName = "BASDBA.pkg_training.History_List";

            if (ViewState["Product_Code"].ToString() == "11001")
            {
                strProcedureName = "BASDBA.pkg_training_cdp.History_List";
            }
            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;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "header_record_id_", ViewState["Request_Record_ID"].ToString());
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "hstList_", "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();
            }
            return(tbl);
        }
Exemplo n.º 28
0
//		private void FillProgramCode()
//		{
//			System.Data.DataTable dTable;
//			Oracle.DataAccess.Client.OracleConnection conn= new Oracle.DataAccess.Client.OracleConnection(Training_Source.TrainingClass.ConnectioString);
//			Oracle.DataAccess.Client.OracleCommand cmd =
//				new Oracle.DataAccess.Client.OracleCommand("pkg_training.program_code_list",conn);
//			cmd.CommandType = System.Data.CommandType.StoredProcedure;
//
//			SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd,"list_","cursor","out","");
//			Oracle.DataAccess.Client.OracleDataAdapter da =
//				new Oracle.DataAccess.Client.OracleDataAdapter(cmd);
//			DataSet mds=new DataSet();
//			conn.Open();
//			try
//			{
//
//				da.Fill(mds,"Purpose");
//				dTable = mds.Tables["Purpose"];
//				ddlProgramCode.Items.Clear();
//				ddlProgramCode.Items.Add(new ListItem("---- Select ----","-1"));
//				foreach (DataRow dr in dTable.Rows)
//				{
//					ListItem li = new ListItem(dr["description"].ToString(),dr["program_code"].ToString());
//					ddlProgramCode.Items.Add(li);
//				}
//			}
//			finally
//			{
//				conn.Close();
//				conn.Dispose();
//				cmd.Dispose();
//				da.Dispose();
//				mds.Dispose();
//				dTable=null;
//			}
//			if (ddlProgramCode.Items.Count==1)
//			{
//				ddlProgramCode.Enabled =false;
//				lblStarProgramCode.Visible = false;
//				rvProgramCode.Visible = false;
//				lblProgramCodeCommingSoon.Visible = true;
//			}
//		}

        private void FillAccountNo()
        {
            System.Data.DataTable dTable;
            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(Training_Source.TrainingClass.ConnectioString);
            Oracle.DataAccess.Client.OracleCommand    cmd  =
                new Oracle.DataAccess.Client.OracleCommand("pkg_training.account_no_list", conn);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;

            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "list_", "cursor", "out", "");
            Oracle.DataAccess.Client.OracleDataAdapter da =
                new Oracle.DataAccess.Client.OracleDataAdapter(cmd);
            DataSet mds = new DataSet();

            conn.Open();
            try
            {
                da.Fill(mds, "Purpose");
                dTable = mds.Tables["Purpose"];
                opnlstAccountNumber.Items.Clear();
                foreach (DataRow dr in dTable.Rows)
                {
                    ListItem li = new ListItem(dr["description"].ToString(), dr["account_no"].ToString());
                    opnlstAccountNumber.Items.Add(li);
                }
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                da.Dispose();
                mds.Dispose();
                dTable = null;
            }
        }
Exemplo n.º 29
0
        private DataTable GetGridTable()
        {
            string strProcedureName = "BASDBA.pkg_training.term_pending_payment_list";

            if (Request.Params["what"] == "2nd")
            {
                strProcedureName = "BASDBA.pkg_training.term_pending_2nd_sup_list";
            }
            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(strProcedureName, conn);
            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "super_user_employee_number_", ViewState["Employee_Number"].ToString());
            SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "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];
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
                mds.Dispose();
            }
            return(tbl);
        }
Exemplo n.º 30
0
 private void GetDataFromSession()
 {
     Oracle.DataAccess.Client.OracleConnection conn = SQLStatic.SQL.OracleConnection();
     try
     {
         txtFirstName.Text     = SQLStatic.Sessions.GetSessionValue(session_id, "txtFirstName", conn);
         txtMiddleInitial.Text = SQLStatic.Sessions.GetSessionValue(session_id, "txtMiddleInitial", conn);
         txtLastName.Text      = SQLStatic.Sessions.GetSessionValue(session_id, "txtLastName", conn);
         txtDateofBirth.Text   = SQLStatic.Sessions.GetSessionValue(session_id, "txtDateofBirth", conn);
         string strGender  = SQLStatic.Sessions.GetSessionValue(session_id, "ddlGender", conn);
         string strMarital = SQLStatic.Sessions.GetSessionValue(session_id, "ddlMaritalStatus", conn);
         if (!string.IsNullOrEmpty(strGender))
         {
             ddlGender.Items.FindByValue(strGender).Selected = true;
         }
         if (!string.IsNullOrEmpty(strMarital))
         {
             ddlMaritalStatus.Items.FindByValue(strMarital).Selected = true;
         }
     }
     finally
     {
         conn.Close();
         conn.Dispose();
     }
 }
Exemplo n.º 31
0
        public override int Execute(DbCommand[] cmdArray)
        {
            var connection = new Oracle.DataAccess.Client.OracleConnection(connectionString);
            Oracle.DataAccess.Client.OracleTransaction transaction = null;
            int r = 0;

            try
            {
                connection.Open();
                transaction = connection.BeginTransaction();

                for (int i = 0; i < cmdArray.Length; i++)
                {
                    if (!(cmdArray[i] is Oracle.DataAccess.Client.OracleCommand))
                        throw new Exception("Not a Valid SQL Command");
                    var command = (Oracle.DataAccess.Client.OracleCommand)cmdArray[i];

                    SetTimeOut(command);

                    command.Connection = connection;
                    command.Transaction = transaction;

                    foreach (Oracle.DataAccess.Client.OracleParameter parameter in command.Parameters)
                    {
                        if (parameter.Value == null)
                        {
                            parameter.Value = DBNull.Value;
                        }
                    }

                    r += command.ExecuteNonQuery();
                }
                transaction.Commit();
                return r;
            }
            catch (Exception ex)
            {
                if (transaction != null) transaction.Rollback();
                string exceptionMessage = GetOracleExceptionMessage(ex);

                throw new Exception(exceptionMessage);
            }
            finally
            {
                connection.Close();
            }
        }
        public JsonResult Create(int noticeId)
        {
            BusinessCheckNotice businessCheckNotice = RepositoryFactory.GetRepository<IBusinessCheckNoticeRepository, BusinessCheckNotice>().FindBy(noticeId);
            if (businessCheckNotice == null)
            {
                return Json(new { success = false, message = "商检单不存在" });
            }

            PipeIncomeRecord incomeRecord = repository.FindBy(businessCheckNotice);
            if (incomeRecord != null)
            {
                return Json(new { success = false, message = "已制作了该商检任务的入库单,不能重量制作" });
            }

            string code = Request.Form["Code"];
            string unit = Request.Form["Unit"];
            string strPipes = Request.Form["Pipes"];

            if (string.IsNullOrEmpty(code))
            {
                return Json(new { success = false, message = "编码不能为空" });
            }
            incomeRecord = repository.FindBy(code);
            if (incomeRecord != null)
            {
                return Json(new { success = false, message = "编号已被占用,请尝试使用其他编号" });
            }

            businessCheckNotice.Waggons = RepositoryFactory.GetRepository<IDeliverWaggonRepository, DeliverWaggon>().FindBy(businessCheckNotice);

            #region scarface
            // IList<PDCPMS.Model.Common.Pipe> pipes = RepositoryFactory.GetRepository<IPipeRepository, PDCPMS.Model.Common.Pipe>().FindBy(businessCheckNotice.Waggons);
            #endregion

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            IList<PDCPMS.DataContracts.Common.Pipe> pipeContracts = serializer.Deserialize<IList<PDCPMS.DataContracts.Common.Pipe>>(strPipes);
            IPipeRepository pipeRepository = RepositoryFactory.GetRepository<IPipeRepository, PDCPMS.Model.Common.Pipe>(unitOfWork);
            IPipePositionRepository posRepository = RepositoryFactory.GetRepository<IPipePositionRepository, PipePosition>();

            incomeRecord = new PipeIncomeRecord(0, code, businessCheckNotice, UserSession.OnlineAccount, DateTime.Now);
            incomeRecord.State = PipeIncomeRecordState.Created;
            repository.Add(incomeRecord);

            unitOfWork.Commit();

            #region scarface
            //for (int i = pipes.Count - 1; i > -1; i--)
            //{
            //    PDCPMS.Model.Common.Pipe pipe = pipes[i];
            //    PDCPMS.DataContracts.Common.Pipe pc = pipeContracts.FirstOrDefault(p => p.Key == (long)pipe.Key);
            //    if (pc != null)
            //    {
            //        if (pc.BusinessLength != 0)
            //        {
            //            pipe.BusinessLength = pc.BusinessLength;
            //        }
            //        else
            //        {
            //            pipe.BusinessLength = new float?();
            //        }

            //        if (pc.Weight != 0)
            //        {
            //            pipe.Weight = pc.Weight;
            //        }
            //        else
            //        {
            //            pipe.Weight = new float?();
            //        }

            //        //if ((pipe.State & PipeState.NormalChecking) == PipeState.NormalChecking) // 已发起了常检则不允许更改垛位
            //        //{
            //        //}
            //        //else
            //        //{
            //            if (pc.PositionId != 0)
            //            {
            //                pipe.Position = posRepository.FindBy(pc.PositionId);
            //            }
            //        //}
            //    }

            //    pipe.State |= PipeState.IncomeRecordDoing;
            //    pipe.PipeIncomeRecord = incomeRecord;
            //    pipeRepository[pipe.Key] = pipe;
            //};

            //incomeRecord.TotalCount = businessCheckNotice.ReceiveCount;
            //incomeRecord.TotalLength = pipes.Sum(p => p.BusinessLength.HasValue ? p.BusinessLength.Value : 0);
            //incomeRecord.TotalWeight = pipes.Sum(p => p.Weight.HasValue ? p.Weight.Value : 0) / 1000;
            #endregion

            #region 2010-11-12 scarface 新增代码

            //获取前台Json的值遍历生产SQL
            StringBuilder sb = new StringBuilder();
            DateTime now = DateTime.Now;
            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(System.Configuration.ConfigurationManager.ConnectionStrings["PDCPDMConnection"].ConnectionString);
            CY.Utility.DBUtility.OracleUtility db = new CY.Utility.DBUtility.OracleUtility(conn);
            conn.Open();
            Oracle.DataAccess.Client.OracleTransaction tran = conn.BeginTransaction();
            try
            {
                sb.Append(" update Pipe set PipeIncomeRecordId = " + incomeRecord.Key + ",");
                sb.Append(string.Format(" state = (state + {0} - bitand(state,{0})),", (int)PipeState.IncomeRecordDoing));
                sb.Append(" PosLastChangeTime = to_date('" + now + "', 'yyyy-mm-dd HH24:mi:ss') ");
                IList<DeliverWaggon> waggons = businessCheckNotice.Waggons;
                if (waggons == null)
                {
                    throw new ArgumentNullException("waggons");
                }
                string waggonIds = string.Empty;
                for (int i = waggons.Count - 1; i > -1; i--)
                {
                    waggonIds += OracleDataHelper.GetSqlValue(waggons[i].Key);

                    if (i != 0)
                    {
                        waggonIds += ",";
                    }
                }
                sb.Append(string.Format(" Where DeliverWaggonId in ({0})", waggonIds));
                db.ExecuteSql(sb.ToString());

                for (int i = pipeContracts.Count - 1; i > -1; i--)
                {
                    sb = new StringBuilder();
                    sb.Append(" UPDATE Pipe  SET ");
                    sb.Append(" BusinessLength = " + pipeContracts[i].BusinessLength + ",");
                    sb.Append(" Weight = " + pipeContracts[i].Weight + ",");
                    sb.Append(" PosLastChangeTime = to_date('" + now + "', 'yyyy-mm-dd HH24:mi:ss'),");
                    sb.Append(" PositionId = " + pipeContracts[i].PositionId);
                    sb.Append(" WHERE PipeId = " + pipeContracts[i].Key + "");

                    db.ExecuteSql(sb.ToString());
                }
                tran.Commit();
            }
            catch (Exception ex)
            {
                tran.Rollback();
                return Json(new { success = false, message = "管子信息保存出错!"+ex });
            }
            finally
            {
                if (conn.State != ConnectionState.Closed)
                {
                    conn.Close();
                }
            }

            //查询并统计数据
            sb = new StringBuilder();
            sb.Append(" SELECT SUM(BUSINESSLENGTH) AS lh ,SUM(WEIGHT)/1000 AS wt,count(*) as c FROM Pipe WHERE PIPEINCOMERECORDID = " + incomeRecord.Key + "");
            DataTable dt = pipeRepository.ExcuteDs(sb.ToString());
            float tl = dt.Rows[0]["lh"].ToString() == "" ? 0 : float.Parse(dt.Rows[0]["lh"].ToString());
            float tw = dt.Rows[0]["wt"].ToString() == "" ? 0 : float.Parse(dt.Rows[0]["wt"].ToString());
            int tc = dt.Rows[0]["c"].ToString() == "" ? 0 : int.Parse(dt.Rows[0]["c"].ToString());

            sb = new StringBuilder();
            sb.Append(" UPDATE Pipeincomerecord SET totalcount=" + tc + ",TOTALLENGTH = " + tl + ",TOTALWEIGHT = " + tw + " WHERE PIPEINCOMERECORDID = " + incomeRecord.Key + "");
            //只执行一次查询 就更新数据库表
            pipeRepository.Execute(sb.ToString());

            #endregion

            TempData["HintMessage"] = new PDCPMS.Application.HintMessage { Content = "保存成功" };
            return Json(new { success = true, message = "保存成功", recordId = incomeRecord.Key });
        }