Ejemplo n.º 1
0
    protected override void OnPreRenderComplete(EventArgs e)
    {
        try
        {
            lblErr.Text = "";
            hfLocal_plan_id.Value = Session[Session.SessionID.ToString() + "PlanID"].ToString();
            Panel1.Visible = true;
        }
        catch
        {
            scs_error_dictionary errObj = new scs_error_dictionary();
            errObj.ConnectionString = DataAccess.getConnStr();

            if (errObj.LoadByPrimaryKey("100"))
            {
                lblErr.Text = errObj.Txt_message;
                hl_UpdateApprovals.Visible = false;
            }
            hfLocal_plan_id.Value = "-1";
            Panel1.Visible = false;
        }

        RadGrid1.DataBind();

        try
        {
            #region This section test for Plan Level and Roleid if Level 103 - Under review by So and userroleid 101 SO Admin allow quick checkbox update else no updateing available

            lp_local_plan lpObj = new lp_local_plan();
            lpObj.ConnectionString = DataAccess.getConnStr();
            lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID + "PlanID"].ToString()));

            string roleid = Session[Session.SessionID + "roleid"].ToString();

            if (lpObj.Key_local_plan_level_id.ToString() != "103" || roleid != "101")
            {
                hl_UpdateApprovals.Visible = false;
            }
            else
            {
                hl_UpdateApprovals.Visible = true;
            }

            #endregion

        }
        catch
        {
        }

        base.OnPreRenderComplete(e);
    }
Ejemplo n.º 2
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        lp_local_plan lpObj = new lp_local_plan();
        lpObj.ConnectionString = DataAccess.getConnStr();

        if (lpObj.LoadByPrimaryKey(Convert.ToInt32(hfLpid.Value)))
        {
            if (cbAccepted.Checked)
                lpObj.Flg_accepted_assurances = true;
            else
                lpObj.Flg_accepted_assurances = false;
            lpObj.Save();
        }
    }
Ejemplo n.º 3
0
    protected void GearBox_Amendments_Secruity()
    {
        try
        {
            lp_local_plan lpObj = new lp_local_plan();
            lpObj.ConnectionString = DataAccess.getConnStr();
            lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID + "PlanID"].ToString()));

            string roleid = Session[Session.SessionID + "roleid"].ToString();
            switch (lpObj.Key_local_plan_level_id.ToString())
            {
                case "101":
                    //Level 0 Awaiting CO Admin

                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                       //     if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                     //       else
                     //           hlNewAmendment.Visible = true;
                            break;
                        case "102":
                            //CAO
                     //       if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                     //       else
                     //           hlNewAmendment.Visible = true;
                            break;
                        case "101":
                            //SO Admin
                    //        if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                   //         else
                   //             hlNewAmendment.Visible = true;
                            break;
                        case "104":
                            //View Only
                            hlNewAmendment.Visible = false;
                            break;
                    }

                    break;
                case "102":
                    //Level 1 Awaiting CAO
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin

                     //       if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                     //       else
                      //          hlNewAmendment.Visible = true;

                            break;
                        case "102":
                            //CAO
                      //      if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                      //      else
                      //          hlNewAmendment.Visible = true;

                            break;
                        case "101":
                            //SO Admin
                       //     if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                        //    else
                       //         hlNewAmendment.Visible = true;

                            break;
                        case "104":
                            //View Only
                            hlNewAmendment.Visible = false;
                            break;
                    }
                    break;
                case "103":
                    //Review by So
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                     //       if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                      //      else
                      //          hlNewAmendment.Visible = true;

                            break;
                        case "102":
                            //CAO
                         //   if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                          //  else
                          //      hlNewAmendment.Visible = true;

                            break;
                        case "101":
                            //SO Admin
                          //  if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                          //  else
                          //      hlNewAmendment.Visible = true;

                            break;
                        case "104":
                            //View Only
                            hlNewAmendment.Visible = false;
                            break;
                    }
                    break;

                case "104":
                    //So 3 Revision Requested by So
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                        //    if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                         //   else
                        //        hlNewAmendment.Visible = true;
                            break;
                        case "102":
                            //CAO
                        //    if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                       //     else
                       //         hlNewAmendment.Visible = true;
                            break;
                        case "101":
                            //SO Admin
                         //       hlNewAmendment.Visible = true;
                            hlNewAmendment.Visible = false;
                            break;
                        case "104":
                            //View Only
                            hlNewAmendment.Visible = false;
                            break;
                    }
                    break;

                case "105":
                    //Level 4 Pending SDE Review
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                       //     if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                       //     else
                       //         hlNewAmendment.Visible = true;

                            break;
                        case "102":
                            //CAO
                      //      if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                       //     else
                       //         hlNewAmendment.Visible = true;
                            break;
                        case "101":
                            //SO Admin

                        //    if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                        //    else
                         //       hlNewAmendment.Visible = true;

                            break;
                        case "104":
                            //View Only
                            hlNewAmendment.Visible = false;
                            break;
                    }
                    break;

                case "106":
                    //Level 5 Approved
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                            else
                                hlNewAmendment.Visible = true;

                            break;
                        case "102":
                            //CAO
                            if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                            else
                                hlNewAmendment.Visible = true;

                            break;
                        case "101":
                            //SO Admin
                            if (lpObj.Flg_lock_amendment_period == true)
                                hlNewAmendment.Visible = false;
                            else
                                hlNewAmendment.Visible = true;

                            break;
                        case "104":
                            //View Only
                            hlNewAmendment.Visible = false;

                            break;
                    }
                    break;

                default:
                    // View Only, and anything not covered
                    hlNewAmendment.Visible = false;
                    break;
            }
        }
        catch
        {
            scs_error_dictionary errObj = new scs_error_dictionary();
            errObj.ConnectionString = DataAccess.getConnStr();

            hfLocal_plan_id.Value = "-1";
            if (errObj.LoadByPrimaryKey("100"))
            {
                lblErr.Text = errObj.Txt_message;
            }
            Panel1.Visible = false;
        }

        //try
        //{
        //    DataView dv = (DataView)SQLDS_RLGETPLANSTATUS.Select(DataSourceSelectArguments.Empty);
        //    if (dv.Table.Rows.Count > 0)
        //    {
        //        Boolean returnval = (Boolean)dv.Table.Rows[0][0];
        //        if (returnval)
        //        {
        //            //deactivate button if status is closed on plan status
        //            string nostring = "Filler Line";
        //                              hlNewAmendment.Visible = false;
        //        }

        //    }
        //}
        //catch (Exception ex)
        //{

        //}
    }
    protected void GearBox_NarrativeDetails_Security()
    {
        lp_local_plan lpObj = new lp_local_plan();
        lpObj.ConnectionString = DataAccess.getConnStr();
        try
        {
            lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID + "PlanID"].ToString()));

        string roleid = Session[Session.SessionID + "roleid"].ToString();
        switch (lpObj.Key_local_plan_level_id.ToString())
        {
            case "101":
                //Level 0 Awaiting CO Admin

                switch (roleid)
                {
                    case "103":
                        //CO Admin
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = true;
                        btnUpdate.Enabled = true;
                        btnClose.Enabled = true;
                        btnPrint.Enabled = true;

                        disable_textBoxes(txtSystemOfficeNotes);

                        ddStatus.Enabled = false;
                        break;
                    case "102":
                        //CAO
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = true;
                        btnUpdate.Enabled = true;
                        btnClose.Enabled = true;
                        btnPrint.Enabled = true;
                        disable_textBoxes(txtSystemOfficeNotes);
                        ddStatus.Enabled = false;

                        break;
                    case "101":
                        //SO Admin
                        cbLocked.Enabled = true;
                        cbApproved.Enabled = true;
                        btnEditResponse.Enabled = true;
                        btnUpdate.Enabled = true;
                        btnClose.Enabled = true;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = true;
                        txtSystemOfficeNotes.ReadOnly = false;
                        break;
                    case "104":
                        //View Only
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        btnClose.Enabled = true;
                        btnPrint.Enabled = true;
                        disable_textBoxes(txtSystemOfficeNotes);
                        ddStatus.Enabled = false;
                        LinkButton1.Visible = false;
                        break;
                }

                break;
            case "102":
                //Level 1 Awaiting CAO
                switch (roleid)
                {
                    case "103":
                        //CO Admin
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = true;
                        btnUpdate.Enabled = true;
                        btnClose.Enabled = true;
                        btnPrint.Enabled = true;
                        disable_textBoxes(txtSystemOfficeNotes);
                        ddStatus.Enabled = false;

                        break;
                    case "102":
                        //CAO
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = true;
                        btnUpdate.Enabled = true;
                        btnClose.Enabled = true;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        break;
                    case "101":
                        //SO Admin
                        cbLocked.Enabled = true;
                        cbApproved.Enabled = true;
                        btnEditResponse.Enabled = true;
                        btnUpdate.Enabled = true;
                        btnClose.Enabled = true;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = true;
                        txtSystemOfficeNotes.ReadOnly = false;
                        break;
                    case "104":
                        //View Only
                        LinkButton1.Enabled = true;
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;
                        break;
                }
                break;
            case "103":
                //Review by So
                switch (roleid)
                {
                    case "103":
                        //CO Admin
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = false;
                        txtSystemOfficeNotes.ReadOnly = true;
                        LinkButton1.Visible = false;

                        break;
                    case "102":
                        //CAO
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;

                        break;
                    case "101":
                        //SO Admin
                        cbLocked.Enabled = true;
                        cbApproved.Enabled = true;
                        btnEditResponse.Enabled = true;
                        btnUpdate.Enabled = true;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = true;
                        txtSystemOfficeNotes.Enabled = true;
                        break;
                    case "104":
                        //View Only
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                   //10-8-2009 RL BtnPrint no longer Disables     btnPrint.Enabled = false;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;
                        break;
                }
                break;

            case "104":
                //So 3 Revision Requested by So
                switch (roleid)
                {
                    case "103":
                        //CO Admin
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = true;
                        btnUpdate.Enabled = true;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);

                        break;
                    case "102":
                        //CAO
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = true;
                        btnUpdate.Enabled = true;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);

                        break;
                    case "101":
                        //SO Admin
                        cbLocked.Enabled = true;
                        cbApproved.Enabled = true;
                        btnEditResponse.Enabled = true;
                        btnUpdate.Enabled = true;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = true;
                        txtSystemOfficeNotes.Enabled = true;
                        break;
                    case "104":
                        //View Only
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        //10-8-2009 RL btnprint button no longer disables  btnPrint.Enabled = false;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;
                        break;
                }
                break;

            case "105":
                //Level 4 Pending SDE Review
                switch (roleid)
                {
                    case "103":
                        //CO Admin
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;

                        break;
                    case "102":
                        //CAO
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;
                        break;
                    case "101":
                        //SO Admin

                        cbLocked.Enabled = true;
                        cbApproved.Enabled = true;
                        btnEditResponse.Enabled = true;
                        btnUpdate.Enabled = true;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = true;
                        txtSystemOfficeNotes.Enabled = true;
                        break;
                    case "104":
                        //View Only
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;
                        break;
                }
                break;

            case "106":
                //Level 5 Approved
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        //10-8-2009 RL btnprint button no longer disables    btnPrint.Enabled = false;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;
                        break;
                    case "102":
                        //CAO
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        //10-8-2009 RL btnprint button no longer disables        btnPrint.Enabled = false;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;
                        break;
                    case "101":
                        //SO Admin
                        cbLocked.Enabled = true;
                        cbApproved.Enabled = true;
                        btnEditResponse.Enabled = true;
                        btnUpdate.Enabled = true;
                        btnPrint.Enabled = true;
                        ddStatus.Enabled = true;
                        txtSystemOfficeNotes.Enabled = true;
                        LinkButton1.Enabled = true;
                        break;
                    case "104":
                        //View Only
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                    //10-8-2009 RL btnprint button no longer disables    btnPrint.Enabled = false;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;
                        break;
                }
                break;

            case "107":
                //Level 6 Closed
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        //10-8-2009 RL btnprint button no longer disables   btnPrint.Enabled = false;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;
                        break;
                    case "102":
                        //CAO
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        //10-8-2009 RL btnprint button no longer disables  btnPrint.Enabled = false;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;

                        break;
                    case "101":
                        //SO Admin
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        //10-8-2009 RL btnprint button no longer disables  btnPrint.Enabled = false;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;

                        break;
                    case "104":
                        //View Only
                        cbLocked.Enabled = false;
                        cbApproved.Enabled = false;
                        btnEditResponse.Enabled = false;
                        btnUpdate.Enabled = false;
                        //10-8-2009 RL btnprint button no longer disables  btnPrint.Enabled = false;
                        ddStatus.Enabled = false;
                        disable_textBoxes(txtSystemOfficeNotes);
                        LinkButton1.Visible = false;
                        break;
                }
                break;
            default:
                // View Only, and anything not covered

                break;

        }
        }
        catch
        {
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ddStatus.DataBind();

            //Add attributes
            //btnEditResponse.Attributes.Add("onclick", "TextEdit()");

            lblId.Text = Request.QueryString.Get("nid").ToString();
            String ssId = "TextEditor" + Request.QueryString["nid"].ToString();

            DataAccess obj = new DataAccess();
            SqlDataReader dr = obj.getNarrativeDetails(Convert.ToInt32(Request.QueryString["nid"].ToString()));

            if (dr.HasRows)
                while (dr.Read())
                {
                    lp_local_plan lpObj = new lp_local_plan();

                    if (lpObj.LoadByPrimaryKey(Convert.ToInt32(dr["key_local_plan_id"].ToString())))
                    {
                        lblCollege.Text = lpObj.Txt_college_name;
                        lblFiscalYear.Text = lpObj.Nbr_fiscal_year.ToString();
                    }

                    lblId.Text = dr["key_local_plan_narrative_id"].ToString();
                    hfNid.Value = dr["key_local_plan_narrative_id"].ToString();
                    lblSection.Text = dr["txt_narrative_section_title"].ToString();
                    lblDescription.Text = dr["txt_narrative_desc"].ToString();

                    if (Session[ssId] == null)
                    {
                        lblResponse.Text = dr["txt_narrative_response"].ToString();
                        Session.Add(ssId, lblResponse.Text);
                        //Session[ssId] = ;
                    }
                    else
                        lblResponse.Text = (String)Session[ssId];

                    this.txtSystemOfficeNotes.Text = dr["txt_system_office_notes"].ToString();

                    try
                    {
                        cbLocked.Checked = (bool)dr["flg_locked"];

                    }
                    catch
                    {
                        cbLocked.Checked = false;
                    }
                    try
                    {
                        cbApproved.Checked = (bool)dr["flg_approved"];
                    }
                    catch
                    {
                        cbApproved.Checked = false;
                    }

                    ddStatus.SelectedIndex = ddStatus.Items.IndexOf(ddStatus.Items.FindByValue(dr["key_level_id"].ToString()));

                    if ((bool)dr["flg_optional"] == true)
                        lblResponsOpt.Text = "Response Optional";
                    else
                        lblResponsOpt.Text = "Response Required";
                    try
                    {
                        lblDateUpdated.Text = string.Format("{0:d}", dr["dte_updated_date"]);
                    }
                    catch
                    {
                        lblDateUpdated.Text = "";
                    }

                    try
                    {
                        lblUpdatedBy.Text = dr["txt_updated_user"].ToString();
                    }
                    catch
                    {
                        lblUpdatedBy.Text = "";
                    }

                }
        }
    }
    protected void GearBox_ActivityReimbursement_Secruity()
    {
        lp_local_plan lpObj = new lp_local_plan();
        lpObj.ConnectionString = DataAccess.getConnStr();
        lpObj.LoadByPrimaryKey(Convert.ToInt32(hfLpId.Value));

        try
        {

            string roleid = Session[Session.SessionID + "roleid"].ToString();
            switch (lpObj.Key_local_plan_level_id.ToString())
            {
                case "101":
                    //Level 0 Awaiting CO Admin

                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;

                            break;
                        case "102":
                            //CAO
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;
                            break;
                        case "101":
                            //SO Admin
                            ddlActivityLineItem.Enabled = true;
                            ddlQuarter.Enabled = true;
                            txtAmount.Enabled = true;
                            btnSave.Enabled = true;
                            btnClear.Enabled = true;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = true;
                            break;
                        case "104":
                            //View Only
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;
                            break;
                    }

                    break;
                case "102":
                    //Level 1 Awaiting CAO
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;

                            break;
                        case "102":
                            //CAO
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;
                            break;
                        case "101":
                            //SO Admin
                            ddlActivityLineItem.Enabled = true;
                            ddlQuarter.Enabled = true;
                            txtAmount.Enabled = true;
                            btnSave.Enabled = true;
                            btnClear.Enabled = true;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = true;
                            break;
                        case "104":
                            //View Only
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;
                            break;
                    }
                    break;
                case "103":
                    //Review by So
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;

                            break;
                        case "102":
                            //CAO
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;

                            break;
                        case "101":
                            //SO Admin
                            ddlActivityLineItem.Enabled = true;
                            ddlQuarter.Enabled = true;
                            txtAmount.Enabled = true;
                            btnSave.Enabled = true;
                            btnClear.Enabled = true;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = true;
                            break;
                        case "104":
                            //View Only
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;
                            break;
                    }
                    break;

                case "104":
                    //So 3 Revision Requested by So
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;

                            break;
                        case "102":
                            //CAO
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;
                            break;
                        case "101":
                            //SO Admin
                            ddlActivityLineItem.Enabled = true;
                            ddlQuarter.Enabled = true;
                            txtAmount.Enabled = true;
                            btnSave.Enabled = true;
                            btnClear.Enabled = true;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = true;
                            break;
                        case "104":
                            //View Only
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;
                            break;
                    }
                    break;

                case "105":
                    //Level 4 Pending SDE Review
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin

                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;

                            break;
                        case "102":
                            //CAO
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;

                            break;
                        case "101":
                            //SO Admin
                            ddlActivityLineItem.Enabled = true;
                            ddlQuarter.Enabled = true;
                            txtAmount.Enabled = true;
                            btnSave.Enabled = true;
                            btnClear.Enabled = true;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = true;

                            break;
                        case "104":
                            //View Only
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;
                            break;
                    }
                    break;

                case "106":
                    //Level 5 Approved
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin

                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;

                            break;
                        case "102":
                            //CAO
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;

                            break;
                        case "101":
                            //SO Admin
                            ddlActivityLineItem.Enabled = true;
                            ddlQuarter.Enabled = true;
                            txtAmount.Enabled = true;
                            btnSave.Enabled = true;
                            btnClear.Enabled = true;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = true;
                            break;
                        case "104":
                            //View Only
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;
                            break;
                    }
                    break;

                case "107":
                    //Level 6 Closed
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;

                            break;
                        case "102":
                            //CAO
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;
                            break;
                        case "101":
                            //SO Admin
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;
                            break;
                        case "104":
                            //View Only
                            ddlActivityLineItem.Enabled = false;
                            ddlQuarter.Enabled = false;
                            txtAmount.Enabled = false;
                            btnSave.Enabled = false;
                            btnClear.Enabled = false;
                            RadGrid2.MasterTableView.Columns.FindByUniqueName("column").Display = false;
                            break;
                    }
                    break;
                default:
                    // View Only, and anything not covered

                    break;
            }
        }
        catch (Exception ex)
        {
            scs_error_dictionary errObj = new scs_error_dictionary();
            errObj.ConnectionString = DataAccess.getConnStr();
            if (errObj.LoadByPrimaryKey("100"))
            {
                lblErr.Text = errObj.Txt_message;
                //lblErr.Text = ex.ToString();
            }
            else
                lblErr.Text = ex.ToString();

        }
    }
Ejemplo n.º 7
0
    public static void addPageInfoChange(Page cp, String pageName)
    {
        if (cp != null)
        {
            try
            {
                HtmlForm form1 = (HtmlForm)cp.FindControl("form1");

                switch (pageName)
                {
                    case "ActivityForm":
                        if (form1 != null)
                        {
                            RadMultiPage rmp = (RadMultiPage)form1.FindControl("RadMultiViewActivity");

                            PageView pv1 = (PageView)rmp.FindControl("PgViewActivity");

                            foreach (Control childCtrl in pv1.Controls)
                            {
                                if (childCtrl is TextBox)
                                {
                                    //Response.write("Requiredfieldvalidator<br>")
                                    ((TextBox)childCtrl).Attributes.Add("onChange", "pageInfoChanged('" + childCtrl.ClientID + "')");
                                }
                                if (childCtrl is DropDownList )
                                {
                                    //Response.write("Requiredfieldvalidator<br>")
                                    ((DropDownList)childCtrl).Attributes.Add("onChange", "pageInfoChanged()");
                                }
                                if (childCtrl is CheckBoxList)
                                {
                                    CheckBoxList cbl = (CheckBoxList)childCtrl;
                                    cbl.Attributes.Add("onClick", "pageInfoChanged('cbl')");

                                }
                                if (childCtrl is RadGrid)
                                {
                                    RadGrid grid = (RadGrid)childCtrl;
                                    for (int i = 0; i < grid.Items.Count; i++ )
                                    {
                                        TextBox txt_Funds = (TextBox) grid.Items[i].FindControl("txt_Funds");
                                        if (txt_Funds != null)
                                            txt_Funds.Attributes.Add("onChange", "pageInfoChanged()");
                                    }
                                }
                            }
                        }
                        break;
                    case "ActivityEquipment":

                        if (form1 != null)
                        {
                            RadMultiPage rmp = (RadMultiPage) form1.FindControl("RadMultiViewActivity");

                            PageView pv1 = (PageView)rmp.FindControl("PgViewActivity");

                            foreach (Control childCtrl in pv1.Controls)
                            {
                                if (childCtrl is TextBox)
                                {
                                    //Response.write("Requiredfieldvalidator<br>")
                                    ((TextBox)childCtrl).Attributes.Add("onChange", "pageInfoChanged()");
                                }
                                if (childCtrl is DropDownList)
                                {
                                    //Response.write("Requiredfieldvalidator<br>")
                                    ((DropDownList)childCtrl).Attributes.Add("onChange", "pageInfoChanged()");
                                }
                                if (childCtrl is CheckBoxList)
                                {
                                    CheckBoxList cbl = (CheckBoxList)childCtrl;
                                    lp_local_plan lpObj = new lp_local_plan();

                                    lpObj.LoadByPrimaryKey(Convert.ToInt32(cp.Session[cp.Session.SessionID + "PlanID"].ToString()));
                                    string roleid = cp.Session[cp.Session.SessionID + "roleid"].ToString();

                                    switch (lpObj.Key_local_plan_level_id.ToString())
                                    {
                                        case "101":

                                             switch (roleid)
                                             {
                                                 case "103":
                                                     //CO Admin
                                                     cbl.Attributes.Add("onClick", "pageInfoChanged('cbl')");

                                                     break;
                                                 case "102":
                                                     //CAO

                                                     cbl.Attributes.Add("onClick", "pageInfoChanged('cbl')");
                                                     break;
                                                 case "101":
                                                     //SO Admin
                                                     cbl.Attributes.Add("onClick", "pageInfoChanged('cbl')");
                                                     break;
                                                 case "104":
                                                     //View Only

                                                     break;
                                             }

                                             break;
                                         case "102":
                                             //Level 1 Awaiting CAO
                                             switch (roleid)
                                             {
                                                 case "103":
                                                     //CO Admin
                                                     cbl.Attributes.Add("onClick", "pageInfoChanged('cbl')");

                                                     break;
                                                 case "102":
                                                     //CAO
                                                     cbl.Attributes.Add("onClick", "pageInfoChanged('cbl')");
                                                     break;
                                                 case "101":
                                                     //SO Admin
                                                     cbl.Attributes.Add("onClick", "pageInfoChanged('cbl')");
                                                     break;
                                                 case "104":
                                                     //View Only

                                                     break;
                                             }
                                             break;
                                         case "103":
                                             //Review by So
                                             switch (roleid)
                                             {
                                                 case "103":
                                                     //CO Admin

                                                     break;
                                                 case "102":
                                                     //CAO

                                                     break;
                                                 case "101":
                                                     //SO Admin
                                                     cbl.Attributes.Add("onClick", "pageInfoChanged('cbl')");
                                                     break;
                                                 case "104":
                                                     //View Only

                                                     break;
                                             }
                                             break;

                                         case "104":
                                             //So 3 Revision Requested by So
                                             switch (roleid)
                                             {
                                                 case "103":
                                                     //CO Admin

                                                     break;
                                                 case "102":
                                                     //CAO
                                                     cbl.Attributes.Add("onClick", "pageInfoChanged('cbl')");
                                                     break;
                                                 case "101":
                                                     //SO Admin
                                                     cbl.Attributes.Add("onClick", "pageInfoChanged('cbl')");
                                                     break;
                                                 case "104":
                                                     //View Only

                                                     break;
                                             }
                                             break;

                                         case "105":
                                             //Level 4 Pending SDE Review
                                             switch (roleid)
                                             {
                                                 case "103":
                                                     //CO Admin

                                                     break;
                                                 case "102":
                                                     //CAO
                                                     break;
                                                 case "101":
                                                     //SO Admin
                                                     cbl.Attributes.Add("onClick", "pageInfoChanged('cbl')");
                                                     break;
                                                 case "104":
                                                     //View Only

                                                     break;
                                             }
                                             break;

                                         case "106":
                                             //Level 5 Approved
                                             switch (roleid)
                                             {
                                                 case "103":
                                                     //CO Admin

                                                     break;
                                                 case "102":
                                                     //CAO
                                                     break;
                                                 case "101":
                                                     //SO Admin

                                                     break;
                                                 case "104":
                                                     //View Only

                                                     break;
                                             }
                                             break;

                                         case "107":
                                             //Level 6 Closed
                                             switch (roleid)
                                             {
                                                 case "103":
                                                     //CO Admin

                                                     break;
                                                 case "102":
                                                     //CAO
                                                     break;
                                                 case "101":
                                                     //SO Admin

                                                     break;
                                                 case "104":
                                                     //View Only
                                                     break;
                                             }
                                             break;
                                         default:
                                             // View Only, and anything not covered

                                             break;
                                     }

                                }
                                if (childCtrl is RadGrid)
                                {
                                    RadGrid grid = (RadGrid)childCtrl;
                                    for (int i = 0; i < grid.Items.Count; i++)
                                    {
                                        TextBox txt_Funds = (TextBox)grid.Items[i].FindControl("txt_Funds");
                                        if (txt_Funds != null)
                                            txt_Funds.Attributes.Add("onChange", "pageInfoChanged()");
                                    }
                                }
                            }
                        }
                        break;
                }

            }
            catch (Exception ex)
            {
                //return ex.ToString();
            }
        }
    }
    protected override void OnPreRenderComplete(EventArgs e)
    {
        base.OnPreRenderComplete(e);
        try
        {
            hfLpId.Value = Session[Session.SessionID.ToString() + "PlanID"].ToString();
        }
        catch
        {
        }

        lp_local_plan lpObj = new lp_local_plan();

        DataAccess daObj = new DataAccess();
        SqlDataReader mydr = daObj.getAvialableFund(Convert.ToInt32(hfLpId.Value));

        if (mydr.HasRows)
        {
            while(mydr.Read())
            {
            try
            {
                hfTotBal.Value = mydr["nbr_local_plan_balance"].ToString();
                try
                {
                    txtAvailableFunds.Text = string.Format("{0:C}", mydr["nbr_local_plan_balance"]);
                }
                catch
                {
                    txtAvailableFunds.Text = string.Format("{0:C}", 0);
                }

                lblNewTotalLineItem.Text = string.Format("{0:C}", Double.Parse(hfTotBal.Value) + Double.Parse(hfGridTot.Value));

                try{
                    if (lpObj.LoadByPrimaryKey(Convert.ToInt32(hfLpId.Value)))
                    {
                        if (lpObj.Flg_lock_amendment_period != true && ddStatus.SelectedValue == "107")
                            RadTabStrip1.Tabs[1].Visible = true;
                        else
                            RadTabStrip1.Tabs[1].Visible = false;
                    }
                    else
                        RadTabStrip1.Tabs[1].Visible = false;
                }
                catch(Exception ex)
                {
                    RadTabStrip1.Tabs[1].Visible = false;
                }
            }
            catch
            {
            }
            }
        }
        //if (lpObj.LoadByPrimaryKey(Convert.ToInt32(hfLpId.Value)))
        //{
        //    try
        //    {
        //        hfTotBal.Value = lpObj.nbr_balance.ToString();
        //        try
        //        {
        //            txtAvailableFunds.Text = string.Format("{0:C}", lpObj.nbr_balance);
        //        }
        //        catch
        //        {
        //            txtAvailableFunds.Text = string.Format("{0:C}", 0);
        //        }
        //    }
        //    catch
        //    {
        //    }
        //}
        GearBox_ActivityForm_Secruity();
        Utility.addPageInfoChange(this.Page, "ActivityEquipment");
    }
Ejemplo n.º 9
0
    protected void RadGrid1_DataBound1(object sender, EventArgs e)
    {
        foreach (GridDataItem item in RadGrid1.Items)
        {
            HyperLink mylink = new HyperLink();
            mylink = (HyperLink)item.FindControl("lbView");

            HyperLink hlReimb = (HyperLink)item.FindControl("hlReimbursement");

            if(mylink !=null)
                mylink.NavigateUrl = "javascript:popup(" + item["key_activity_id"].Text.Trim().ToLower() + ",'" + item["txt_activity_type_desc"].Text + "','" + item["key_amendment_reason_id"].Text + "');";

            if (hlReimb != null)
                hlReimb.NavigateUrl = "javascript:openReimbursement(" + item["key_activity_id"].Text.Trim().ToLower() + ");";

            hfLocal_plan_id.Value = Session[Session.SessionID.ToString() + "PlanID"].ToString();
            hl_fundpl.NavigateUrl = "Javascript:OpenFundingplan(" + hfLocal_plan_id.Value + ")";
            lblErr.Text = "";
            Panel1.Visible = true;

            #region This section test for Plan Level and Roleid if Level 103 - Under review by So and userroleid 101 SO Admin allow quick checkbox update else no updateing available
            lp_local_plan lpObj = new lp_local_plan();
            lpObj.ConnectionString = DataAccess.getConnStr();
            lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID + "PlanID"].ToString()));

            string roleid = Session[Session.SessionID + "roleid"].ToString();

            if (lpObj.Key_local_plan_level_id.ToString() != "103" || roleid != "101")
            {

                (item["flg_approved"].FindControl("chb_approvals") as CheckBox).Attributes.Add("disabled", "true");
            }

        #endregion
        }
    }
Ejemplo n.º 10
0
    protected void RadGrid1_DataBound(object sender, EventArgs e)
    {
        try
           {
           lp_local_plan lpObj = new lp_local_plan();
           lpObj.ConnectionString = DataAccess.getConnStr();
           lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID + "PlanID"].ToString()));

           string roleid = Session[Session.SessionID + "roleid"].ToString();
           foreach (GridDataItem item in RadGrid1.Items)
           {
               #region This section test for Plan Level and Roleid if Level 103 - Under review by So and userroleid 101 SO Admin allow quick checkbox update else no updateing available

               if (lpObj.Key_local_plan_level_id.ToString() != "103" || roleid != "101")
               {

                   (item["flg_approved"].FindControl("chb_approvals") as CheckBox).Attributes.Add("disabled", "true");
               }

               #endregion

           }
           }
           catch
           {
           }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        txtNewActivityDesc.Attributes.Add("onKeyUp", "calCharNumber1()");
        txtNewCoreIndicatorDesc.Attributes.Add("onKeyUp", "calCharNumber2()");

        if (!Page.IsPostBack)
        {
            SqlDS_RLcoreindi_Get.DataBind();
            cblCoreIndicators.DataBind();

            lblMsg.Text = "";

            lp_local_plan lpObj = new lp_local_plan();

            if (lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID.ToString() + "PlanID"].ToString())))
            {
                lblCollege.Text = lpObj.Txt_college_name;
                lblFiscalYear.Text = lpObj.Nbr_fiscal_year.ToString();
            }

            act_activity actObj = new act_activity();
            actObj.ConnectionString = DataAccess.getConnStr();

            if (actObj.LoadByPrimaryKey(Convert.ToInt32(Request.QueryString.Get("aid").ToString())))
            {

                lblAvtivityNbr.Text = actObj.Key_activity_id.ToString();
                lblActivityName.Text = actObj.Txt_activity_name;

                lblActivityDesc.Text = actObj.Txt_activity_desc;

                try
                {
                    lblCoreIndicatorDesc.Text = actObj.Txt_activity_core_indicator_desc;
                    //txtNewCoreIndicatorDesc.Text = actObj.Txt_activity_core_indicator_desc;
                }
                catch
                {
                    lblCoreIndicatorDesc.Text = "";
                    //txtNewCoreIndicatorDesc.Text = "";
                }

                //try
                //{
                //    cbApproved.Checked = actObj.Flg_approved;
                //}
                //catch
                //{
                //    cbApproved.Checked = false;
                //}

            }

            if (Request.QueryString.Get("acrId").ToString().Equals("-1"))
            {
                //Add new
                btnDelete.Visible = false;
                btnSave.Text = "Add";
                lblAvtivityNbr.Text = "";
                lblDateCreated.Text = DateTime.Now.ToShortDateString();

                txtNewActivityName.Text = actObj.Txt_activity_name;
                //txtNewActivityDesc.Text = actObj.Txt_activity_desc;

            }
            else
            {
                // Edit
                btnDelete.Visible = true;
                btnSave.Text = "Save";

                act_change acObj = new act_change();

                if (acObj.LoadByPrimaryKey(Convert.ToInt32(Request.QueryString.Get("acrId").ToString())))
                {
                    txtNewActivityName.Text = acObj.Txt_activity_name_new;

                    try
                    {
                        txtNewCoreIndicatorDesc.Text = acObj.Txt_activity_core_indicator_desc_new;
                    }
                    catch
                    {
                        txtNewCoreIndicatorDesc.Text = "";
                    }

                    try
                    {
                        txtNewActivityDesc.Text = acObj.Txt_activity_desc_new;
                    }
                    catch
                    {
                        txtNewActivityDesc.Text = "";
                    }

                    try{
                        cbApproved.Checked = acObj.Flg_approved;
                    }
                    catch{
                        cbApproved.Checked = false;

                    }

                    if (cbApproved.Checked)
                    {
                        btnSave.Enabled = false;
                        cbApproved.Enabled = false;
                    }
                    else
                    {
                        btnSave.Enabled = true;
                        cbApproved.Enabled = true;
                    }

                    lblDateCreated.Text = acObj.Dte_create_date.ToShortDateString();
                }

            }
        }
    }
    protected void GearBox_Activity_Funded_Change_Secruity()
    {
        lp_local_plan lpObj = new lp_local_plan();
        lpObj.ConnectionString = DataAccess.getConnStr();
        lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID + "PlanID"].ToString()));

         //   string mysb;
         //   mysb = "var ddcheck =  document.getElementById('cblCoreIndicators_0');ddcheck.disabled =true;ddcheck =  document.getElementById('cblCoreIndicators_1');ddcheck.disabled =true;ddcheck =  document.getElementById('cblCoreIndicators_2');ddcheck.disabled =true;ddcheck =  document.getElementById('cblCoreIndicators_3');ddcheck.disabled =true;ddcheck =  document.getElementById('cblCoreIndicators_4');ddcheck.disabled =true;ddcheck =  document.getElementById('cblCoreIndicators_5');ddcheck.disabled =true;";

        string roleid = Session[Session.SessionID + "roleid"].ToString();
        switch (lpObj.Key_local_plan_level_id.ToString())
        {
            case "101":
                //Level 0 Awaiting CO Admin

                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        //cbApproved.Enabled = false;
                        cbApproved.Enabled = false;

                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;

                        btnSave.Enabled = true;
                        btnDelete.Enabled = true;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }

                break;
            case "102":
                //Level 1 Awaiting CAO
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        //cbApproved.Enabled = false;
                        cbApproved.Enabled = false;

                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;

                        btnSave.Enabled = true;
                        btnDelete.Enabled = true;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }
                break;
            case "103":
                //Review by So
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        //cbApproved.Enabled = false;
                        cbApproved.Enabled = false;

                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;

                        btnSave.Enabled = true;
                        btnDelete.Enabled = true;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }
                break;

            case "104":
                //So 3 Revision Requested by So
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        //cbApproved.Enabled = false;
                        cbApproved.Enabled = false;

                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;

                        btnSave.Enabled = true;
                        btnDelete.Enabled = true;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }
                break;

            case "105":
                //Level 4 Pending SDE Review
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        //cbApproved.Enabled = false;
                        cbApproved.Enabled = false;

                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;

                        btnSave.Enabled = true;
                        btnDelete.Enabled = true;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }
                break;

            case "106":
                //Level 5 Approved
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        //cbApproved.Enabled = false;
                        cbApproved.Enabled = false;

                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;

                        btnSave.Enabled = true;
                        btnDelete.Enabled = true;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }
                break;

            case "107":
                //Level 6 Closed
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        //cbApproved.Enabled = false;
                        cbApproved.Enabled = false;

                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;

                        btnSave.Enabled = true;
                        btnDelete.Enabled = true;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }
                break;
            default:
                // View Only, and anything not covered

                break;

        }
    }
    protected override void OnPreRenderComplete(EventArgs e)
    {
        base.OnPreRenderComplete(e);

        try
        {
            hfLocal_plan_id.Value = Session[Session.SessionID.ToString() + "PlanID"].ToString();
            //(FormView1.FindControl("lblMsg") as Label).Text = "";
            //Panel1.Visible = true;
            lp_local_plan lpObj = new lp_local_plan();

            DropDownList ddStatus = (DropDownList) FormView1.FindControl("ddStatus");
            if (lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID.ToString() + "PlanID"].ToString())))
            {
                if (lpObj.Flg_lock_amendment_period != true && ddStatus.SelectedValue == "107")
                {
                    RadTabStrip1.Tabs[1].Visible = true;
                    hlActivityChangeRequest.Visible = true;
                }
                else
                {
                    RadTabStrip1.Tabs[1].Visible = false;
                    hlActivityChangeRequest.Visible = false;
                }

            }
        }
        catch
        {
            scs_error_dictionary errObj = new scs_error_dictionary();
            errObj.ConnectionString = DataAccess.getConnStr();

            hfLocal_plan_id.Value = "-1";
            if (errObj.LoadByPrimaryKey("100"))
            {
                (FormView1.FindControl("lblMsg") as Label).Text = errObj.Txt_message;
            }
            //Panel1.Visible = false;
            hlActivityChangeRequest.Visible = false;
        }
        //RadGrid1.DataBind();
        GearBox_Ammendments_Secruity();
    }
    protected void FireQuerys()
    {
        lp_local_plan lpObj = new lp_local_plan();

        if (lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID.ToString() + "PlanID"].ToString())))
        {
            if (lpObj.Flg_lock_amendment_period == true)
                RadTabStrip1.Tabs[1].Visible = false;
            else
                RadTabStrip1.Tabs[1].Visible = true;
        }

        DataView dx = (DataView)SqlDS_RLcoreindi_Get.Select(DataSourceSelectArguments.Empty);
        CheckBoxList cblCoreIndicators = (CheckBoxList)FormView1.FindControl("chkCoreIndicators");
        foreach (DataRow dr in dx.Table.Rows)
        {
            foreach (ListItem li in cblCoreIndicators.Items)
            {
                if (li.Value.ToString().Trim().ToLower() == dr["key_core_indicator_id"].ToString().ToLower().Trim())
                {
                    li.Selected = true;
                }
            }
        }

        Label myactfrom = (Label)FormView1.FindControl("lblAcitvityFrom");
        Label mylblCategoryFrom = (Label)FormView1.FindControl("lblCategoryFrom");
        Label mylblFunctionFrom = (Label)FormView1.FindControl("lblFunctionFrom");

        DataView DV = (DataView)this.SQLDS_RLMOVEFROM_CAT.Select(DataSourceSelectArguments.Empty);
        if (DV.Table.Rows.Count > 0)
        {
            myactfrom.Text = DV.Table.Rows[0][0].ToString();
            mylblCategoryFrom.Text = DV.Table.Rows[0][2].ToString();
            mylblFunctionFrom.Text = DV.Table.Rows[0][1].ToString();

        }

        Label mylblActivityTo = (Label)FormView1.FindControl("lblActivityTo");
        Label mylblCategoryTo = (Label)FormView1.FindControl("lblCategoryTo");
        Label mylblFunctionTo = (Label)FormView1.FindControl("lblFunctionTo");

        DV = (DataView)this.sqlds_rlmoveto_cat.Select(DataSourceSelectArguments.Empty);
        if (DV.Table.Rows.Count > 0)
        {
            mylblActivityTo.Text = DV.Table.Rows[0][0].ToString();
            mylblCategoryTo.Text = DV.Table.Rows[0][2].ToString();
            mylblFunctionTo.Text = DV.Table.Rows[0][1].ToString();

        }

        DV = (DataView)this.SqlDS_RLactivityGET.Select(DataSourceSelectArguments.Empty);
        if (DV.Table.Rows.Count > 0)
        {
            if (!DV.Table.Rows[0]["flg_locked"].ToString().Equals("False"))
                hlActivityChangeRequest.Visible = false;

            DropDownList dd_cat = FormView1.FindControl("DLB_Category") as DropDownList;
            DropDownList dd_fund = FormView1.FindControl("DLB_FunCode") as DropDownList;
            DropDownList dd_use = FormView1.FindControl("ddlUseOfFunds") as DropDownList;
            DropDownList dd_type = FormView1.FindControl("ddlProgramType") as DropDownList;

            dd_fund.DataBind();

            dd_cat.SelectedIndex = dd_cat.Items.IndexOf(dd_cat.Items.FindByValue(DV.Table.Rows[0][6].ToString()));
            dd_fund.SelectedIndex = dd_fund.Items.IndexOf(dd_fund.Items.FindByValue(DV.Table.Rows[0][7].ToString()));

            dd_use.SelectedIndex = dd_use.Items.IndexOf(dd_use.Items.FindByValue(DV.Table.Rows[0][9].ToString()));
            dd_type.SelectedIndex = dd_type.Items.IndexOf(dd_type.Items.FindByValue(DV.Table.Rows[0][5].ToString()));
        }
    }
Ejemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.RadMultiViewActivity.SelectedIndex = 0;
            RadTabStrip1.SelectedIndex = 0;
            hlActivityChangeRequest.Attributes.Add("onclick", "editActivityChangeRequest(" + Request.QueryString.Get("id").ToString() + ",-1, 'activityFunds')");

            DLB_Category.Attributes.Add("OnChange", "saveCurrentBudget()");
            txtDescActivity.Attributes.Add("onkeyup", "calCharNumber()");

            txtDescCoreInd.Attributes.Add("onkeyup", "calCharNumber1()");
        }
        try
        {
            if (Request.QueryString.Get("reload") == "true")
            {
                RadTabStrip1.SelectedIndex = 1;
                RadMultiViewActivity.SelectedIndex = 1;
            }

        }
        catch
        {
        }
        if (!IsPostBack)
        {

            DLB_Category.DataBind();
            DLB_FunCode.DataBind();
            ddlUseOfFunds.DataBind();
            TRG_Funds.DataBind();
            DLB_ActType.DataBind();
            ddlProgramType.DataBind();
            ddStatus.DataBind();
            cblCoreIndicators.DataBind();
            hfPageInfo.Value = "0";

            lblMsg.Text = "";

            try
            {
                this.RadMultiViewActivity.SelectedIndex = Convert.ToInt32(Request.QueryString.Get("view").ToString());
                RadTabStrip1.SelectedIndex = Convert.ToInt32(Request.QueryString.Get("view").ToString());
            }
            catch { }

            lp_local_plan lpObj = new lp_local_plan();

            if (lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID.ToString() + "PlanID"].ToString())))
            {
                lblCollege.Text = lpObj.Txt_college_name;
                lblFiscalYear.Text = lpObj.Nbr_fiscal_year.ToString();
            }

            if(Request.QueryString.Get("id").ToString().Equals("-1"))
            {
                //Add new
                btnDelete.Visible = false;
                btnSave.Text = "Add";
                lblAvtivityNbr.Text = "";
                RadTabStrip1.Tabs[1].Visible = false;
                btnPrint.Enabled = false;
                btn_Print_History.Enabled = false;
                btnPrintWord.Enabled = false;
            }
            else
            {
                // Edit
                //btnDelete.Visible = true;
                btnSave.Text = "Save";

                 //DataView dw = (DataView)SqlDS_RLactivityGET.Select(DataSourceSelectArguments.Empty);
                 //foreach (DataRow dr in dw.Table.Rows)
                 //{
                 //    DLB_ActType.SelectedIndex = DLB_ActType.Items.IndexOf(DLB_ActType.Items.FindByValue(dr["key_activity_type_id"].ToString()));

                 //    txtActivityName.Text = dr["txt_activity_name"].ToString();
                 //    txtDescActivity.Text = dr["txt_activity_desc"].ToString();
                 //    txtDescCoreInd.Text = dr["txt_activity_core_indicator_desc"].ToString();
                 //    DLB_Category.SelectedIndex = DLB_Category.Items.IndexOf(DLB_Category.Items.FindByValue(dr["key_category_id"].ToString()));
                 //    DLB_FunCode.SelectedIndex = DLB_FunCode.Items.IndexOf(DLB_FunCode.Items.FindByValue(dr["key_function_code_id"].ToString()));
                 //    ddlUseOfFunds.SelectedIndex = ddlUseOfFunds.Items.IndexOf(ddlUseOfFunds.Items.FindByValue(dr["key_fund_source_id"].ToString()));
                 //    ddlProgramType.SelectedIndex = ddlProgramType.Items.IndexOf(ddlProgramType.Items.FindByValue(dr["key_fa_activity_type_id"].ToString()));
                 //}
                act_activity actObj = new act_activity();
                actObj.ConnectionString = DataAccess.getConnStr();

                if (actObj.LoadByPrimaryKey(Convert.ToInt32(Request.QueryString.Get("id").ToString())))
                {

                    try
                    {

                        DLB_ActType.SelectedIndex = DLB_ActType.Items.IndexOf(DLB_ActType.Items.FindByValue(actObj.Key_fa_activity_type_id.ToString()));
                    }
                    catch
                    {
                        DLB_ActType.SelectedIndex = 0;
                    }

                    lblAvtivityNbr.Text = actObj.Key_activity_id.ToString();
                    txtActivityName.Text = actObj.Txt_activity_name;
                    txtDescActivity.Text = actObj.Txt_activity_desc;
                    try
                    {
                        txtDescCoreInd.Text = actObj.Txt_activity_core_indicator_desc;
                    }
                    catch
                    {
                        txtDescCoreInd.Text = "";
                    }
                    DLB_Category.SelectedIndex = DLB_Category.Items.IndexOf(DLB_Category.Items.FindByValue(actObj.Key_category_id.ToString()));

                    try
                    {
                        DLB_FunCode.SelectedIndex = DLB_FunCode.Items.IndexOf(DLB_FunCode.Items.FindByValue(actObj.Key_function_code_id.ToString()));
                    }
                    catch
                    {
                        DLB_FunCode.SelectedIndex = 0;
                    }

                    //ddlUseOfFunds.SelectedIndex = ddlUseOfFunds.Items.IndexOf(ddlUseOfFunds.Items.FindByValue(actObj.Key_fund_source_id.ToString()));
                    //Set for 0 right now - will be changed later
                    ddlUseOfFunds.SelectedIndex = 1;
                    try
                    {
                        ddlProgramType.SelectedIndex = ddlProgramType.Items.IndexOf(ddlProgramType.Items.FindByValue(actObj.Key_fa_activity_type_id.ToString()));
                    }
                    catch
                    {
                        ddlProgramType.SelectedIndex = 0;
                    }
                    try
                    {
                        lblDateUpdated.Text = actObj.Dte_updated_date.ToShortDateString();
                    }
                    catch
                    {
                        lblDateUpdated.Text = "";
                    }

                    try
                    {
                        lblUpdatedBy.Text = actObj.Txt_updated_user;
                    }
                    catch
                    {
                        lblUpdatedBy.Text = "";
                    }
                    try
                    {
                        cbApproved.Checked = actObj.Flg_approved;
                    }
                    catch
                    {
                        cbApproved.Checked = false;
                    }
                    try
                    {
                        cbLocked.Checked = actObj.Flg_locked;
                    }
                    catch
                    {
                        cbLocked.Checked = false;
                    }
                    txtSystemOfficeNotes.Text = actObj.Txt_system_office_notes.ToString();
                    ddStatus.SelectedIndex = ddStatus.Items.IndexOf(ddStatus.Items.FindByValue(actObj.Key_level_id.ToString()));

                }
            }

            DLB_ActType.SelectedIndex = 0;
            if (cbLocked.Checked == true)
            {
                if (!Session[Session.SessionID + "roleid"].ToString().Equals("101"))
                    Lock_Page();

            }
            //else
            //{
            //    if (ddStatus.SelectedIndex < 2)
            //        Lock_SO();
            //}
        }

        try
        {
            SDS_FunctionCODE.SelectParameters.Clear();
            SDS_FunctionCODE.SelectParameters.Add("p_key_category_id", DLB_Category.SelectedValue.ToString());
            DataView DW = (DataView)SDS_FunctionCODE.Select(DataSourceSelectArguments.Empty);

            txt_UseOfFunds.Attributes.Add("ReadOnly", "ReadOnly");
            foreach (DataRow dr in DW.Table.Rows)
            {
                txt_UseOfFunds.Text = dr["txt_category_type_desc"].ToString();
            }
        }
        catch
        {
        }
        if(hfTempTotal.Value.Trim() != "")
            lblTotalBudget.Text = hfTempTotal.Value;
    }
Ejemplo n.º 16
0
    protected void GearBox_Activities_Secruity()
    {
        try
        {

            lp_local_plan lpObj = new lp_local_plan();
            lpObj.ConnectionString = DataAccess.getConnStr();
            lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID + "PlanID"].ToString()));

            string roleid = Session[Session.SessionID + "roleid"].ToString();
            switch (lpObj.Key_local_plan_level_id.ToString())
            {
                case "101":
                    //Level 0 Awaiting CO Admin

                    switch (roleid)
                    {
                        case "103":
                            //CO Admin

                            break;
                        case "102":
                            //CAO

                            break;
                        case "101":
                            //SO Admin
                            RadGrid1.Columns[10].Visible = true;
                            break;
                        case "104":
                            //View Only
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;
                            break;
                    }

                    break;
                case "102":
                    //Level 1 Awaiting CAO
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin

                            break;
                        case "102":
                            //CAO

                            break;
                        case "101":
                            //SO Admin
                            RadGrid1.Columns[10].Visible = true;
                            break;
                        case "104":
                            //View Only
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;
                            break;
                    }
                    break;
                case "103":
                    //Review by So
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;

                            break;
                        case "102":
                            //CAO
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;

                            break;
                        case "101":
                            //SO Admin
                            RadGrid1.Columns[10].Visible = true;
                            break;
                        case "104":
                            //View Only
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;
                            break;
                    }
                    break;

                case "104":
                    //So 3 Revision Requested by So
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin

                            break;
                        case "102":
                            //CAO

                            break;
                        case "101":
                            //SO Admin
                            RadGrid1.Columns[10].Visible = true;
                            break;
                        case "104":
                            //View Only
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;
                            break;
                    }
                    break;

                case "105":
                    //Level 4 Pending SDE Review
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;

                            break;
                        case "102":
                            //CAO
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;

                            break;
                        case "101":
                            //SO Admin

                            RadGrid1.Columns[10].Visible = true;
                            break;
                        case "104":
                            //View Only
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;
                            break;
                    }
                    break;

                case "106":
                    //Level 5 Approved
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;

                            break;
                        case "102":
                            //CAO
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;

                            break;
                        case "101":
                            //SO Admin

                            break;
                        case "104":
                            //View Only
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;
                            break;
                    }
                    break;

                case "107":
                    //Level 6 Closed
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;

                            break;
                        case "102":
                            //CAO
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;

                            break;
                        case "101":
                            //SO Admin
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;

                            break;
                        case "104":
                            //View Only
                            hlNewEA.Visible = false;
                            hlNewFA.Visible = false;
                            break;
                    }
                    break;
                default:
                    // View Only, and anything not covered

                    break;
            }
        }
        catch
        {
            scs_error_dictionary errObj = new scs_error_dictionary();
            errObj.ConnectionString = DataAccess.getConnStr();

            hfLocal_plan_id.Value = "-1";
            if (errObj.LoadByPrimaryKey("100"))
            {
                lblErr.Text = errObj.Txt_message;
            }
            Panel1.Visible = false;
        }
    }
Ejemplo n.º 17
0
    protected override void OnPreRenderComplete(EventArgs e)
    {
        base.OnPreRenderComplete(e);
        DropDownList ddl = (DropDownList)Master.FindControl("DropDownList2");
        hfFiscalYear.Value = ddl.SelectedValue.ToString();

        try
        {

            hfLpid.Value = Session[Session.SessionID + "PlanID"].ToString();
            lblErr.Text = "";
            Panel1.Visible = true;

            lp_local_plan lpObj = new lp_local_plan();
            lpObj.ConnectionString = DataAccess.getConnStr();

            if (lpObj.LoadByPrimaryKey(Convert.ToInt32(hfLpid.Value)))
            {
                if (lpObj.Flg_accepted_assurances == true)
                {
                    cbAccepted.Checked = lpObj.Flg_accepted_assurances;
                }
                else
                    cbAccepted.Checked = false;

            }
            GearBox_Assurances_Secruity();
        }
        catch (Exception ex)
        {
            scs_error_dictionary errObj = new scs_error_dictionary();
            errObj.ConnectionString = DataAccess.getConnStr();

            if (errObj.LoadByPrimaryKey("100"))
            {
                lblErr.Text = errObj.Txt_message;
            }
            hfLpid.Value = "-1";
            //Panel1.Visible = false;
        }
        RadGrid1.DataBind();
        GearBox_Assurances_Secruity();
    }
    protected void GearBox_ActivityForm_Secruity()
    {
        lp_local_plan lpObj = new lp_local_plan();
        lpObj.ConnectionString = DataAccess.getConnStr();
        lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID + "PlanID"].ToString()));

        string mysb;
        mysb = "var ddcheck =  document.getElementById('cblCoreIndicators_0');ddcheck.disabled =true;ddcheck =  document.getElementById('cblCoreIndicators_1');ddcheck.disabled =true;ddcheck =  document.getElementById('cblCoreIndicators_2');ddcheck.disabled =true;ddcheck =  document.getElementById('cblCoreIndicators_3');ddcheck.disabled =true;ddcheck =  document.getElementById('cblCoreIndicators_4');ddcheck.disabled =true;ddcheck =  document.getElementById('cblCoreIndicators_5');ddcheck.disabled =true;";

        string roleid = Session[Session.SessionID + "roleid"].ToString();
        switch (lpObj.Key_local_plan_level_id.ToString())
        {
            case "101":
                //Level 0 Awaiting CO Admin

                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        //disable_TRGFUNDS_TXTBOXES();
                        //Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        //disable_textBoxes(txtTypeEquip);
                        //disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(ddStatus);
                        //Disable_DropDownList(DLB_Category);
                        //Disable_DropDownList(DLB_FunCode);

                        //btnSave.Enabled = false;
                        //btnDelete.Enabled = false;
                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        //disable_TRGFUNDS_TXTBOXES();
                        //Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        //disable_textBoxes(txtTypeEquip);
                        //disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(ddStatus);
                        //Disable_DropDownList(DLB_Category);
                        //Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = true;
                        btnDelete.Enabled = true;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;
                        cbLocked.Enabled = true;
                        txtSystemOfficeNotes.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }

                break;
            case "102":
                //Level 1 Awaiting CAO
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        //disable_TRGFUNDS_TXTBOXES();
                        //Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        //disable_textBoxes(txtTypeEquip);
                        //disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(ddStatus);
                        //Disable_DropDownList(DLB_Category);
                        //Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = true;
                        btnDelete.Enabled = true;
                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        //disable_TRGFUNDS_TXTBOXES();
                        //Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        //disable_textBoxes(txtTypeEquip);
                        //disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(ddStatus);
                        //Disable_DropDownList(DLB_Category);
                        //Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = true;
                        btnDelete.Enabled = true;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;
                        cbLocked.Enabled = true;
                        txtSystemOfficeNotes.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }
                break;
            case "103":
                //Review by So
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                       Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;
                        cbLocked.Enabled = true;
                        txtSystemOfficeNotes.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }
                break;

            case "104":
                //So 3 Revision Requested by So
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        //disable_TRGFUNDS_TXTBOXES();
                        if (cbLocked.Checked)
                        {
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                            Lock_Page();
                        }
                        //disable_textBoxes(txtTypeEquip);
                        //disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(ddStatus);

                        //Disable_DropDownList(DLB_Category);
                        //Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = true;
                        btnDelete.Enabled = true;
                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        //disable_TRGFUNDS_TXTBOXES();
                   //     Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        //disable_textBoxes(txtTypeEquip);
                       // disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        //Disable_DropDownList(DLB_Category);
                        //Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = true;
                        btnDelete.Enabled = true;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;
                        cbLocked.Enabled = true;
                        txtSystemOfficeNotes.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }
                break;

            case "105":
                //Level 4 Pending SDE Review
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;
                        cbLocked.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }
                break;

            case "106":
                //Level 5 Approved
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;
                        cbLocked.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }
                break;

            case "107":
                //Level 6 Closed
                switch (roleid)
                {
                    case "103":
                        //CO Admin

                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                    case "102":
                        //CAO
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                    case "101":
                        //SO Admin
                        cbApproved.Enabled = true;
                        cbLocked.Enabled = true;

                        break;
                    case "104":
                        //View Only
                        cbApproved.Enabled = false;
                        cbLocked.Enabled = false;
                        disable_TRGFUNDS_TXTBOXES();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "test", mysb.ToString(), true);
                        disable_textBoxes(txtTypeEquip);
                        disable_textBoxes(txtSupProgram);

                        disable_textBoxes(txtSystemOfficeNotes);

                        Disable_DropDownList(DLB_Category);
                        Disable_DropDownList(DLB_FunCode);

                        btnSave.Enabled = false;
                        btnDelete.Enabled = false;
                        break;
                }
                break;
            default:
                // View Only, and anything not covered

                break;

        }
    }
Ejemplo n.º 19
0
    protected void GearBox_Assurances_Secruity()
    {
        lp_local_plan lpObj = new lp_local_plan();
        lpObj.ConnectionString = DataAccess.getConnStr();
        lpObj.LoadByPrimaryKey(Convert.ToInt32(hfLpid.Value));

        try
        {

            string roleid = Session[Session.SessionID + "roleid"].ToString();
            switch (lpObj.Key_local_plan_level_id.ToString())
            {
                case "101":
                    //Level 0 Awaiting CO Admin

                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;

                            break;
                        case "102":
                            //CAO
                            cbAccepted.Enabled = true;
                            btnSubmit.Enabled = true;
                            btnPrint.Enabled = true;
                            break;
                        case "101":
                            //SO Admin
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;
                            break;
                        case "104":
                            //View Only
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;
                            break;
                    }

                    break;
                case "102":
                    //Level 1 Awaiting CAO
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin

                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;

                            break;
                        case "102":
                            //CAO
                            cbAccepted.Enabled = true;
                            btnSubmit.Enabled = true;
                            btnPrint.Enabled = true;
                            break;
                        case "101":
                            //SO Admin
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;
                            break;
                        case "104":
                            //View Only
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;
                            break;
                    }
                    break;
                case "103":
                    //Review by So
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin

                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;
                            break;
                        case "102":
                            //CAO
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;

                            break;
                        case "101":
                            //SO Admin
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;
                            break;
                        case "104":
                            //View Only
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;
                            break;
                    }
                    break;

                case "104":
                    //So 3 Revision Requested by So
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;

                            break;
                        case "102":
                            //CAO
                            cbAccepted.Enabled = true;
                            btnSubmit.Enabled = true;
                            btnPrint.Enabled = true;

                            break;
                        case "101":
                            //SO Admin
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;
                            break;
                        case "104":
                            //View Only
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;
                            break;
                    }
                    break;

                case "105":
                    //Level 4 Pending SDE Review
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;

                            break;
                        case "102":
                            //CAO
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;

                            break;
                        case "101":
                            //SO Admin
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;

                            break;
                        case "104":
                            //View Only
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;
                            break;
                    }
                    break;

                case "106":
                    //Level 5 Approved
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;

                            break;
                        case "102":
                            //CAO
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;

                            break;
                        case "101":
                            //SO Admin
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;
                            break;
                        case "104":
                            //View Only
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;
                            break;
                    }
                    break;

                case "107":
                    //Level 6 Closed
                    switch (roleid)
                    {
                        case "103":
                            //CO Admin
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;

                            break;
                        case "102":
                            //CAO
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = true;

                            break;
                        case "101":
                            //SO Admin
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = false;

                            break;
                        case "104":
                            //View Only
                            cbAccepted.Enabled = false;
                            btnSubmit.Enabled = false;
                            btnPrint.Enabled = false;
                            break;
                    }
                    break;
                default:
                    // View Only, and anything not covered

                    break;
            }

            //4-23-2008 added to trump all if assurances accepted then checkbox and submit buttun disabled
            if (lpObj.LoadByPrimaryKey(Convert.ToInt32(hfLpid.Value)))
            {
                if (lpObj.Flg_accepted_assurances == true)
                {
                    cbAccepted.Enabled = (!lpObj.Flg_accepted_assurances);
                    btnSubmit.Enabled = (!lpObj.Flg_accepted_assurances);
                }

            }

        }
        catch(Exception ex)
        {
            scs_error_dictionary errObj = new scs_error_dictionary();
            errObj.ConnectionString = DataAccess.getConnStr();
            if (errObj.LoadByPrimaryKey("100"))
            {
                lblErr.Text = errObj.Txt_message;
                //lblErr.Text = ex.ToString();
            }
            else
                lblErr.Text = ex.ToString();
            Panel1.Visible = false;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.RadMultiViewActivity.SelectedIndex = 0;
            RadTabStrip1.SelectedIndex = 0;
            hlActivityChangeRequest.Attributes.Add("onclick", "editActivityChangeRequest(" + Request.QueryString.Get("id").ToString() + ", -1, 'activityEquip')");
            ddStatus.DataBind();

            cblCoreIndicators.DataBind();
            SqlActivitieChanges.DataBind();
            RadGrid2.DataBind();

            hfPageInfo.Value = "0";
            lblMsg.Text = "";

            try
            {
                this.RadMultiViewActivity.SelectedIndex = Convert.ToInt32(Request.QueryString.Get("view").ToString());
                RadTabStrip1.SelectedIndex = Convert.ToInt32(Request.QueryString.Get("view").ToString());
            }
            catch { }

            lp_local_plan lpObj = new lp_local_plan();

            if (lpObj.LoadByPrimaryKey(Convert.ToInt32(Session[Session.SessionID.ToString() + "PlanID"].ToString())))
            {
                lblCollege.Text = lpObj.Txt_college_name;
                lblFiscalYear.Text = lpObj.Nbr_fiscal_year.ToString();
            }

            if (Request.QueryString.Get("id").ToString().Equals("-1"))
            {
                btnDelete.Visible = false;
                btnSave.Text = "Add";
                lblAid.Text = "";
                RadTabStrip1.Tabs[1].Visible = false;
                btnPrint.Enabled = false;
                btn_Print_History.Enabled = false;
                btnPrintWord.Enabled = false;
            }
            else
            {
                btnDelete.Visible = true;
                btnSave.Text = "Save";

                lblAid.Text = Request.QueryString.Get("id").ToString();

                act_activity actObj = new act_activity();
                actObj.ConnectionString = DataAccess.getConnStr();

                if(actObj.LoadByPrimaryKey(Convert.ToInt32(Request.QueryString.Get("id").ToString())))
                {
                    txtTypeEquip.Text = actObj.Txt_activity_name.ToString();
                    txtSupProgram.Text = actObj.Txt_activity_desc.ToString();
                    try
                    {
                        lblDateUpdated.Text = actObj.Dte_updated_date.ToShortDateString();
                    }
                    catch
                    {
                        lblDateUpdated.Text = "";
                    }

                    try
                    {
                        lblUpdatedBy.Text = actObj.Txt_updated_user;
                    }
                    catch
                    {
                        lblUpdatedBy.Text = "";
                    }

                    txtSystemOfficeNotes.Text = actObj.Txt_system_office_notes;

                    try
                    {
                        cbApproved.Checked = actObj.Flg_approved;
                    }
                    catch
                    {
                        cbApproved.Checked = false;
                    }

                    try
                    {
                        cbLocked.Checked = actObj.Flg_locked;
                    }
                    catch
                    {
                        cbLocked.Checked = false;
                    }
                    ddStatus.SelectedIndex = ddStatus.Items.IndexOf(ddStatus.Items.FindByValue(actObj.Key_level_id.ToString()));
                }
            }
            DLB_Category.SelectedIndex = 10;
            DLB_Category.Enabled = false;

            DLB_FunCode.SelectedIndex = 0;
            DLB_FunCode.Enabled = false;

            //DataView dw = (DataView)SqlDS_RLactivityGET.Select(DataSourceSelectArguments.Empty);
            //foreach (DataRow dr in dw.Table.Rows)
            //{
            //    txtTypeEquip.Text = dr["txt_activity_name"].ToString();
            //    DLB_Category.SelectedIndex = DLB_Category.Items.IndexOf(DLB_Category.Items.FindByValue(dr["key_category_id"].ToString()));
            //    DLB_FunCode.SelectedIndex = DLB_FunCode.Items.IndexOf(DLB_FunCode.Items.FindByValue(dr["key_fund_source_id"].ToString()));
            //    txtSupProgram.Text = dr["txt_activity_desc"].ToString();
            //}

            //DataView dy = (DataView)SqlDS_RLActivityLineGet.Select(DataSourceSelectArguments.Empty);

            //foreach (DataRow dr in dy.Table.Rows)
            //{

            //}

            if (cbLocked.Checked == true)
                if (!Session[Session.SessionID + "roleid"].ToString().Equals("101"))
                    Lock_Page();

            try
            {
                if (Request.QueryString.Get("reload") == "true")
                {
                    RadTabStrip1.SelectedIndex = 1;
                    RadMultiViewActivity.SelectedIndex = 1;
                }

            }
            catch
            {
            }
        }
    }
Ejemplo n.º 21
0
    protected override void OnPreRenderComplete(EventArgs e)
    {
        base.OnPreRenderComplete(e);

        ddlLevel.DataBind();
        ddlLpNExtLevel.DataBind();

        ddlLevel.Enabled = true;
        String errType = "";

        try
        {
            DropDownList ddlFiscalYear = Master.FindControl("DropDownList2") as DropDownList;
            lp_local_plan lpObj = new lp_local_plan();
            lpObj.ConnectionString = DataAccess.getConnStr();

            hfLpid.Value = Session[Session.SessionID + "PlanID"].ToString();
            HL_Errors.NavigateUrl = "Javascript:OpenErrors(" + hfLpid.Value + ")";
            HL_RPLIST.NavigateUrl = "javascript:OpenReportLIst(" + hfLpid.Value + "," + ddlFiscalYear.SelectedValue + ")";
            if (lpObj.LoadByPrimaryKey(Convert.ToInt32(hfLpid.Value.ToString())))
            {

                txtLocalPlanId.Text = hfLpid.Value.ToString();
                txtCollegeName.Text = lpObj.Txt_college_name;

                txtFiscalYear.Text = lpObj.Nbr_fiscal_year.ToString();

                try
                {
                    txtFiscalYearAppropiation.Text = string.Format("{0:C}", lpObj.Nbr_yearly_appropiation);
                }
                catch
                {
                    txtFiscalYearAppropiation.Text = string.Format("{0:C}", 0);
                }

                try
                {
                    txtTotalActivities.Text = string.Format("{0:C}", lpObj.nbr_total_activities);
                }
                catch
                {
                    txtTotalActivities.Text = string.Format("{0:C}", 0);
                }

                try
                {
                    txtBalance.Text = string.Format("{0:C}", lpObj.nbr_balance);
                }
                catch
                {
                    txtBalance.Text = string.Format("{0:C}", 0);
                }

                try
                {
                    txtExpenditures.Text = string.Format("{0:C}", lpObj.nbr_reimbursements);
                }
                catch
                {
                    txtExpenditures.Text = string.Format("{0:C}", 0);
                }

                cbAccepted.Checked = lpObj.Flg_accepted_assurances;
                txtSystemOfficeNotes.Text = "";
                ddlLevel.SelectedIndex = ddlLevel.Items.IndexOf(ddlLevel.Items.FindByValue(lpObj.Key_local_plan_level_id.ToString()));

                lblLevel.Text = ddlLevel.SelectedItem.Text;

                ddlLpNExtLevel.DataBind();

                try
                {
                    txtSystemOfficeNotes.Text = lpObj.Txt_system_office_notes.ToString();
                }
                catch (Exception ex)
                {
                    txtSystemOfficeNotes.Text = "";
                }

            }
            cbAccepted.Enabled = false;
            Panel1.Visible = true;
        }
        //catch (NullReferenceException nex)
        //{
        //    lblErr.Text = nex.ToString();
        //}
        catch (Exception ex)
        {
            scs_error_dictionary errObj = new scs_error_dictionary();
            errObj.ConnectionString = DataAccess.getConnStr();
            if (errObj.LoadByPrimaryKey("100"))
            {
                lblErr.Text = errObj.Txt_message;
                //lblErr.Text = ex.ToString();
            }
            else
                lblErr.Text = ex.ToString();
            Panel1.Visible = false;
        }

        GearBox_LocalPlan_Security();
    }