protected void btnSave_Click(object sender, EventArgs e)
 {
     reasonMessage();
     if (txtMemo.Text == "")
     {
         ShowError("You must fill the reason for partial payment of the approved amount.");
         return;
     }
     Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(PLA_Approval.TrainingClass.ConnectionString);
     conn.Open();
     Oracle.DataAccess.Client.OracleTransaction txn = conn.BeginTransaction();
     try
     {
         SaveCSA(conn);
         if (DoSave(conn))
         {
             lblScript.Text = "<script>alert('Your decision has been saved.');document.location.replace('PayorPendingApprovals.aspx?SkipCheck=YES')</script>";
             txn.Commit();
         }
         else
         {
             txn.Rollback();
         }
     }
     catch
     {
         txn.Rollback();
         throw;
     }
     finally
     {
         conn.Close();
         conn.Dispose();
     }
 }
        protected void btnClassSave_Click(object sender, EventArgs e)
        {
            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            try
            {
                Data.Make_All_Classes_Eligible(ViewState["Selected_Account_Number"].ToString(), ViewState["Processing_Year"].ToString(),
                                               rblSaveTaxTo.SelectedValue, ViewState["User_Name"].ToString(), conn);

                foreach (ListItem li in cbEligible.Items)
                {
                    if (!li.Selected)
                    {
                        Data.update_one_class(ViewState["Selected_Account_Number"].ToString(), ViewState["Processing_Year"].ToString(),
                                              rblSaveTaxTo.SelectedValue, li.Value, "0", ViewState["User_Name"].ToString(), conn);
                    }
                }

                tx.Commit();
            }
            catch
            {
                tx.Rollback();
                throw;
            }
            finally
            {
                SQLStatic.SQL.CloseConnection(conn);
            }
            ShowData();
            Bas_Utility.Misc.AlertSaved(Page);
        }
Beispiel #3
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);
        }
 protected void DoSave()
 {
     //reInstruction.Content = "";
     Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
     Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
     try
     {
         foreach (ListItem li in cbEnrommentType.Items)
         {
             if (li.Selected)
             {
                 Data.Save_cvr_msg(session_id, ViewState["record_id"].ToString(), reMessage.Content, li.Value, rblSaveTo.SelectedValue);
             }
         }
         tx.Commit();
     }
     catch
     {
         tx.Rollback();
         throw;
     }
     finally
     {
         SQLStatic.SQL.CloseConnection(conn);
     }
     rblEnrollmentType.SelectedIndex = 0;
     rblEnrollType.SelectedIndex     = 0;
     gvGroups_SelectedIndexChanged(gvGroups, null);
     rblEnrollmentType_SelectedIndexChanged(null, null);
 }
        private bool DoSave()
        {
            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(PLA_Approval.TrainingClass.ConnectionString);
            conn.Open();
            Oracle.DataAccess.Client.OracleTransaction txn = conn.BeginTransaction();
            bool blnOk = true;

            try
            {
                SavePayorNumber(conn);
                if (ViewState["From_2nd_supervisor"].ToString() != "T")
                {
                    SaveApproval(conn);
                }
                else
                {
                    Save2ndApproval(conn);
                }
                txn.Commit();
            }
            catch
            {
                blnOk = false;
                txn.Rollback();
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            blnOk = blnOk && (ViewState["Saved"].ToString() != "F");
            return(blnOk);
        }
        protected void lnkbtnNo_Click(object sender, EventArgs e)
        {
            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            try
            {
                Data.SaveSPN_HSA(session_id, ViewState["Employee_Number"].ToString(), ViewState["Processing_Year"].ToString(), "INS-HSA", "001",
                                 "0", "0", conn);
                Data.SaveStatusCoverage(session_id, conn);
                tx.Commit();
            }
            catch
            {
                tx.Rollback();
                throw;
            }
            finally
            {
                SQLStatic.SQL.CloseConnection(conn);
            }
            Data.SaveStatusCoverage(session_id);
            string strClose = "<script>Javascript:closeWindow(20);</script>";

            Page.ClientScript.RegisterStartupScript(Page.GetType(), "strClose", strClose);
        }
Beispiel #7
0
 private void DoSave()
 {
     Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(PLA_Approval.TrainingClass.ConnectionString);
     conn.Open();
     Oracle.DataAccess.Client.OracleTransaction txn = conn.BeginTransaction();
     try
     {
         for (int i = 1; i < 11; i++)
         {
             if (ViewState["Record_id_" + i.ToString()] != null)
             {
                 SaveOne(conn, i);
             }
         }
         txn.Commit();
     }
     catch
     {
         txn.Rollback();
         throw;
     }
     finally
     {
         conn.Close();
         conn.Dispose();
     }
 }
Beispiel #8
0
        protected void btnRemove_Click(object sender, EventArgs e)
        {
            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            DataTable tbl = Data.Super_Users_List();

            try
            {
                foreach (DataRow dr in tbl.Rows)
                {
                    string strIndex = dr["user_id"].ToString();
                    if (Bas_Utility.Utilities.GetCheckBox(gvEmployee, "cb_" + strIndex).Checked)
                    {
                        Data.Remove_Super_User(strIndex, conn);
                    }
                }
                tx.Commit();
            }
            catch
            {
                tx.Rollback();
                throw;
            }
            DrawGrid();
        }
 protected void btnSendEmails_Click(object sender, EventArgs e)
 {
     Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
     Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
     try
     {
         if (is_inital())
         {
             RadGrid1.DataSource = Data.WillReciveInital(ddlRenewalDate.SelectedValue);
         }
         else
         {
             RadGrid1.DataSource = Data.WillReciveReminder(ddlRenewalDate.SelectedValue);
         }
         RadGrid1.DataBind();
         tx.Rollback();
     }
     catch
     {
         tx.Rollback();
     }
     finally
     {
         SQLStatic.SQL.CloseConnection(conn);
     }
 }
        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);
        }
        protected void btnFullPaymentApproval_Click(object sender, EventArgs e)
        {
            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();
            }
            lblScript.Text = "<script>alert('Your decision has been saved.');document.location.replace('PayorPendingApprovals.aspx?SkipCheck=YES')</script>";
        }
        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);
        }
        protected void aspxbtn_Click(object sender, EventArgs e)
        {
            string strGradDate = ddlYear.SelectedValue + ddlMonth.SelectedValue;

            if ((ddlMonth.SelectedIndex == 0) || (ddlYear.SelectedIndex == 0))
            {
                strGradDate = "";
            }
            string strSate = ddlState.SelectedValue;

            if (ddlState.SelectedValue == "0")
            {
                strSate = "";
            }
            string strDepID = "";

            if (Request.Params["id"] == "-1")
            {
                strDepID = "0";
            }
            else
            {
                strDepID = Request.Params["dep_id"];
            }
            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction idx  = conn.BeginTransaction();
            //string strID;
            try
            {
                Data.SaveDependentsLimited(Request.Params["id"], ViewState["Employee_Number"].ToString(), strDepID, ViewState["Processing_Year"].ToString(),
                                           txtSSN.Text, txtDOB.Text, txtSchool.Text, strGradDate, ViewState["User_Name"].ToString(), conn);
                Data.SaveDependentAddressByEE(ViewState["Employee_Number"].ToString(), Request.Params["dep_id"], txtStreet.Text, txtApt.Text, txtCity.Text, strSate, txtZip.Text, txtHomePhone.Text, ViewState["User_Name"].ToString(), conn);
                idx.Commit();
            }
            catch
            {
                idx.Rollback();
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            string strCallCloseWindow = "<script>docloseWindow(1)</script>";

            Page.ClientScript.RegisterStartupScript(Page.GetType(), "strCallCloseWindow", strCallCloseWindow);
            return;
        }
Beispiel #14
0
        protected void aspxbtn_Click(object sender, EventArgs e)
        {
            txtEffectiveDate.Text = stripDate(txtEffectiveDate.Text);
            Validate();
            if (!IsValid)
            {
                return;
            }
            Globalconn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction idx = Globalconn.BeginTransaction();
            string strRecid = ViewState["RecID"].ToString();

            try
            {
                for (int i = 1; i <= 6; i++)
                {
                    if (ViewState["Record_id" + i.ToString()] != null)
                    {
                        CheckBox cb = (CheckBox)Page.FindControl("cbselect" + i.ToString());
                        if (cb.Checked && cb.Enabled)
                        {
                            DropDownList ddl = (DropDownList)Page.FindControl("ddlAvailableStatus" + i.ToString());
                            Data.SaveCoverage(ViewState["Record_id" + i.ToString()].ToString(), ViewState["Employee_Number"].ToString(), strRecid, ddl.SelectedValue, txtEffectiveDate.Text, ViewState["User_Name"].ToString(), Globalconn);
                        }
                    }
                }
                idx.Commit();
            }
            catch
            {
                idx.Rollback();
                throw;
            }
            finally
            {
                Globalconn.Close();
                Globalconn.Dispose();
            }
            string strCallCloseWindow = "<script>docloseWindow(1)</script>";

            ViewState["Show_Declaration"] = Data.Show_Declara_Form_Send_Processess(ViewState["Employee_Number"].ToString());
            if (ViewState["Show_Declaration"].ToString() == "1")
            {
                strCallCloseWindow = "<script>docloseWindow(2)</script>";
            }
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "strCallCloseWindow", strCallCloseWindow);
        }
Beispiel #15
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            try
            {
                string strInOPenEE = "0";
                if (cbOe.Checked)
                {
                    strInOPenEE = "1";
                }
                Data.Save_In_OE(Request.Params["accnt"], Request.Params["py"], strInOPenEE, Request.Params["catcode"],
                                Request.Params["catplan"], Request.Params["class"], Request.Params["batch"], conn);

                string newCatePlN = Data.Replace_coverage(Request.Params["accnt"], Request.Params["ver"], Request.Params["class"], Request.Params["catcode"],
                                                          Request.Params["catplan"], Request.Params["py"], Request.Params["batch"], Request.Params["ratetype"], conn);

                if (!string.IsNullOrEmpty(hidcomVales.Value))
                {
                    // remove first seperatoe
                    hidcomVales.Value = hidcomVales.Value.Remove(0, 1);
                    ArrayList ar = new ArrayList(hidcomVales.Value.Split(new char[] { '!' }));
                    string    long_description = Request.Params["cvrg"].Substring(0, Request.Params["cvrg"].IndexOf(" - "));
                    foreach (string str in ar)
                    {
                        string[] fs  = str.Split('=');
                        string[] age = fs[0].Split('-');
                        age[0] = age[0].Replace(" + ", "");
                        Data.SaveRate_ver1(Request.Params["accnt"], Request.Params["ver"], Request.Params["class"], Request.Params["catcode"],
                                           newCatePlN, "010", Request.Params["py"], Request.Params["batch"], fs[1], age[0].Trim(), "", "", long_description, fs[0], "1", conn);
                    }
                }
                tx.Commit();
            }
            catch
            {
                tx.Rollback();
                throw;
            }
            finally
            {
                SQLStatic.SQL.CloseConnection(conn);
            }
            btnCancel_Click(null, null);
        }
 public void InsertCLOB(string SQLStatement, string str)
 {
     if (SQLStatement.Length > 0)
     {
         if (connOracle.State.ToString().Equals("Open"))
         {
             byte[] newvalue = System.Text.Encoding.Unicode.GetBytes(str);
             sqlCommandOracle =
                 new Oracle.DataAccess.Client.OracleCommand(SQLStatement, connOracle);
             rstOracle = sqlCommandOracle.ExecuteReader();
             rstOracle.Read();
             txn  = connOracle.BeginTransaction();
             clob = rstOracle.GetOracleClob(0);
             clob.Write(newvalue, 0, newvalue.Length);
             txn.Commit();
         }
     }
 }
        private void DoSave()
        {
            DataTable tbl = (DataTable)GetGridView("gvPlans").DataSource;

            if (tbl == null)
            {
                tbl = GetData();
            }
            string   strIndex = null;
            CheckBox cb       = null;
            int      DoSkip   = 0;

            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            RadioButtonList rblOperation_ = Bas_Utility.Utilities.GetRadioButtonList(Page, "rblOperation");

            try
            {
                foreach (DataRow dr in tbl.Rows)
                {
                    strIndex = dr["RECORD_ID"].ToString();
                    cb       = Bas_Utility.Utilities.GetCheckBox(Page, "cbl_" + strIndex);
                    if (cb.Checked)
                    {
                        DoSkip = 0;
                    }
                    else
                    {
                        DoSkip = 1;
                    }
                    Data.SaveCoverageSkip(session_id, strIndex, GetRadioButtonList("rblSaveType").SelectedValue, DoSkip.ToString(), rblOperation_.SelectedValue, conn);
                }
                tx.Commit();
            }
            catch
            {
                tx.Rollback();
                throw;
            }
            finally
            {
                SQLStatic.SQL.CloseConnection(conn);
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            DataTable tbl = CreateTable();

            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            try
            {
                string last_fs = string.Empty;
                foreach (DataRow dr in tbl.Rows)
                {
                    if (!string.IsNullOrEmpty(dr["Family_status"].ToString()))
                    {
                        if (!dr["Family_status"].ToString().Equals(last_fs))
                        {
                            last_fs = dr["Family_status"].ToString();
                        }
                    }
                    if (!string.IsNullOrEmpty(dr["Age_Band"].ToString()))
                    {
                        Data.addOneRate(ViewState["Account_number"].ToString(),
                                        ViewState["Version"].ToString(),
                                        ViewState["class_code"].ToString(),
                                        ViewState["Processing_Year"].ToString(),
                                        ViewState["category_code"].ToString(),
                                        ViewState["category_plan"].ToString(),
                                        last_fs.Substring(0, 3),
                                        dr["Age_Band"].ToString().Substring(0, 2).Replace("-", "").Trim(),
                                        txtEffectiveDate.SelectedDate.Value.ToShortDateString(),
                                        ViewState["User_Name"].ToString());
                    }
                }
            }
            catch
            {
                tx.Rollback();
                throw;
            }
            finally
            {
                SQLStatic.SQL.CloseConnection(conn);
            }
            Response.Redirect("Default.aspx", true);
        }
Beispiel #19
0
        /// <summary>
        /// 将cmdText在一个事务中执行
        /// </summary>
        /// <param name="cmdText"></param>
        /// <returns></returns>
        public string ExecuteNonQueryWithTrans(string cmdText)
        {
            string retVal = "0";

            using (Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(connStr))
            {
                Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand(cmdText, conn);
                cmd.CommandType = CommandType.Text;

                try
                {
                    if (conn.State == ConnectionState.Closed)
                    {
                        conn.Open();
                    }
                    using (Oracle.DataAccess.Client.OracleTransaction trans = conn.BeginTransaction())
                    {
                        try
                        {
                            cmd.Transaction = trans;
                            retVal          = cmd.ExecuteNonQuery().ToString();
                            trans.Commit();
                        }
                        catch (Exception ex)
                        {
                            LogWriter.Error(ex, cmdText);
                            trans.Rollback();
                            throw;
                        }
                    }
                }
                catch (Exception exp)
                {
                    LogWriter.Error(exp, cmdText);
                    //retVal = exp.Message;
                    throw exp;
                }
                finally
                {
                    conn.Close();
                }
            }
            return(retVal);
        }
        private void DoSave()
        {
            ArrayList al             = (ArrayList)ViewState["save"];
            string    unique_id_     = string.Empty;
            string    rate_amount    = string.Empty;
            string    employer_split = string.Empty;
            string    rate_override1 = string.Empty;
            string    user_name_     = SQLStatic.Sessions.GetUserName(session_id);

            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            try
            {
                foreach (string str in al)
                {
                    string[] codeoverride = str.Split('!');
                    unique_id_     = codeoverride[0];
                    rate_amount    = codeoverride[1].Replace("$", "").Replace(",", "");
                    employer_split = codeoverride[2].Replace("$", "").Replace(",", "");
                    rate_override1 = codeoverride[3].Replace("$", "").Replace(",", "");
                    if (!cbSelectOnFS.Checked)
                    {
                        Data.SaveOneErRate(unique_id_, rate_amount, employer_split, rate_override1, user_name_, conn);
                    }
                    else
                    {
                        Data.SAVEONEERRATE_OneFS(unique_id_, rate_amount, employer_split, rate_override1, user_name_, conn);
                    }
                }
                tx.Commit();
            }
            catch
            {
                tx.Rollback();
                throw;
            }
            finally
            {
                SQLStatic.SQL.CloseConnection(conn);
            }
            DrawGrid();
            Bas_Utility.Misc.AlertSaved(Page);
        }
Beispiel #21
0
        protected void brnSavePrePostTax_Click(object sender, EventArgs e)
        {
            string strOE = string.Empty;

            foreach (ListItem li in cblFSALink.Items)
            {
                if (li.Selected)
                {
                    strOE += li.Value;
                }
            }
            if (string.IsNullOrEmpty(strOE))
            {
                Bas_Utility.Misc.Alert(Page, "Must select at least one OE type");
                return;
            }
            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            try
            {
                foreach (ListItem li in cblFSALink.Items)
                {
                    if (li.Selected)
                    {
                        Data.Save_er_property(ViewState["Selected_Account_Number"].ToString(), li.Value, rblSelectedFSA.SelectedValue,
                                              ViewState["User_Name"].ToString(), rblFSALink.SelectedValue, conn);
                    }
                }
                tx.Commit();
            }
            catch
            {
                tx.Rollback();
                throw;
            }
            finally
            {
                SQLStatic.SQL.CloseConnection(conn);
            }

            Bas_Utility.Misc.AlertSaved(Page);
        }
        protected void DoSaveCvrgs()
        {
            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            try
            {
                SaveCoverage(conn);
                SaveCoverageKeep(conn);
                if (rblTermdependent.SelectedValue.Equals("1"))
                {
                    //if (ViewState["remCoverage"].ToString().Equals("0"))
                    if (!string.IsNullOrEmpty(ViewState["TermDep"].ToString()))
                    {
                        if (ViewState["TermDep"].ToString().Equals("yes"))
                        {
                            DoSave(conn);
                        }
                    }
                }
                tx.Commit();
            }
            catch
            {
                tx.Rollback();
            }
            finally
            {
                SQLStatic.SQL.CloseConnection(conn);
            }


            {
                if (!string.IsNullOrEmpty(Request.Params["sessom"]))
                {
                    lblScript.Text = "<script>closeWindowcloseWindowOE(1)</script>";
                }
                else
                {
                    lblScript.Text = "<script>closeWindow</script>";
                }
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();

            try
            {
                foreach (ListItem li in cblEnrollmentType.Items)
                {
                    if (li.Selected)
                    {
                        foreach (ListItem lia in cblPlans.Items)
                        {
                            if (lia.Selected)
                            {
                                Data.SaveAlert(ViewState["Selected_Account_Number"].ToString(), lia.Text, txtQuestion.Text, txtNote.Content,
                                               lia.Value.Substring(0, 7), lia.Value.Substring(7), li.Value, cblAccountss.SelectedValue);
                            }
                        }
                    }
                }
                tx.Commit();
            }
            catch
            {
                tx.Rollback();
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }

            rblMode.SelectedIndex = 0;
            dvEdit.Visible        = rblMode.SelectedValue.Equals("1");
            dvView.Visible        = !dvEdit.Visible;
            GetText();
        }
Beispiel #24
0
 private void DoSave()
 {
     Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(Training_Source.TrainingClass.ConnectioString);
     conn.Open();
     Oracle.DataAccess.Client.OracleTransaction txn = conn.BeginTransaction();
     try
     {
         SaveTypesAndNeeds(conn);
         ClearTypesofDevelopment(conn);
         SaveTypesofDevelopment(conn);
         txn.Commit();
     }
     catch
     {
         txn.Rollback();
         throw;
     }
     finally
     {
         conn.Close();
         conn.Dispose();
     }
 }
Beispiel #25
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            DataTable tbl = Data.Get_fdic_admin_assignment_data(ddlAdmin.SelectedValue, conn);

            try
            {
                Process_Modify(tbl, conn);
                process_remove(tbl, conn);
                tx.Commit();
            }
            catch
            {
                tx.Rollback();
            }
            finally
            {
                SQLStatic.SQL.CloseConnection(conn);
            }
            ViewState["skip"] = false;
            DrawGrid();
            Bas_Utility.Misc.AlertSaved(Page);
        }
Beispiel #26
0
        private bool DoSave()
        {
            if (ddlExpenseType.SelectedValue != "1000")
            {
                txtExpenseName.Text = ddlExpenseType.SelectedItem.Text;
            }

            Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(Training_Source.TrainingClass.ConnectioString);

            string strProcedureName = "basdba.PKG_Training.AddUpdateEmploeeExpense";

            if (Request.Params["Admin"] == "YES")
            {
                strProcedureName = "basdba.PKG_Training.AddUpdateEmploeeExpense_Admin";
            }
            Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand(strProcedureName, conn);

            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
            cmd.CommandTimeout = 30;
            bool blnok = false;

            conn.Open();
            Oracle.DataAccess.Client.OracleTransaction txn = conn.BeginTransaction();
            try
            {
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "record_id_", "number", "in", Request.Params["expid"]);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "header_record_id_", "number", "in", ViewState["Request_Record_ID"].ToString());
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "expense_type_ID_", "number", "in", ddlExpenseType.SelectedValue);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "expense_type_", "varchar2", "in", txtExpenseName.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "amount_", "number", "in", txtAmount.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "pay_to_", "number", "in", optlstVendor.SelectedIndex);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "note_", "varchar2", "in", txtDescription.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "vendor_name_", "varchar2", "in", txtVedorName.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "vendor_contact_name_", "varchar2", "in", txtVendorContact.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "vendor_address_1_", "varchar2", "in", txtAddressLine1.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "vendor_address2_", "varchar2", "in", txtAddressLine2.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "vendor_city_", "varchar2", "in", txtCity.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "vendor_state_", "varchar2", "in", ddlStates.SelectedValue);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "vendor_zip_", "varchar2", "in", txtZipCode.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "vendor_phone_", "varchar2", "in", txtPhoneNumber.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "vendor_fax_", "varchar2", "in", txtFaxNumber.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "vendor_emai_", "varchar2", "in", txtemail.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "user_id_", "varchar2", "in", ViewState["User_Name"].ToString());
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "country_code_", "varchar2", "in", ddlContries.SelectedValue);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "province_", "varchar2", "in", txtProvince.Text);
                SQLStatic.ProcedureParameters.SetStoredProcedureParameter(cmd, "new_record_id_", "number", "out", "");

                cmd.ExecuteNonQuery();
                double dblremain = remaining_amount(conn);
                if (dblremain < 0)
                {
                    txn.Rollback();
                    blnok         = false;
                    lblError.Text = "You do not have enough money in your budget to pay for this expense. You " +
                                    "should request at lease " + (-1 * dblremain).ToString("$###,###,##0.00") + " extra from the Division/Office Director to pay for this expense";
                }
                else
                {
                    blnok = true;
                    txn.Commit();
                }
            }
            catch
            {
                txn.Rollback();
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
                cmd.Dispose();
            }
            return(blnok);
        }
Beispiel #27
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();
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            try
            {
                string strInOPenEE = "0";
                string newCatePlN  = Request.Params["catplan"];
                if (cbOe.Checked)
                {
                    strInOPenEE = "1";
                }
                Data.Save_In_OE(Request.Params["accnt"], Request.Params["py"], strInOPenEE, Request.Params["catcode"],
                                Request.Params["catplan"], Request.Params["class"], Request.Params["batch"], conn);
                if (!Request.Params["action"].Equals("0"))
                {
                    newCatePlN = Data.Replace_coverage(Request.Params["accnt"], Request.Params["ver"], Request.Params["class"], Request.Params["catcode"],
                                                       Request.Params["catplan"], Request.Params["py"], Request.Params["batch"], Request.Params["ratetype"], conn);
                }
                if (string.IsNullOrEmpty(hidcomVales.Value))
                {
                    tx.Commit();
                    SQLStatic.SQL.CloseConnection(conn);
                    if (!Request.Params["action"].Equals("0"))
                    {
                        jscriptsFunctions.Misc.Alert(Page, "You did not enter Rates");
                        btnCancel_Click(null, null);
                        return;
                    }
                    else
                    {
                        btnCancel_Click(null, null);
                    }
                }
                if (!string.IsNullOrEmpty(hidcomVales.Value))
                {
                    string long_description = Request.Params["cvrg"];
                    if (!Request.Params["cvrg"].IndexOf(" - ").Equals(-1))
                    {
                        long_description = Request.Params["cvrg"].Substring(0, Request.Params["cvrg"].IndexOf(" - "));
                    }
                    hidcomVales.Value = hidcomVales.Value.Remove(0, 1);
                    ArrayList ar = new ArrayList(hidcomVales.Value.Split(new char[] { '!' }));

                    foreach (string str in ar)
                    {
                        string[] fs = str.Split('=');

                        Data.SaveRate_ver1(Request.Params["accnt"], Request.Params["ver"], Request.Params["class"], Request.Params["catcode"],
                                           newCatePlN, fs[0], Request.Params["py"], Request.Params["batch"], fs[1], "0", "", "", long_description, "", "1", conn);
                    }
                }
                tx.Commit();
            }
            catch
            {
                tx.Rollback();
                throw;
            }
            finally
            {
                SQLStatic.SQL.CloseConnection(conn);
            }
            btnCancel_Click(null, null);
        }
        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 });
        }
Beispiel #30
0
        private void DrawGrig()
        {
            if (ViewState["typeof"].ToString().Equals("0"))
            {
                DataTable tbl = Data.OptionalBenefits(session_id);
                foreach (DataRow dr in tbl.Rows)
                {
                    if (dr["Category_PlanCode"].ToString().Equals("001LIF-CYL"))
                    {
                        decimal bl = Convert.ToDecimal(dr["multiplier_override"]);
                        dr["BenefitLevel"] = String.Format("{0:C}", bl);
                    }
                }
                foreach (DataRow dr in tbl.Rows)
                {
                    if (!string.IsNullOrEmpty(dr["End Date"].ToString()))
                    {
                        DateTime dtermdate = Convert.ToDateTime(dr["End Date"].ToString());
                        if (DateTime.Today > dtermdate)
                        {
                            dr.Delete();
                        }
                    }
                }

                foreach (DataRow dr in tbl.Rows)
                {
                    DateTime dtermdate = Convert.ToDateTime(dr["effective_date"].ToString());
                    dr["effective_date"] = dtermdate.ToString("MM/dd/yy");

                    dtermdate = Convert.ToDateTime(dr["Last Change Date"].ToString());
                    dr["Last Change Date"] = dtermdate.ToString("MM/dd/yy");
                }

                tbl.AcceptChanges();

                //int col_number = ColumnNumber();
                //lblCostBase.Visible = true;
                //if (!col_number.Equals(-1))
                //{
                //    gvSummary.Columns[col_number].Visible = true;
                //    string strheader = Data.PerpayText(ViewState["Selected_Account_Number"].ToString());
                //    if (!string.IsNullOrEmpty(strheader))
                //        gvSummary.Columns[col_number].HeaderText = strheader;
                //}
                //else
                //    lblCostBase.Visible = false;

                gvSummary.DataSource = tbl;
                gvSummary.DataBind();
            }
            DataTable tblDep = Data.GetDependentsListActive(ViewState["Employee_Number"].ToString());

            gvDep.DataSource = tblDep;
            gvDep.DataBind();
            if (tblDep.Rows.Count.Equals(0))
            {
                lblNoDependent.Visible = true;
            }

            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            DataTable tblPend = Data.GetBenefitStatmentPendingList(session_id, conn);

            if (!tblPend.Rows.Count.Equals(0))
            {
                gvEOI.DataSource = tblPend;
                gvEOI.DataBind();
            }
            else
            {
                gvEOI.Visible = false;
                lblNoPendingElection.Visible  = true;
                divPendingInstruction.Visible = false;
            }
            tx.Rollback();
            SQLStatic.SQL.CloseConnection(conn);
            if (Data.benefitpagevisible(ViewState["Selected_Account_Number"].ToString()))
            {
                Label2.Visible = true;
                DataTable tblBenef = Data.GetBeneficiary(session_id);
                if (!tblBenef.Rows.Count.Equals(0))
                {
                    gvBenefit.DataSource = tblBenef;
                    gvBenefit.DataBind();
                }
                else
                {
                    gvBenefit.Visible          = false;
                    lblNoBeneficireies.Visible = true;
                }
            }
        }
Beispiel #31
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string    session_id = string.Empty;
            DataTable tbl        = null;

            if (!string.IsNullOrEmpty(Request.Params["back"]))
            {
                if (string.IsNullOrEmpty(hidcomVales.Value) && string.IsNullOrEmpty(hidcomVale2.Value))
                {
                    jscriptsFunctions.Misc.Alert(Page, "Nothing to save!");
                    DrawGrid();
                    return;
                }
                session_id = Request.Cookies["Session_ID"].Value.ToString();
                tbl        = Data.Family_Status_Generic(session_id, Request.Params["accnt"], Request.Params["cvrgid"], Request.Params["class"], Request.Params["catcode"],
                                                        Request.Params["catplan"], Request.Params["py"]);
            }
            else
            {
                tbl = Data.Family_Status_List(Request.Params["accnt"], Request.Params["ver"], Request.Params["class"], Request.Params["catcode"],
                                              Request.Params["catplan"], Request.Params["py"], Request.Params["batch"]);
            }

            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            try
            {
                //string strInOPenEE = "0";
                string newCatePlN = Request.Params["catplan"];

                if (string.IsNullOrEmpty(hidcomVales.Value) && string.IsNullOrEmpty(hidcomVale2.Value))
                {
                    tx.Commit();
                    SQLStatic.SQL.CloseConnection(conn);
                    if (!Request.Params["action"].Equals("0"))
                    {
                        jscriptsFunctions.Misc.Alert(Page, "You did not enter Rates");
                        btnCancel_Click(null, null);
                        return;
                    }
                    else
                    {
                        btnCancel_Click(null, null);
                        return;
                    }
                }



                if (!string.IsNullOrEmpty(hidcomVales.Value))
                {
                    // remove first seperatoe
                    hidcomVales.Value = hidcomVales.Value.Remove(0, 1);
                    ArrayList ar = new ArrayList(hidcomVales.Value.Split(new char[] { '!' }));
                    string    long_description = Request.Params["cvrg"];
                    if (!Request.Params["cvrg"].IndexOf(" - ").Equals(-1))
                    {
                        long_description = Request.Params["cvrg"].Substring(0, Request.Params["cvrg"].IndexOf(" - "));
                    }
                    foreach (DataRow dr in tbl.Rows)
                    {
                        if (!dr["exist"].ToString().Equals("0"))
                        {
                            foreach (string str in ar)
                            {
                                string[] fs  = str.Split('=');
                                string[] age = fs[0].Split('-');
                                age[0] = age[0].Replace(" + ", "");
                                if (!string.IsNullOrEmpty(Request.Params["back"]))
                                {
                                    Data.SaveRate_ver2_tbl(Request.Params["accnt"], Request.Params["ver"], dr["class_code"].ToString(), Request.Params["catcode"],
                                                           newCatePlN, dr["family_status_code"].ToString(), Request.Params["py"], Request.Params["batch"], fs[1], age[0].Trim(), "",
                                                           ViewState["user_id"].ToString(), long_description, fs[0], "1", "0", conn);
                                }
                                //    else
                                //        Data.SaveRate_ver2(Request.Params["accnt"], Request.Params["ver"], Request.Params["class"], Request.Params["catcode"],
                            }
                        }
                    }
                }


                if (!string.IsNullOrEmpty(hidcomVale2.Value))
                {
                    // remove first seperatoe
                    hidcomVale2.Value = hidcomVale2.Value.Remove(0, 1);
                    ArrayList ar = new ArrayList(hidcomVale2.Value.Split(new char[] { '!' }));
                    string    long_description = Request.Params["cvrg"];
                    if (!Request.Params["cvrg"].IndexOf(" - ").Equals(-1))
                    {
                        long_description = Request.Params["cvrg"].Substring(0, Request.Params["cvrg"].IndexOf(" - "));
                    }
                    foreach (DataRow dr in tbl.Rows)
                    {
                        if (!dr["exist"].ToString().Equals("0"))
                        {
                            foreach (string str in ar)
                            {
                                string[] fs  = str.Split('=');
                                string[] age = fs[0].Split('-');
                                age[0] = age[0].Replace(" + ", "");
                                age[0] = age[0].Replace("_a", "");
                                if (!string.IsNullOrEmpty(Request.Params["back"]))
                                {
                                    Data.SaveRate_ver2_tbl(Request.Params["accnt"], Request.Params["ver"], dr["class_code"].ToString(), Request.Params["catcode"],
                                                           newCatePlN, dr["family_status_code"].ToString(), Request.Params["py"], Request.Params["batch"], fs[1], age[0].Trim(), "",
                                                           ViewState["user_id"].ToString(), long_description, fs[0], "2", "0", conn);
                                }
                            }
                        }
                    }
                }


                if (!string.IsNullOrEmpty(Request.Params["back"]))
                {
                    //Data.UpdateRates_One_Cvrg(Request.Params["accnt"], Request.Params["cvrgid"], Request.Params["batch"], conn);
                    Data.add_formulas_for_COBRA_Setup(Request.Params["accnt"], Request.Params["cvrgid"], conn);
                }
                tx.Commit();
            }
            catch
            {
                tx.Rollback();
                throw;
            }
            finally
            {
                SQLStatic.SQL.CloseConnection(conn);
            }
            if (!string.IsNullOrEmpty(Request.Params["back"]))
            {
                if ((Request.Params["back"].Equals("2")))
                {
                    string strParam = "?accnt=" + Request.Params["accnt"] +
                                      "&ver=" + Request.Params["ver"] +
                                      "&class=" + Request.Params["class"] +
                                      "&catcode=" + Request.Params["catcode"] +
                                      "&catplan=" + Request.Params["catplan"] +
                                      "&py=" + Request.Params["py"] +
                                      "&batch=" + Request.Params["batch"] +
                                      "&cvrg=" + Request.Params["cvrg"] +
                                      "&back=2" +
                                      "&cvrgid=" + Request.Params["cvrgid"] +
                                      "&action=" + "0" +
                                      "&id=";
                    //string strURL = "/WEB_PROJECTS/AUTOMATED_RATE_UPDATE/DoubleAgeRate.aspx" + strParam;
                    string strURL = "/WEB_PROJECTS/Rates/UseOld.aspx" + strParam;
                    lblScript.Text = "<script>Javascript:ReRun('" + strURL + "')</script>";
                    //Bas_Utility.Misc.AlertSaved(Page);
                    //DrawGrid();
                    return;
                }
            }

            btnCancel_Click(null, null);
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            DataTable tbl = gvProfile.DataSource as DataTable;

            if (tbl == null)
            {
                tbl = GetData();
            }
            RadioButtonList rblst        = null;
            string          strRecord_id = "";
            int             indx         = 0;

            foreach (DataRow dr in tbl.Rows)
            {
                //rblst = FindControl( "rblst_" + indx.ToString()) as RadioButtonList ;
                rblst = Bas_Utility.Utilities.GetRadioButtonList(Page, "rblst_" + indx.ToString());
                indx++;
                strRecord_id = rblst.ID.Replace("rblst_", "");
                if (rblst.SelectedValue.Equals("1"))
                {
                }
                else if (rblst.SelectedValue.Equals("0"))
                {
                }
                else
                {
                    jscriptsFunctions.Misc.Alert(Page, "A Decision  must be made for ALL items");
                    return;
                }
            }
            strRecord_id = "";
            indx         = 0;
            Oracle.DataAccess.Client.OracleConnection  conn = SQLStatic.SQL.OracleConnection();
            Oracle.DataAccess.Client.OracleTransaction tx   = conn.BeginTransaction();
            try
            {
                foreach (DataRow dr in tbl.Rows)
                {
                    //rblst = FindControl( "rblst_" + indx.ToString()) as RadioButtonList;
                    rblst = Bas_Utility.Utilities.GetRadioButtonList(Page, "rblst_" + indx.ToString());
                    indx++;
                    strRecord_id = rblst.ID.Replace("rblst_", "");
                    if (rblst.SelectedValue.Equals("1"))
                    {
                        if (dr["which"].ToString().Equals("a"))
                        {
                            processAddress(dr);
                        }
                        else
                        {
                            processProfile(dr);
                        }
                        ViewState["email_apprve"] = "0";
                    }
                    //else if (rblst.SelectedValue.Equals("0"))
                    //{
                    //}
                    //else
                    //{
                    //    //tx.Rollback();
                    //    //string strError = "<script>alert('You must ckeck all the dependents first')</script>";
                    //    //Page.ClientScript.RegisterStartupScript(Page.GetType(), "strError", strError);
                    //    //return;
                    //}
                }
                Data.Close_pending_ee_profile_addrs(session_id, ViewState["EE_Number"].ToString());
                tx.Commit();
            }
            catch
            {
                tx.Rollback();
                throw;
            }
            finally
            {
                SQLStatic.SQL.CloseConnection(conn);
            }
            jscriptsFunctions.Misc.AlertSaved(Page);
            btnNext_Click(null, null);
            //Response.Redirect("Profile.aspx?SkipCheck=YES&ee=" + Request.Params["ee"], true);
        }