protected void Assign(int CrewID_UnAssigned) { int CrewID_SigningOff = 0; int Res; String js = ""; if (gvSignOffCrew.SelectedValue != null) { CrewID_SigningOff = int.Parse(gvSignOffCrew.SelectedValue.ToString()); } Res = objCrew.ADD_CrewAssignment(CrewID_SigningOff, CrewID_UnAssigned, int.Parse(ddlJoiningRank.SelectedValue), GetSessionUserID()); if (Res == -2) { lblMessage.Text = "Assignment can not be done as the ON-SIGNER has an open assignment without SIGN-ON-DATE"; js = "alert('Assignment can not be done as the ON-SIGNER has an open assignment without SIGN-ON-DATE');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alertUser2", js, true); } else if (Res == -3) { lblMessage.Text = "The ON-SIGNER can not join this vessel as this is his first voyage and the ship does not allow new joiners as ratings."; js = "alert('The ON-SIGNER can not join this vessel as this is his first voyage and the ship does not allow new joiners as ratings.');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alertUser2", js, true); } else if (Res == -4) { lblMessage.Text = "The ON-SIGNER can not join this vessel as there are already two or more staffs of the same nationality has been joined the vessel"; js = "showNationalityApproval();"; ScriptManager.RegisterStartupScript(this, this.GetType(), "scr_nationality", js, true); } else if (Res == -5) { lblMessage.Text = "The ON-SIGNER can not join this vessel as there are already two or more staffs of the same nationality has been joined the vessel"; js = "showNationalityApproval();"; ScriptManager.RegisterStartupScript(this, this.GetType(), "scr_nationality", js, true); } else { lblMessage.Text = "Assignment saved for the selected staff."; js = "alert('Assignment saved for the selected staff');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alertUser0", js, true); Search_SigningOff(); string msgdiv = string.Format("hideModal('divUnassigned');"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgdiv", msgdiv, true); UpdatePnlAssign.Update(); } }
public void imgbtnAssign_Click(object s, EventArgs e) { Load_RankList(ddlRank_UA); Load_RankList(ddlJoiningRank); Load_ManningAgentList(); Load_Nationality(ddlNationality); Load_VesselList_UA(); ddlVessel_UA.SelectedIndex = 0; ddlManningOffice.SelectedIndex = 0; ddlNationality.SelectedIndex = 0; ddlRank_UA.SelectedIndex = 0; txtFromDt_UA.Text = ""; txtToDt_UA.Text = ""; txtFreeText_UA.Text = ""; UA_AvailableOptions.SelectedValue = "1"; string msgdiv = string.Format("showModal('divUnassigned',false);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgdiv", msgdiv, true); UpdatePnlAssign.Update(); }