Ejemplo n.º 1
0
    protected void GridView_RowEditing(object sender, GridViewEditEventArgs e)
    {
        int       SeniorityYear         = UDFLib.ConvertToInteger(gvSeniorityRecords.DataKeys[e.NewEditIndex].Values[0].ToString());
        int       CrewID                = UDFLib.ConvertToInteger(gvSeniorityRecords.DataKeys[e.NewEditIndex].Values[1].ToString());
        string    Rank                  = gvSeniorityRecords.DataKeys[e.NewEditIndex].Values[2].ToString();
        int       RankID                = UDFLib.ConvertToInteger(gvSeniorityRecords.DataKeys[e.NewEditIndex].Values[3].ToString());
        int       CrewSeniorityRewardId = UDFLib.ConvertToInteger(gvSeniorityRecords.DataKeys[e.NewEditIndex].Values[4].ToString());
        DataTable dt = objBLLCrewSeniority.Get_CrewSeniorityRewardDetails(CrewID, SeniorityYear);

        if (dt.Rows.Count > 0)
        {
            txtName.Text          = dt.Rows[0]["Staff_FullName"].ToString();
            txtCrewId.Text        = CrewID.ToString();
            txtRankId.Text        = RankID.ToString();
            txtRank.Text          = Rank;
            txtSeniorityYear.Text = SeniorityYear.ToString();
            if (dt.Rows[0]["Remarks"] != null || dt.Rows[0]["Remarks"] != "")
            {
                txtRemarks.Text = dt.Rows[0]["Remarks"].ToString();
            }
            else
            {
                txtRemarks.Text = "";
            }
            if (dt.Rows[0]["AttachmentFilePath"] != null && dt.Rows[0]["AttachmentFilePath"].ToString() != "")
            {
                lnkAttachment.Text        = dt.Rows[0]["AttachmentFileName"].ToString();
                lnkAttachment.NavigateUrl = "~/Uploads/CrewRewardDocument/" + dt.Rows[0]["AttachmentFilePath"].ToString();
            }
            else
            {
                lnkAttachment.Text = "";
            }
        }
        if (CrewSeniorityRewardId > 0)
        {
            btnSave.Enabled            = false;
            AttachmentUploader.Visible = false;
        }
        else
        {
            btnSave.Enabled            = true;
            AttachmentUploader.Visible = true;
        }
        string msgdivResponseShow = string.Format("showModal('divSeniorityReward',false);");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgdivResponseShow", msgdivResponseShow, true);

        UpdatePnl.Update();
    }
Ejemplo n.º 2
0
    protected void GridView_RowEditing(object sender, GridViewEditEventArgs e)
    {
        int   id    = e.NewEditIndex;
        Label lblId = ((Label)GridView1.Rows[id].FindControl("lblId"));

        ViewState["CrewID"] = lblId.Text;
        Load_ManningAgentList(ddlManningOffice);
        lblMsg.Visible      = false;
        txtCrewRemarks.Text = "";
        string msgdivResponseShow = string.Format("showModal('divManningOffice',false);");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgdivResponseShow", msgdivResponseShow, true);

        UpdatePnl.Update();
    }
Ejemplo n.º 3
0
    protected void btnViewAttachments_Click(object sender, EventArgs e)
    {
        int Vessel_Id    = 0;
        int Page_Type_Id = 3;
        int Report_Id    = 0;

        Vessel_Id = int.Parse(Request.QueryString["VesselId"].ToString());
        Report_Id = int.Parse(Request.QueryString["PortInfoReportId"].ToString());

        DataTable dt = BLL_OPS_VoyageReports.Get_PRT_Attachment(Page_Type_Id, Report_Id, Vessel_Id);

        //grdPTR_Attachment.DataSource = dt;
        //grdPTR_Attachment.DataBind();

        string msgViewAttachments = string.Format("showModal('divViewAttachments',false);");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgViewAttachments", msgViewAttachments, true);
        UpdatePnl.Update();
    }