protected void Load_Next_Of_Kin(int CrewID) { DataTable dtNOK = objBLLCrew.Get_Crew_DependentsByCrewID(CrewID, 1); GridView_Dependents.DataBind(); if (dtNOK.Rows.Count > 0) { lblNOKName.Text = dtNOK.Rows[0]["FirstName"].ToString().ToUpper(); lblNOKSurname.Text = dtNOK.Rows[0]["Surname"].ToString().ToUpper(); lblNOKDOB.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(dtNOK.Rows[0]["DOB"])); lblNOKrelationship.Text = dtNOK.Rows[0]["Relationship"].ToString(); lblNOKAddress.Text = dtNOK.Rows[0]["Address"].ToString(); lblNOKCountry.Text = dtNOK.Rows[0]["Country"].ToString().ToUpper(); lblNOKPhone.Text = dtNOK.Rows[0]["Phone"].ToString(); lblA1.Text = dtNOK.Rows[0]["Address1"].ToString(); lblA2.Text = dtNOK.Rows[0]["Address2"].ToString(); lblNOKSSN.Text = dtNOK.Rows[0]["SSN"].ToString(); } DataTable dtAddress = null; if (objAdmin.CRW_GetCDConfiguration("Addressformat").Tables.Count > 0) { dtAddress = objAdmin.CRW_GetCDConfiguration("Addressformat").Tables[0]; } if (dtAddress.Rows.Count > 0) { if (dtAddress.Rows[0]["Value"].ToString() == "True") { tdA1.Visible = false; tdA2.Visible = false; tdA3.Visible = false; tdA4.Visible = false; tdIA1.Visible = true; tdIA2.Visible = true; trUSADDRESS.Visible = false; tdIPA1.Visible = true; tdIPA2.Visible = true; trCountry.Visible = false; tdCountry1.Visible = false; tdCountry2.Visible = false; } else { tdA1.Visible = true; tdA2.Visible = true; tdA3.Visible = true; tdA4.Visible = true; tdIA1.Visible = false; tdIA2.Visible = false; trUSADDRESS.Visible = true; tdIPA1.Visible = false; tdIPA2.Visible = false; trCountry.Visible = true; tdCountry1.Visible = true; tdCountry2.Visible = true; } } }
protected void btnSaveDependents_Click(object sender, EventArgs e) { try { int CrewID = GetCrewID(); if (CrewID > 0) { if (txtDEP_Name.Text == "" || ddlDEP_Relatipnship.SelectedValue == "0") { lblMessage.Text = "Unable to save Dependent details !! Crew information missing !!"; } else { int result = objBLLCrew.INS_Crew_DependentDetails(CrewID, txtDEP_Name.Text, ddlDEP_Relatipnship.SelectedValue, "", "", 0, GetSessionUserID()); objDS_Dependents.SelectParameters["CrewID"].DefaultValue = CrewID.ToString(); objDS_Dependents.Select(); GridView_Dependents.DataBind(); GridView_Dependents.Visible = true; if (result == 1) { lblMessage.Text = "Dependent added successfully !!"; } else if (result == 1) { lblMessage.Text = "Unable to save Dependent details !! Depedent details already exists!!"; } } } else { lblMessage.Text = "Enter dependent details and select relationship!!"; } } catch (Exception ex) { lblMessage.Text = "Unable to save Dependent details !! " + ex.Message; } }
protected void Load_Next_Of_Kin(int CrewID) { DataTable dtNOK = objBLLCrew.Get_Crew_DependentsByCrewID(CrewID, 1); if (dtNOK.Rows.Count > 0) { hdnNOKID.Value = dtNOK.Rows[0]["ID"].ToString(); lblNOKName.Text = dtNOK.Rows[0]["FullName"].ToString().ToUpper(); lblNOKrelationship.Text = dtNOK.Rows[0]["Relationship"].ToString(); lblNOKAddress.Text = dtNOK.Rows[0]["Address"].ToString(); //lblNOKDOB.Text = Convert.ToDateTime(dtNOK.Rows[0]["DOB"].ToString()).ToString("dd/MM/yyyy"); lblNOKPhone.Text = dtNOK.Rows[0]["Phone"].ToString(); txtNOKName.Text = dtNOK.Rows[0]["FullName"].ToString().ToUpper(); ddlNOKRelationship.Text = dtNOK.Rows[0]["Relationship"].ToString(); txtNOKAddress.Text = dtNOK.Rows[0]["Address"].ToString(); //txtNOKDOB.Text = Convert.ToDateTime(dtNOK.Rows[0]["DOB"].ToString()).ToString("dd/MM/yyyy"); txtNOKPhone.Text = dtNOK.Rows[0]["Phone"].ToString(); } else { hdnNOKID.Value = ""; lblNOKName.Text = ""; lblNOKrelationship.Text = ""; lblNOKAddress.Text = ""; //lblNOKDOB.Text = ""; lblNOKPhone.Text = ""; txtNOKName.Text = ""; ddlNOKRelationship.Text = ""; txtNOKAddress.Text = ""; //txtNOKDOB.Text = ""; txtNOKPhone.Text = ""; } GridView_Dependents.DataBind(); }