protected void ImgExpExcel_Click(object sender, EventArgs e) { int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } DataTable dt = objBLL.Crew_Contract_Withhold_Search(txtfilter.Text != "" ? txtfilter.Text : null, "Percent" , UDFLib.ConvertIntegerToNull(ddlEntryTypeFilter.SelectedValue), sortbycoloumn, sortdirection , null, null, ref rowcount); UDFLib.ChangeColumnDataType(dt, "Effective_Date", typeof(string)); foreach (DataRow row in dt.Rows) { if (!string.IsNullOrEmpty(row["Effective_Date"].ToString())) { row["Effective_Date"] = " " + UDFLib.ConvertUserDateFormat(Convert.ToString(row["Effective_Date"]), UDFLib.GetDateFormat()); } } string[] HeaderCaptions = { "Contract No", "Withhold Amount", "Withhold Type", "Entry Type", "Effective Date" }; string[] DataColumnsName = { "Contract_Number", "Withhold_Amount", "Withhold_Type", "Name", "Effective_Date" }; GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "Leave_Wages_Withhold_Rules", "Leave Wages Withhold Rules"); }
/// <summary> /// Method is used to bind vetting details when mode is perform vetting /// </summary> /// <param name="Vetting_ID">selected Vetting id</param> protected void BindPerformVetting(int Vetting_ID) { try { BLL_VET_Index objIndex = new BLL_VET_Index(); DataTable dtVetting = objIndex.VET_Get_Perform_Vetting_Detail(Vetting_ID); if (dtVetting.Rows.Count > 0) { ddlVessel.SelectedValue = dtVetting.Rows[0]["Vessel_ID"].ToString(); txtVettingName.Text = dtVetting.Rows[0]["Vetting_Name"].ToString(); FillVettingTypeDropdown(UDFLib.ConvertToInteger(ddlVessel.SelectedValue)); ddlType.SelectedValue = dtVetting.Rows[0]["Vetting_Type_ID"].ToString(); if (ddlType.SelectedItem.Text == "SIRE") { trImportXML.Visible = true; } txtDate.Text = UDFLib.ConvertUserDateFormat(dtVetting.Rows[0]["Vetting_Date"].ToString()); txtDays.Text = dtVetting.Rows[0]["No_Of_Days"].ToString(); ddlOilMajor.SelectedValue = dtVetting.Rows[0]["Oil_Major_ID"].ToString(); AddInspectorImg(); FillInspectorDropdown(UDFLib.ConvertToInteger(ddlType.SelectedValue)); ddlInspector.SelectedValue = dtVetting.Rows[0]["Inspector_ID"].ToString(); ddlPort.Select(dtVetting.Rows[0]["Port_ID"].ToString()); hdfPorCallID.Value = dtVetting.Rows[0]["Port_Call_ID"].ToString(); FillQuestionaireDropdown(UDFLib.ConvertToInteger(ddlVessel.SelectedValue), UDFLib.ConvertToInteger(ddlType.SelectedValue)); ddlQuestionaire.SelectedValue = dtVetting.Rows[0]["Questionnaire_ID"].ToString(); hdnQuestionnaireID.Value = dtVetting.Rows[0]["Questionnaire_ID"].ToString(); } } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
protected void ImgExpExcel_Click(object sender, ImageClickEventArgs e) { try { int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } DataTable dt = BLL_PB_PhoneCard.PhoneCord_Request_Export(txtCardNumber.Text != "" ? txtCardNumber.Text : null, (DataTable)Session["sVesselCode"], UDFLib.ConvertToDate(txtFromDate.Text).ToShortDateString(), UDFLib.ConvertToDate(txtToDate.Text).ToShortDateString(), ddlStatus.SelectedIndex == 0 ? null : ddlStatus.SelectedValue); UDFLib.ChangeColumnDataType(dt, "DATE_OF_CREATION", typeof(string)); UDFLib.ChangeColumnDataType(dt, "PBILL_DATE", typeof(string)); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["DATE_OF_CREATION"] = " " + UDFLib.ConvertUserDateFormat(Convert.ToString(dt.Rows[i]["DATE_OF_CREATION"])); dt.Rows[i]["PBILL_DATE"] = " " + UDFLib.ConvertUserDateFormat(Convert.ToString(dt.Rows[i]["PBILL_DATE"])); } string[] HeaderCaptions = { "Request Number", "Vessel Name", "Status", "Request Date", "Total Cards", "Bill Date" }; string[] DataColumnsName = { "REQUEST_NUMBER", "VESSEL_NAME", "REQUEST_STATUS", "DATE_OF_CREATION", "TOTAL_REQUEST", "PBILL_DATE" }; GridViewExportUtil.ExportToExcel(dt, HeaderCaptions, DataColumnsName, "PhoneCardRequest", "Request List"); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
protected void Load_CrewPhotoToolTip(int CrewID) { DataSet ds = objCrew.Get_CrewInfo_ToolTip(CrewID, GetSessionUserID()); if (ds.Tables[0].Rows.Count > 0) { // last voyage lblLastVessel.Text = ds.Tables[0].Rows[0]["Vessel_Short_Name"].ToString(); lblLastSignedOn.Text = UDFLib.ConvertUserDateFormat(ds.Tables[0].Rows[0]["Sign_On_Date"].ToString(), DFormat); lblLastSignedOff.Text = UDFLib.ConvertUserDateFormat(ds.Tables[0].Rows[0]["Sign_Off_Date"].ToString(), DFormat); } // last two remarks GridView_CrewRemarks.DataSource = ds.Tables[1]; GridView_CrewRemarks.DataBind(); //Card Status if (ds.Tables[2].Rows.Count > 0) { lblCardStatus.Text = ds.Tables[2].Rows[0]["cardtype"].ToString() + " " + ds.Tables[2].Rows[0]["cardstatus"].ToString(); imgCardStatus.ImageUrl = "../images/" + ds.Tables[2].Rows[0]["cardtype"].ToString().Replace(" ", "") + "_" + ds.Tables[2].Rows[0]["cardstatus"].ToString() + ".png"; imgCardStatus.Visible = true; } Load_CrewComplaints(CrewID); }
protected void ImgExpExcel_Click(object sender, EventArgs e) { int rowcount = ucCustomPager.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } DataTable dt = BLL_Crew_CrewList.Get_HandOver_Search(UDFLib.ConvertIntegerToNull(ddlFleet.SelectedValue.ToString()) , UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue.ToString()), txtSearchText.Text, UDFLib.ConvertIntegerToNull(ddlRankFilter.SelectedValue), sortbycoloumn, sortdirection, null, null, ref rowcount); string[] HeaderCaptions = { "Vessel Name", "Staff Code", "Staff Name", "Rank Name", "Hand Over Date", "Sign off Remark" }; string[] DataColumnsName = { "Vessel_Name", "STAFF_CODE", "FULL_NAME", "Rank_Short_Name", "Handover_Date", "Sing_off_Remarks" }; ChangeColumnDataType(dt, "Handover_Date", typeof(string)); foreach (DataRow item in dt.Rows) { if (!string.IsNullOrEmpty(item["Handover_Date"].ToString())) { item["Handover_Date"] = UDFLib.ConvertUserDateFormat(Convert.ToString(item["Handover_Date"]), UDFLib.GetDateFormat()); } } GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "CrewHandOver.xls", "Crew Handover"); }
protected void gvRelatedJob_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { Label lblDateRaised = (Label)e.Row.FindControl("lblDateRaised"); HiddenField hdnWLID = (HiddenField)e.Row.FindControl("hdnWLID"); HiddenField hdnOFFID = (HiddenField)e.Row.FindControl("hdnOFFID"); HiddenField hdnVID = (HiddenField)e.Row.FindControl("hdnVID"); lblDateRaised.Text = UDFLib.ConvertUserDateFormat(lblDateRaised.Text, UDFLib.GetDateFormat()); HyperLink lnkVerJobsCnt = (HyperLink)e.Row.FindControl("lnkVerJobsCnt"); lnkVerJobsCnt.NavigateUrl = "../Worklist/ViewJob.aspx?Vetting_ID=" + ViewState["Vetting_ID"].ToString() + "&WLID=" + hdnWLID.Value + "&OFFID=" + hdnOFFID.Value + "&VID=" + hdnVID.Value; if (Vetting_Status == "Completed") { ImageButton ImglnkJob = (ImageButton)e.Row.FindControl("ImglnkJob"); ImglnkJob.Enabled = false; } } } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
protected void ImgExpExcel_Click(object sender, ImageClickEventArgs e) { try { int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } DataTable dt = BLL_PB_PhoneCard.PhoneCord_Kitty_Export(txtSatatus.Text != "" ? txtSatatus.Text : null, null, txtTitle.Text != "" ? txtTitle.Text : null, null, null, null, (DataTable)Session["sVesselCode"], UDFLib.ConvertToDate(txtFromDate.Text.Trim(), UDFLib.GetDateFormat()).ToShortDateString(), UDFLib.ConvertToDate(txtToDate.Text.Trim(), UDFLib.GetDateFormat()).ToShortDateString(), sortbycoloumn, sortdirection , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["DATE_OF_CREATION"] = " " + UDFLib.ConvertUserDateFormat(Convert.ToString(dt.Rows[i]["DATE_OF_CREATION"])); } string[] HeaderCaptions = { "Vessel Name", "Request Date", "Card Number", "Card Pin", "Unit", "Title", "Sub Title", "Supplier ", "Voyage" }; string[] DataColumnsName = { "VESSEL_NAME", "DATE_OF_CREATION", "CARD_NUM", "CARD_PIN", "CARD_UNITS", "TITLE", "SUBTITLE", "Full_NAME", "STAFF_NAME" }; GridViewExportUtil.ExportToExcel(dt, HeaderCaptions, DataColumnsName, "KittyList", "Kitty List"); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
protected void Page_Load(object sender, EventArgs e) { if (GetSessionUserID() == 0) { Response.Redirect("~/account/login.aspx"); } calFromDate.Format = calToDate.Format = UDFLib.GetDateFormat(); try { if (!IsPostBack) { ViewState["SORTDIRECTION"] = null; ViewState["SORTBYCOLOUMN"] = null; //ucCustomPagerItems.PageSize = 20; Session["sFleet"] = DDLFleet.SelectedValues; Session["sVesselCode"] = DDLVessel.SelectedValues; FillDDL(); txtFromDate.Text = UDFLib.ConvertUserDateFormat((DateTime.Now.AddDays(-(DateTime.Now.DayOfYear) + 1)).ToShortDateString()); txtToDate.Text = UDFLib.ConvertUserDateFormat((DateTime.Now.AddMonths(1).AddDays(-(DateTime.Now.Day)).ToShortDateString())); BindIndex(); } } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
public void BindReport() { try { CommonReports rpt = new CommonReports(); DataTable dt = GetReportData(); UDFLib.ChangeColumnDataType(dt, "PBILL_Date", typeof(string)); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["PBILL_DATE"] = UDFLib.ConvertUserDateFormat(Convert.ToString(dt.Rows[i]["PBILL_DATE"])); } rpt.ResourceName = _reportfile; rpt.SetDataSource(dt); rpt.Site = this.Site; CrystalReportViewer1.Visible = true; CrystalReportViewer1.ReportSource = rpt; CrystalReportViewer1.DisplayToolbar = true; CrystalReportViewer1.HasPrintButton = false; CrystalReportViewer1.HasExportButton = false; CrystalReportViewer1.HasToggleGroupTreeButton = false; CrystalReportViewer1.DisplayGroupTree = false; } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
protected void gvPortCall_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandName == "Delete") { string[] arg = e.CommandArgument.ToString().Split(','); int Port_call_ID = UDFLib.ConvertToInteger(arg[0]); int Vessel_ID = UDFLib.ConvertToInteger(arg[1]); objPortCall.Del_PortCall_Details_DL(Convert.ToInt32(Port_call_ID), Vessel_ID, Convert.ToInt32(Session["USERID"].ToString())); BindPortCall(); } if (e.CommandName == "Select") { TabSCM.ActiveTabIndex = 0; //string tabid = "4"; //string tabindex = "4"; string[] arg = e.CommandArgument.ToString().Split(','); //Port_call_ID = UDFLib.ConvertToInteger(arg[1]); //Vessel_ID = UDFLib.ConvertToInteger(arg[1]); Session["Port_call_ID"] = UDFLib.ConvertToInteger(arg[1]); // Session["Vessel_ID"] = UDFLib.ConvertToInteger(arg[0]); Session["Vessel_ID"] = DDLVesselFilter.SelectedValue; DateTime AsofDate = Convert.ToDateTime(arg[2]); string PortID = Convert.ToString(arg[3]); txtAsofDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(AsofDate)); ddlportfilter.SelectedValue = PortID; ddlPortCost.SelectedValue = PortID; //BindcrewList(); //BindPortCallHistory(1, UDFLib.ConvertIntegerToNull(ddlportfilter.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue)); BindTab(); } }
protected void btnSaveRefererDetail_Click(object sender, EventArgs e) { string msg = ""; try { string js; int CrewID = GetCrewID(); DateTime Dt_ReferenceDate = DateTime.Parse(UDFLib.ConvertUserDateFormat(Convert.ToString("1900/01/01"))); try { if (txtReferenceDate.Text != "") { if (!UDFLib.DateCheck(txtReferenceDate.Text)) { js = "alert('Enter valid Reference Check Date" + UDFLib.DateFormatMessage() + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script1", js, true); return; } } Dt_ReferenceDate = DateTime.Parse(UDFLib.ConvertToDefaultDt(txtReferenceDate.Text.Trim())); } catch (Exception) { msg = "Enter valid Reference Check Date" + UDFLib.DateFormatMessage(); js = "alert('" + msg + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script1", js, true); return; } if ((Dt_ReferenceDate > DateTime.Today)) { js = "alert('Reference Date cannot be greater than todays date.');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script1", js, true); } else if (Dt_ReferenceDate == Convert.ToDateTime("01/01/1900 ")) { js = "alert('Invalid Date entry in REFERENCE CHECK DATE field.');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script1", js, true); } else { objBLLCrew.Save_Crew_Reference_Details(0, CrewID, txtRefererName.Text.Trim(), txtRefererPhoneNo.Text.Trim(), Dt_ReferenceDate.ToShortDateString(), txtPersonQuieredName.Text.Trim(), txtPersonQuieredTitle.Text.Trim(), GetSessionUserID()); objDS_ReferenceDetail.SelectParameters["CrewID"].DefaultValue = CrewID.ToString(); objDS_ReferenceDetail.Select(); gdRefererDetails.DataBind(); pnlView_RefererDetails.Visible = true; pnlAdd_RefererDetails.Visible = false; js = "parent.GetInterviewResult(" + Request.QueryString["CrewID"].ToString() + ");"; ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", js, true); } } catch (Exception) { } }
protected void gvCrewBriefPlan_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string strRowId = DataBinder.Eval(e.Row.DataItem, "ID").ToString(); string InterviewDate = DataBinder.Eval(e.Row.DataItem, "InterviewDate").ToString(); if (InterviewDate != "") { ImageButton imgBtnEdit = (ImageButton)(e.Row.FindControl("imgBtnEdit")); if (imgBtnEdit != null) { imgBtnEdit.Visible = false; } ImageButton imgBtnDelete = (ImageButton)(e.Row.FindControl("imgBtnDelete")); if (imgBtnDelete != null) { imgBtnDelete.Visible = false; } } TextBox txt = (TextBox)e.Row.FindControl("txtPlanDate"); DataRow dr = ((DataRowView)e.Row.DataItem).Row; if (dr["InterviewPlanDate"].ToString() != "" && txt != null) { txt.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(dr["InterviewPlanDate"].ToString())); } } }
public string Get_StaffInfo(int StaffCode, string DateFormat = "dd/MM/yyyy") { DAL_Crew_CrewDetails objCrew = new DAL_Crew_CrewDetails(); DataTable dt = new DataTable(); string[] str_etr = { }; dt = objCrew.Get_StaffInfo_DL(StaffCode); foreach (DataRow dr in dt.Rows) { if (dr["Value"].ToString().Contains("On")) { dr["Value"] = dr["Value"].ToString().Replace("On", "|"); str_etr = Convert.ToString(dr["Value"]).Split('|'); if (str_etr.Length > 0) { dr["Value"] = str_etr[0] + "On " + UDFLib.ConvertUserDateFormat(Convert.ToString(str_etr[1]), DateFormat); } } } return(UDFLib.CreateHtmlTableFromDataTable(dt, new string[] { "", "" }, new string[] { "Caption", "Value" }, "")); }
protected void Page_Load(object sender, EventArgs e) { //This change has been done to change the date format as per user selection calAsOfDate.Format = Convert.ToString(Session["User_DateFormat"]); DateFormat = UDFLib.GetDateFormat();//Get User date format if (!IsPostBack) { if (!String.IsNullOrEmpty(Request.QueryString["Vessel_ID"].ToString())) { Load_VesselList(); GetVesselID(); ddlCrewVessel.SelectedValue = Request.QueryString["Vessel_ID"].ToString(); //This change has been done to change the date format as per user selection if (Session["Arrival"] == null) { txtAsofDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(System.DateTime.Now)); } else { txtAsofDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(Session["Arrival"])); } ddlCrewStatus.SelectedValue = "2"; BindcrewList(); } } string msg1 = String.Format("StaffInfo();"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgshowdetails", msg1, true); }
protected void Page_Load(object sender, EventArgs e) { // UserAccessValidation(); if (!string.IsNullOrEmpty(Request.QueryString["Vessel_ID"])) { DataTable dtWelfareDetails = BLL_PB_PortageBill.Get_Crew_Welfare_Details(UDFLib.ConvertToInteger(Request.QueryString["Welfare_ID"]), Convert.ToInt32(Request.QueryString["Vessel_ID"]), UDFLib.ConvertDateToNull(Request.QueryString["PB_Date"])); if (dtWelfareDetails.Rows.Count > 0) { lblVessel.Text = dtWelfareDetails.Rows[0]["Vessel_Name"].ToString(); if (!string.IsNullOrEmpty(dtWelfareDetails.Rows[0]["from_date"].ToString())) { lblFrom.Text = UDFLib.ConvertUserDateFormat(Convert.ToDateTime(dtWelfareDetails.Rows[0]["from_date"].ToString()).ToString("dd/MM/yyyy"), UDFLib.GetDateFormat()); } if (!string.IsNullOrEmpty(dtWelfareDetails.Rows[0]["To_date"].ToString())) { lblTo.Text = UDFLib.ConvertUserDateFormat(Convert.ToDateTime(dtWelfareDetails.Rows[0]["To_date"].ToString()).ToString("dd/MM/yyyy"), UDFLib.GetDateFormat()); } lblOpnBL.Text = dtWelfareDetails.Rows[0]["Opening_Bal"].ToString(); lblClosing.Text = dtWelfareDetails.Rows[0]["Closing_Bal"].ToString(); objItemColumn.AddMergedColumns(new int[] { 5, 6 }, "Amount", "HeaderStyle-css"); gvWelfareDetails.DataSource = dtWelfareDetails; gvWelfareDetails.DataBind(); (gvWelfareDetails.FooterRow.FindControl("lblRcvdTotal") as Label).Text = dtWelfareDetails.Rows[0]["Total_Recp_Amount"].ToString(); (gvWelfareDetails.FooterRow.FindControl("lblPaidTotal") as Label).Text = dtWelfareDetails.Rows[0]["Total_Payment_Amount"].ToString(); } } }
protected void btnSaveAndSend_Click(object sender, EventArgs e) { bool valid = true; int PortID = UDFLib.ConvertToInteger(hdnPortID.Value); string ArrivalDate = UDFLib.ConvertUserDateFormat(txtArrival.Text); if (GridView_SelectedItems.Rows.Count > 0) { if (valid == true) { int Res = BLL_Crew_CrewMail.SaveAndSend_MailPacket(UDFLib.ConvertToInteger(ddlVesselPackets.SelectedValue), UDFLib.ConvertToDefaultDt(txtDateSent.Text), txtSentUsing.Text, txtAirwayBill.Text, PortID, ArrivalDate, GetSessionUserID(), txtApproverRemarks.Text); if (Res == 1) { ScriptManager.RegisterStartupScript(this, this.GetType(), "saved", "alert('Packet(" + ddlVesselPackets.SelectedItem.Text + ") sent to Vessel');", true); Load_VesselOpenPacket(); Load_PacketItemReport(); } } } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "saved", "alert('No item selected for the Packet!!');", true); } }
protected void Page_Load(object sender, EventArgs e) { UserAccessValidation(); //This change has been done to change the date format as per user selection CalStartDate.Format = Convert.ToString(Session["User_DateFormat"]); CalEndDate.Format = Convert.ToString(Session["User_DateFormat"]); CalendarExtender1.Format = Convert.ToString(Session["User_DateFormat"]); CalendarExtender2.Format = Convert.ToString(Session["User_DateFormat"]); calAsOfDate.Format = Convert.ToString(Session["User_DateFormat"]); DateFormat = UDFLib.GetDateFormat();//Get User date format if (!IsPostBack) { string tabid = TabSCM.ActiveTab.ID; string tabindex = TabSCM.ActiveTab.TabIndex.ToString(); //This change has been done to change the date format as per user selection txtFrom.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(System.DateTime.Now)); txtTo.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(System.DateTime.Now.AddMonths(6))); txtAsofDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(System.DateTime.Now)); DateTime dt = System.DateTime.Now; DateTime Fistdaydate = dt.AddDays(-(dt.Day - 1)); DateTime LastdayDate = dt.AddMonths(1); LastdayDate = LastdayDate.AddDays(-(LastdayDate.Day)); txtStartDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(Fistdaydate)); txtEndDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(LastdayDate)); Load_VesselList(); Load_PortList(); BindPortCall(); BindTab(); } }
protected void Page_Load(object sender, EventArgs e) { if (GetSessionUserID() == 0) { Response.Redirect("~/account/login.aspx"); } calFromDate.Format = calToDate.Format = UDFLib.GetDateFormat(); if (!IsPostBack) { ViewState["SORTDIRECTION"] = null; ViewState["SORTBYCOLOUMN"] = null; ucCustomPagerItems.PageSize = 20; Session["sFleet"] = DDLFleet.SelectedValues; Session["sVesselCode"] = DDLVessel.SelectedValues; btnUpload.Attributes.Add("onclick", "javascript:window.open('../PhoneCard/KittyUpload.aspx'); return false;"); FillDDL(); txtFromDate.Text = UDFLib.ConvertUserDateFormat((DateTime.Now.AddDays(-(DateTime.Now.DayOfYear) + 1)).ToShortDateString()); txtToDate.Text = UDFLib.ConvertUserDateFormat((DateTime.Now.AddMonths(1).AddDays(-(DateTime.Now.Day)).ToShortDateString())); BindKitty(); Load_VesselList(); } }
protected void BindItems() { try { int Record_Count = 0; DataTable dt = BLL_PB_PortageBill.Get_Lib_Crew_Welfare(UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), UDFLib.ConvertDateToNull(ddlEectiveDates.SelectedValue), pagerWf.CurrentPageIndex, pagerWf.PageSize, ref Record_Count); UDFLib.ChangeColumnDataType(dt, "Effective_Date", typeof(string)); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { if (!string.IsNullOrEmpty(dr["Effective_Date"].ToString())) { dr["Effective_Date"] = UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Effective_Date"].ToString()), UDFLib.GetDateFormat()); } } } gvWelfare.DataSource = dt; gvWelfare.DataBind(); pagerWf.CountTotalRec = Record_Count.ToString(); pagerWf.BuildPager(); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
protected void Page_Load(object sender, EventArgs e) { UserAccessValidation(); if (!string.IsNullOrEmpty(Request.QueryString["Vessel_ID"])) { DataSet dsCapt = BLL_PB_PortageBill.ReportDetailsByID(Request.QueryString["ID"], Request.QueryString["Vessel_ID"]); if (dsCapt.Tables[0].Rows.Count > 0) { lblVessel.Text = dsCapt.Tables[0].Rows[0]["Vessel_Name"].ToString(); if (!string.IsNullOrEmpty(dsCapt.Tables[0].Rows[0]["from_date"].ToString())) { lblFrom.Text = UDFLib.ConvertUserDateFormat(Convert.ToDateTime(dsCapt.Tables[0].Rows[0]["from_date"].ToString()).ToString("dd/MM/yyyy"), UDFLib.GetDateFormat()); } if (!string.IsNullOrEmpty(dsCapt.Tables[0].Rows[0]["To_date"].ToString())) { lblTo.Text = UDFLib.ConvertUserDateFormat(Convert.ToDateTime(dsCapt.Tables[0].Rows[0]["To_date"].ToString()).ToString("dd/MM/yyyy"), UDFLib.GetDateFormat()); } lblOpnBL.Text = dsCapt.Tables[0].Rows[0]["Opening_Bal"].ToString(); lblClosing.Text = dsCapt.Tables[0].Rows[0]["Closing_Bal"].ToString(); objItemColumn.AddMergedColumns(new int[] { 5, 6 }, "Amount", "HeaderStyle-css"); gvCastCash.DataSource = dsCapt.Tables[0]; gvCastCash.DataBind(); (gvCastCash.FooterRow.FindControl("lblRcvdTotal") as Label).Text = dsCapt.Tables[0].Rows[0]["Total_Recp_Amount"].ToString(); (gvCastCash.FooterRow.FindControl("lblPaidTotal") as Label).Text = dsCapt.Tables[0].Rows[0]["Total_Payment_Amount"].ToString(); } } }
protected void ImgExpExcel_Click(object sender, EventArgs e) { int is_Fetch_Count = ucCustomPager.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } DataTable dt = objBLLCrew.Get_Crew_FeedBack_Viewer_Search((DataTable)DDLFleet.SelectedValues, (DataTable)DDLVessel.SelectedValues, (DataTable)DDLRank.SelectedValues , (DataTable)DDLNationality.SelectedValues, (DataTable)DDLManningOffice.SelectedValues, (DataTable)DDLCommentedBy.SelectedValues , UDFLib.ConvertDateToNull(txtCommentFromDate.Text), UDFLib.ConvertDateToNull(txtCommentToDate.Text), txtSearch.Text, UDFLib.ConvertIntegerToNull(DDLStatus.SelectedValue) , sortbycoloumn, sortdirection, null, null, ref is_Fetch_Count); gvCrewFeedback.DataSource = dt; gvCrewFeedback.DataBind(); ChangeColumnDataType(dt, "Comment_Date", typeof(string)); foreach (DataRow item in dt.Rows) { if (!string.IsNullOrEmpty(item["Comment_Date"].ToString())) { item["Comment_Date"] = " " + UDFLib.ConvertUserDateFormat(Convert.ToString(item["Comment_Date"]), UDFLib.GetDateFormat()); } } string[] HeaderCaptions = { "Staff Code", "Name", "Rank", "Comment Date", "Comment By", "Comment Vessel", "Comment" }; string[] DataColumnsName = { "Staff_Code", "Staff_Name", "Rank_Name", "Comment_Date", "Comment_By", "Comment_Vessel", "Remark" }; GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "CrewFeedbackViewer", "Crew Feedback Viewer", ""); }
protected void Page_Load(object sender, EventArgs e) { //This change has been done to change the date format as per user selection CalStartDate.Format = Convert.ToString(Session["User_DateFormat"]); CalEndDate.Format = Convert.ToString(Session["User_DateFormat"]); //dateValidator.ValueToCompare = DateTime.Now.ToShortDateString(); DateFormat = UDFLib.GetDateFormat();//Get User date format UserAccessValidation(); if (!IsPostBack) { DateTime dt = System.DateTime.Now; DateTime Firstdaydate = dt.AddDays(-(dt.Day - 1)); DateTime LastdayDate = dt.AddMonths(1); LastdayDate = LastdayDate.AddDays(-(LastdayDate.Day)); //This change has been done to change the date format as per user selection txtStartDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(Firstdaydate)); txtEndDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(LastdayDate)); //txtStartDate.Text = Firstdaydate.ToString("dd-MM-yyyy"); //txtEndDate.Text = LastdayDate.ToString("dd-MM-yyyy"); Load_VesselList(); Load_PortList(); BindPortCostList(); } }
protected void btnDownload_Click(object sender, EventArgs e) { string sFileName = ""; int ID = UDFLib.ConvertToInteger(hdnCurrentDocID.Value); System.Data.DataTable dt = objCrewBLL.Get_CrewAgreementRecords(ID, GetSessionUserID()); foreach (DataRow item in dt.Rows) { if (!string.IsNullOrEmpty(item["Date_Of_Creation"].ToString())) { item["Date_Of_Creation"] = UDFLib.ConvertUserDateFormat(Convert.ToString(item["Date_Of_Creation"])); } if (!string.IsNullOrEmpty(item["Date_Of_Modification"].ToString())) { item["Date_Of_Modification"] = UDFLib.ConvertUserDateFormat(Convert.ToString(item["Date_Of_Modification"])); } if (!string.IsNullOrEmpty(item["Date_Of_Deletion"].ToString())) { item["Date_Of_Deletion"] = UDFLib.ConvertUserDateFormat(Convert.ToString(item["Date_Of_Deletion"])); } if (!string.IsNullOrEmpty(item["Download_Date"].ToString())) { item["Download_Date"] = UDFLib.ConvertUserDateFormat(Convert.ToString(item["Download_Date"])); } if (!string.IsNullOrEmpty(item["VerifiedDate"].ToString())) { item["Verified_Date"] = UDFLib.ConvertUserDateFormat(Convert.ToString(item["VerifiedDate"])); } } if (dt.Rows.Count > 0) { sFileName = dt.Rows[0]["DocFileName"].ToString(); ResponseHelper.Redirect("DownloadFile.aspx?url=" + "../Uploads/CrewDocuments/" + sFileName, "_blank", ""); } }
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 ChangeDateTime(int Days) { DateTime From = Convert.ToDateTime(txtFrom.Text); From = From.AddDays(Days); //This change has been done to change the date format as per user selection txtFrom.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(From)); }
protected void Page_Load(object sender, EventArgs e) { if (GetSessionUserID() == 0) { Response.Redirect("~/account/login.aspx?ReturnUrl=" + Request.RawUrl.ToString()); } try { UserAccessValidation(); if (Request.QueryString.Count != 0) { int Surv_Vessel_ID = 0; int Vessel_ID = 0; if (Request.QueryString["Surv_Vessel_ID"] != null) { Surv_Vessel_ID = Convert.ToInt16(Request.QueryString["Surv_Vessel_ID"].ToString()); } if (Request.QueryString["Vessel_ID"] != null) { Vessel_ID = Convert.ToInt16(Request.QueryString["Vessel_ID"].ToString()); } if (Request.QueryString["Method"] == "CheckPreviousCertificate") { CheckPreviousCertificate(Vessel_ID, Surv_Vessel_ID); return; } } if (!IsPostBack) { DFormat = UDFLib.GetDateFormat(); Load_FleetList(); ddlFleetList.SelectedValue = Session["USERFLEETID"].ToString(); Load_VesselList(); Load_MainCategoryList(); Load_CategoryList(); Load_CertificateList(0); calExpToDate.Format = calExpFromDate.Format = calIssueFromDate.Format = calIssueToDate.Format = DFormat; txtIssueFromDate.Text = UDFLib.ConvertUserDateFormat("01/01/1990"); txtIssueToDate.Text = UDFLib.ConvertUserDateFormat(DateTime.Today.ToShortDateString()); txtExpFromDate.Text = UDFLib.ConvertUserDateFormat("01/01/1990"); txtExpToDate.Text = UDFLib.ConvertUserDateFormat(DateTime.Today.AddYears(15).ToShortDateString()); txtExpFromDate.Enabled = false; txtExpToDate.Enabled = false; ucCustomPager.PageSize = 20; } } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
/// <summary> /// Method called To Reset all filters /// </summary> protected void imgBtnrefresh_Click(object sender, ImageClickEventArgs e) { ViewState["SORTADIRECTION"] = null; ViewState["SORTBYACOLOUMN"] = null; ddlModule.SelectedValue = "0"; ddlUser.SelectedValue = "0"; txtPage.Text = ""; txtTo.Text = UDFLib.ConvertUserDateFormat(DateTime.Now.ToString()); txtFrom.Text = UDFLib.ConvertUserDateFormat(DateTime.Now.Date.AddDays(-30).ToString()); BindAccessGrid(); }
protected void Page_Load(object sender, EventArgs e) { calFrom.Format = CalendarExtender1.Format = UDFLib.GetDateFormat(); if (GetSessionUserID() == 0) { Response.Redirect("~/account/login.aspx"); } else { UserAccessValidation(); } TodayDateFormat = UDFLib.DateFormatMessage(); objContractList.AddMergedColumns(new int[] { 13, 14 }, "Eval(%)", "HeaderStyle-css-2"); if (!IsPostBack) { ConfidentialityCheck(); ViewState["SORTDIRECTION"] = null; ViewState["SORTBYCOLOUMN"] = null; int CurrentUserID = GetSessionUserID(); hdnUserID.Value = CurrentUserID.ToString(); //txtSearchJoinFromDate.Text = DateTime.Now.AddYears(-5).ToString("dd/MM/yyyy", iFormatProvider); txtSearchJoinFromDate.Text = DateTime.Now.AddYears(-5).ToString("dd/MM/yyyy", iFormatProvider); txtSearchJoinFromDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(txtSearchJoinFromDate.Text)); txtSearchJoinToDate.Text = DateTime.Now.ToString("dd/MM/yyyy", iFormatProvider); txtSearchJoinToDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(txtSearchJoinToDate.Text)); Load_CountryList(); Load_FleetList(); Load_ManningAgentList(); Load_RankList(); Load_VesselList(); Load_MainStatus(); Load_VesselTypes(); ucCustomPager_CrewList.PageSize = 30; FillGridViewAfterSearch(); if (Session["UTYPE"].ToString() == "MANNING AGENT") { GridView1.Columns[13].Visible = false; GridView1.Columns[14].Visible = false; } } string js = "Timer();RefreshButtonPopups();"; ScriptManager.RegisterStartupScript(this, this.GetType(), "initscript", js, true); }
private void Load_PortageBill() { try { string _SortOrderColumns = "DOA_HomePort , RANK_SORT_ORDER "; Dictionary <string, UDCHyperLink> DicLink = new Dictionary <string, UDCHyperLink>(); lblPageTitle.Text = "Portage Bill : " + Convert.ToString(ViewState["Vessel_Name"]) + " - " + DateTime.Parse(ViewState["PBDt"].ToString()).ToString("MMM-yyyy"); UDCHyperLink alink = new UDCHyperLink(); alink.Target = "_blank"; alink.NaviagteURL = "../crew/CrewDetails.aspx"; alink.QueryStringDataColumn = new string[] { "VoyageID", "CrewID" }; alink.QueryStringText = new string[] { "VoyageID", "ID" }; DicLink.Add("Code", alink); DataSet dsPb = BLL_PB_PortageBill.Get_PortageBill(Convert.ToInt32(DateTime.Parse(ViewState["PBDt"].ToString()).Month), Convert.ToInt32(DateTime.Parse(ViewState["PBDt"].ToString()).Year), Convert.ToInt32(ViewState["Vessel_ID"]), UDFLib.ConvertStringToNull(null), 0); dtcomment = dsPb.Tables["Comment"]; dtEntryType = dsPb.Tables["EntryType"]; DataTable dtpb = UDFLib.PivotTable("Description", "Amount", "Sort_Order", new string[] { "VOYAGEID", "PBMONTH", "PBYEAR" }, new string[] { "VOYAGEID", "PBMONTH", "PBYEAR", "RANK_SORT_ORDER", "IsFinalized", "DOA_HomePort", "RANK_SORT_ORDER", "Amount", "Description", "Sort_Order", "CrewID" }, _SortOrderColumns, DicLink, dsPb.Tables["Data"] ); totalEarnID = dtpb.Columns.IndexOf("Total Earning"); totalDedID = dtpb.Columns.IndexOf("Total Deduction"); BFid = dtpb.Columns.IndexOf("balance"); dtpb.DefaultView.RowFilter = "rank <> ''"; DataTable dt = dtpb.DefaultView.ToTable(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { if (!string.IsNullOrEmpty(dr["From"].ToString())) { dr["From"] = UDFLib.ConvertUserDateFormat(Convert.ToDateTime(dr["From"].ToString()).ToString("dd/MM/yyyy"), UDFLib.GetDateFormat()); } if (!string.IsNullOrEmpty(dr["To"].ToString())) { dr["To"] = UDFLib.ConvertUserDateFormat(Convert.ToDateTime(dr["To"].ToString()).ToString("dd/MM/yyyy"), UDFLib.GetDateFormat()); } } } GridViewPB.DataSource = dt; GridViewPB.DataBind(); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
protected void ImgExportToExcel_Click(object sender, EventArgs e) { string Sign_On_From = ""; string Sign_On_To = ""; string SearchString = txtSearch.Text; int TotalDays = 0; int PAGE_SIZE = -1; int PAGE_INDEX = -1; int SelectRecordCount = 0; int FleetCode = UDFLib.ConvertToInteger(ddlFleet.SelectedValue); int VesselID = UDFLib.ConvertToInteger(ddlVessel.SelectedValue); if (txtSignOnFrom.Text != "") { Sign_On_From = UDFLib.ConvertToDate(Convert.ToString(txtSignOnFrom.Text), UDFLib.GetDateFormat()).ToString(); } if (txtSignOnTo.Text != "") { Sign_On_To = UDFLib.ConvertToDate(Convert.ToString(txtSignOnTo.Text), UDFLib.GetDateFormat()).ToString(); } DataTable dt = BLL_Crew_CrewList.Get_Super_Att_Vessel_Report(FleetCode, VesselID, Sign_On_From, Sign_On_To, SearchString, GetSessionUserID(), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount, ref TotalDays); dt.Columns.Add("Joining_Date1"); dt.Columns.Add("Sign_On_Date1"); dt.Columns.Add("Sign_Off_Date1"); foreach (DataRow dr in dt.Rows) { if (dr["Joining_Date"].ToString() != "" && dr["Joining_Date"] != null) { dr["Joining_Date1"] = " " + UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Joining_Date"]), Convert.ToString(Session["User_DateFormat"])); } if (dr["Sign_On_Date"].ToString() != "" && dr["Sign_On_Date"] != null) { dr["Sign_On_Date1"] = " " + UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Sign_On_Date"])); } if (dr["Sign_Off_Date"].ToString() != "" && dr["Sign_Off_Date"] != null) { dr["Sign_Off_Date1"] = " " + UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Sign_Off_Date"])); } } dt.AcceptChanges(); string[] HeaderCaptions = { "Vessel", "S/Code", "Name", "Rank", "Contract Date", "S/On Date", "S/Off Date", "Days ONBD" }; string[] DataColumnsName = { "Vessel_Short_Name", "Staff_Code", "Staff_Name", "Rank_Short_Name", "Joining_Date1", "Sign_On_Date1", "Sign_Off_Date1", "DaysOnBoard" }; GridViewExportUtil.ExportToExcel(dt, HeaderCaptions, DataColumnsName, "Superintendents_attending_vessels.xls", "Superintendents attending vessels Report"); }