コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session["USERID"] == null)
            {
                lblMsg.Text = "Session Expired!! Log-out and log-in again.";
            }
            else
            {
                if (!IsPostBack)
                {
                    UserAccessValidation();

                    int    CrewID = UDFLib.ConvertToInteger(Request.QueryString["CrewID"]);
                    int    AccID  = UDFLib.ConvertToInteger(Request.QueryString["AccID"]);
                    string Mode   = Request.QueryString["Mode"];

                    HiddenField_CrewID.Value = CrewID.ToString();
                    HiddenField_AccID.Value  = AccID.ToString();

                    DataSet dss = objCrew.CRW_CD_GetConfidentialDetails(UDFLib.ConvertToInteger(Request.QueryString["CrewID"]));

                    if (dss != null)
                    {
                        DataTable dt = dss.Tables[0];
                        if (rdoOptAllotment.Items.FindByValue(dt.Rows[0]["Allotment_AccType"].ToString()) != null)
                        {
                            rdoOptAllotment.SelectedValue = dt.Rows[0]["Allotment_AccType"].ToString() != "" ? dt.Rows[0]["Allotment_AccType"].ToString() : "BOTH";
                        }
                        else
                        {
                            rdoOptAllotment.SelectedValue = "BOTH";
                        }
                    }
                    lblAllotment.Text = rdoOptAllotment.SelectedItem.Text;
                    if (Mode == "EDIT")
                    {
                        pnlEditAccount.Visible         = true;
                        DetailsView_NewAcc.DefaultMode = DetailsViewMode.Edit;
                        Load_CrewBankAccDetails(AccID);
                        ((CheckBox)DetailsView_NewAcc.FindControl("chkMOAcc")).Enabled          = false;
                        ((DropDownList)DetailsView_NewAcc.FindControl("ddlMO_Account")).Enabled = false;

                        if (((CheckBox)DetailsView_NewAcc.FindControl("chkMOAcc")).Checked == true)
                        {
                            ReadOnly_CrewBankAccDetails();
                        }
                    }
                    else if (Mode == "INSERT")
                    {
                        pnlEditAccount.Visible         = true;
                        DetailsView_NewAcc.DefaultMode = DetailsViewMode.Insert;
                        Load_CrewBankAccDetails(AccID);
                    }
                    else
                    {
                        if (objUA.View == 1)
                        {
                            pnlViewAccounts.Visible = true;
                            Load_CrewBankAcc(CrewID);
                        }
                    }
                    if (Mode == "EDITAllotment")
                    {
                        tblEditMode.Visible           = true;
                        tblDisplayMode.Visible        = false;
                        GridView_BankAccounts.Visible = false;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
        //EditCrewBankAccAllotment
        lnkEditAllotment.OnClientClick = "EditCrewBankAccAllotment(" + UDFLib.ConvertToInteger(Request.QueryString["CrewID"]).ToString() + "); return false;";
    }