protected void btnExport_Click(object sender, ImageClickEventArgs e) { int rowcount = ucCustomPagerItems.isCountRecord; string vesselcode = (ViewState["VesselCode"] == null) ? null : (ViewState["VesselCode"].ToString()); string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } DataSet ds = BLL_SCM_Report.SCMReportMainSearch(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(vesselcode) , UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), sortbycoloumn, sortdirection , ucCustomPagerItems.CurrentPageIndex, null, ref rowcount); string[] HeaderCaptions = { "Vessel", "Meeting Date", "Present Position", "Verified" }; string[] DataColumnsName = { "Vessel_Name", "MEETING_DATE_S", "PRESENT_POSITION", "IsVerified" }; ds.Tables[0].Columns.Add("MEETING_DATE_S"); foreach (DataRow item in ds.Tables[0].Rows) { item["MEETING_DATE_S"] = UDFLib.ConvertDateToNull(item["MEETING_DATE"]).Value.ToString("dd/MMM/yyyy"); } GridViewExportUtil.ShowExcel(ds.Tables[0], HeaderCaptions, DataColumnsName, "SCM", "Safety Committee Meetings", HtmlFilterTable()); }
protected void btnsave_Click(object sender, EventArgs e) { if (HiddenFlag.Value == "Add") { //int responseid = objBLLExchRate.Insert_ExchangeRate(ddlCurrency.SelectedValue.ToString(), UDFLib.ConvertDecimalToNull(txtExchangeRate.Text) // , UDFLib.ConvertDateToNull(dtpCurrentDate.Text), Convert.ToInt32(Session["USERID"]),txtBaseCurr.Text); if (!check(ddlCurrency.SelectedValue.ToString(), UDFLib.ConvertDateToNull(dtpCurrentDate.Text))) { string js = "alert('Todays Currency Code AllReady Exist!');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert9", js, true); string Countrymodal = String.Format("showModal('divadd',false);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Countrymodal", Countrymodal, true); ddlCurrency.Focus(); return; } int responseid = objBLLExchRate.Insert_ExchangeRate(ddlCurrency.SelectedValue.ToString(), UDFLib.ConvertDecimalToNull(txtExchangeRate.Text) , UDFLib.ConvertDateToNull(dtpCurrentDate.Text)); } else { //int responseid = objBLLExchRate.Edit_ExchangeRate(ddlCurrency.SelectedValue.ToString(), UDFLib.ConvertDecimalToNull(txtExchangeRate.Text) // , UDFLib.ConvertDateToNull(dtpCurrentDate.Text), Convert.ToInt32(Session["USERID"])); int responseid = objBLLExchRate.Edit_ExchangeRate(ddlCurrency.SelectedValue.ToString(), UDFLib.ConvertDecimalToNull(txtExchangeRate.Text) , UDFLib.ConvertDateToNull(dtpCurrentDate.Text)); } BindExchRate(); string hidemodal = String.Format("hideModal('divadd')"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true); }
protected void btnSave_Click(object sender, EventArgs e) { try { int Vessel_ID = int.Parse(ddlVessel.SelectedValue); DateTime?Date = UDFLib.ConvertDateToNull(txtInitialDate.Text); if (Date == null) { lblMessage.Text = "Please enter valid portage bill date" + TodayDateFormat; return; } int Key = BLL_PB_PortageBill.INS_Initial_Office_Portage_Bill_DL(Vessel_ID, Date, int.Parse(Session["USERID"].ToString())); if (Key == 1) { lblMessage.Text = "Initialize office portage bill has been saved successfully."; } else { lblMessage.Text = "Initialize office portage bill already exists."; } } catch (Exception ex) { lblMessage.Text = ex.Message; } }
protected void btnUnApprove_Click(object sender, EventArgs e) { i = Checkvalue(Convert.ToDecimal(txtInvoiceValue.Text), Convert.ToDecimal(txtGST.Text), ddlType.SelectedValue); if (i == 0) { string Status = "Verified"; string InvStatus = "Verified"; string retval = BLL_POLOG_Invoice.POLog_Insert_Invoice(UDFLib.ConvertStringToNull(txtInvoiceID.Text), UDFLib.ConvertIntegerToNull(GetSupplyID()), UDFLib.ConvertStringToNull(ddlType.SelectedValue), UDFLib.ConvertDateToNull(txtInvoiceDate.Text.Trim()), txtReferance.Text.Trim(), UDFLib.ConvertDateToNull(txtReceivedDate.Text.Trim()), UDFLib.ConvertDecimalToNull(txtInvoiceValue.Text.Trim()), ddlCurrency.SelectedValue, UDFLib.ConvertDecimalToNull(txtGST.Text.Trim()), UDFLib.ConvertDateToNull(txtDueDate.Text.Trim()), InvStatus, UDFLib.ConvertDateToNull(txtPaymentDate.Text.Trim()), txtRemarks.Text.Trim(), Status, UDFLib.ConvertToInteger(GetSessionUserID())); txtInvoiceID.Text = Convert.ToString(retval); int RetAuditVal = BLL_POLOG_Register.POLOG_Insert_Transactionlog(UDFLib.ConvertStringToNull(lblInvoiceID.Text), "UNApproved Invoice", "UNApprovedInvoice", UDFLib.ConvertToInteger(GetSessionUserID())); //string msgDraft = String.Format("parent.ReloadParent_ByButtonID();"); //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true); BindInvoice(); string message = "alert('Invoice UN_Approve.')"; ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true); } else if (i == 1) { string message = "alert('Invoice Value should be negative for credit note Invoice Type.')"; ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true); } else if (i == 2) { string message = "alert('Invoice and GST value should be positive.')"; ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true); } }
protected void btnSave_Click(object sender, EventArgs e) { i = Checkvalue(Convert.ToDecimal(txtInvoiceValue.Text), Convert.ToDecimal(txtGST.Text), ddlType.SelectedValue); if (i == 0) { string Status = "Received"; string InvStatus = "Received"; //txtInvoiceID.Text = "000000"; string retval = BLL_POLOG_Invoice.POLog_Insert_Invoice(UDFLib.ConvertStringToNull(txtInvoiceID.Text), UDFLib.ConvertIntegerToNull(GetSupplyID()), UDFLib.ConvertStringToNull(ddlType.SelectedValue), UDFLib.ConvertDateToNull(txtInvoiceDate.Text.Trim()), txtReferance.Text.Trim(), UDFLib.ConvertDateToNull(txtReceivedDate.Text.Trim()), UDFLib.ConvertDecimalToNull(txtInvoiceValue.Text.Trim()), ddlCurrency.SelectedValue, UDFLib.ConvertDecimalToNull(txtGST.Text.Trim()), UDFLib.ConvertDateToNull(txtDueDate.Text.Trim()), InvStatus, UDFLib.ConvertDateToNull(txtPaymentDate.Text.Trim()), txtRemarks.Text.Trim(), Status, UDFLib.ConvertToInteger(GetSessionUserID())); txtInvoiceID.Text = Convert.ToString(retval); BindInvoice(); string Action = "New Invoice"; string Description = "NewInvoice"; int RetAuditVal = BLL_POLOG_Register.POLOG_Insert_Transactionlog(UDFLib.ConvertStringToNull(lblInvoiceID.Text), Action, Description, UDFLib.ConvertToInteger(GetSessionUserID())); string message = "alert('Invoice Saved.')"; ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true); } else if (i == 1) { string message = "alert('Invoice and GST value should be negative for credit note Invoice Type.')"; ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true); } else if (i == 2) { string message = "alert('Invoice and GST value should be positive.')"; ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true); } }
protected void onUpdate(object source, CommandEventArgs e) { HiddenFlag.Value = "Edit"; OperationMode = "Edit Exchange Rate"; ddlCurrency.Enabled = false; dtpCurrentDate.Enabled = false; string[] arg = e.CommandArgument.ToString().Split(','); string Currency = UDFLib.ConvertStringToNull(arg[0]); DateTime?Curr_Date = UDFLib.ConvertDateToNull(arg[1]); DataTable dt = new DataTable(); dt = objBLLExchRate.Get_ExchangeRate_List(Currency, Curr_Date); txtCurrency.Text = dt.Rows[0]["CURR_CODE"].ToString(); //ddlCurrency.SelectedValue = dt.Rows[0]["Currency_Code"].ToString() != "" ? dt.Rows[0]["Currency_Code"].ToString() : "0"; ddlCurrency.SelectedValue = dt.Rows[0]["CURR_CODE"].ToString(); txtExchangeRate.Text = dt.Rows[0]["EXCH_RATE"].ToString(); dtpCurrentDate.Text = dt.Rows[0]["DATE"].ToString(); //txtBaseCurr.Text = dt.Rows[0]["BASE_CURRECY"].ToString(); string AddUserTypemodal = String.Format("showModal('divadd',false);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddUserTypemodal", AddUserTypemodal, true); }
protected void Page_Load(object sender, EventArgs e) { if (AjaxFileUpload1.IsInFileUploadPostBack) { } else { if (!IsPostBack) { if (Request.QueryString["InspectionDetailId"] != null) { lblInspectionDetailId.Text = Request.QueryString["InspectionDetailId"].ToString(); if (Request.QueryString["Vessel_Id"] != null) { ViewState["Vessel_Id"] = Request.QueryString["Vessel_Id"]; } if (Request.QueryString["Vessel_Name"] != null) { lblVesselName.Text = Request.QueryString["Vessel_Name"]; } if (Request.QueryString["Schedule_Date"] != null) { lblInspectionDate.Text = UDFLib.ConvertDateToNull(Request.QueryString["Schedule_Date"]).Value.ToString("dd/MMM/yyyy"); } BindInspAttchment(); } } lblErrorMsg.Text = ""; } }
/// <summary> /// Added pagination on 27 th may 2016 /// </summary> protected void Load_Report_Index() { DataTable dtFleetCodes = ddlFleet.SelectedValues; DataTable dtVessel_ID = ddlVessel.SelectedValues; DateTime?From_Date = UDFLib.ConvertDateToNull(txtFromDate.Text); DateTime?To_Date = UDFLib.ConvertDateToNull(txtToDate.Text); string SearchText = txtSearch.Text; int rowcount = ucCustomPagerItems.isCountRecord; //int? isfavorite = null; if (ddlFavorite.SelectedValue != "2") isfavorite = Convert.ToInt32(ddlFavorite.SelectedValue.ToString()); //int? countrycode = null; if (ddlSearchCountry.SelectedValue != "0") countrycode = Convert.ToInt32(ddlSearchCountry.SelectedValue.ToString()); 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_eForms_Admin.Get_ReportIndex(dtFleetCodes, dtVessel_ID, From_Date, To_Date, SearchText, GetSessionUserID(), sortbycoloumn, sortdirection , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } GridView_Reports.DataSource = dt; GridView_Reports.DataBind(); }
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", ""); }
public void BindJiBePacketGrid() { 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 = objVessel.Get_JiBePacketStatus_Search(UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), UDFLib.ConvertIntegerToNull(ddlStatus.SelectedValue), UDFLib.ConvertToInteger(Session["USERCOMPANYID"].ToString()) , UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), sortbycoloumn, sortdirection , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } gvPktStat.DataSource = dt; gvPktStat.DataBind(); }
protected void BindItems() { DateTime?sFromDate; DateTime?sToDate; if (ViewState["sFromDT"].ToString() == "") { sFromDate = null; } else { sFromDate = UDFLib.ConvertDateToNull(ViewState["sFromDT"]); } if (ViewState["sToDT"].ToString() == "") { sToDate = null; } else { sToDate = UDFLib.ConvertDateToNull(ViewState["sToDT"]); } int Record_count = 0; gvPortReport.DataSource = BLL_OPS_VoyageReports.Get_PortReportIndex(Convert.ToInt32(ViewState["iVesselID"]), sFromDate, sToDate, UDFLib.ConvertStringToNull(ViewState["Sort_Column"]), UDFLib.ConvertStringToNull(ViewState["Sort_Direction"]), UDFLib.ConvertIntegerToNull(ucCustomPagerItems.CurrentPageIndex), UDFLib.ConvertIntegerToNull(ucCustomPagerItems.PageSize), ref Record_count); gvPortReport.DataBind(); ucCustomPagerItems.CountTotalRec = Record_count.ToString(); ucCustomPagerItems.BuildPager(); }
public void BindItems() { if (IsPostBack) { SaveItemsSelection(); } int is_fetch_count = ucCustomPager1.isCountRecord; gvNonContractItems.DataSource = BLL_PURC_CTP.Get_Ctp_Non_Contract_Items(UDFLib.ConvertDateToNull(txtReqsnDTFrom.Text) , UDFLib.ConvertDateToNull(txtReqsnDTTo.Text) , UDFLib.ConvertStringToNull(ddlSubCatalogue.SelectedValue) , ddlCatalogue.SelectedValue , ucCustomPager1.CurrentPageIndex , ucCustomPager1.PageSize , ref is_fetch_count , null , null ); gvNonContractItems.DataBind(); if (ucCustomPager1.isCountRecord == 1) { ucCustomPager1.CountTotalRec = is_fetch_count.ToString(); ucCustomPager1.BuildPager(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int Vessel_Id = Convert.ToInt32(Request.QueryString["Vessel_Id"]); lblVessel.Text = Convert.ToString(Request.QueryString["Vessel_Short_Name"]); lblProgramName.Text = BLL_LMS_Training.Get_ProgramDescriptionbyId(Convert.ToInt32(Request.QueryString["Program_Id"])).Rows[0]["PROGRAM_Name"].ToString(); lblProgramDescription.Text = BLL_LMS_Training.Get_ProgramDescriptionbyId(Convert.ToInt32(Request.QueryString["Program_Id"])).Rows[0]["PROGRAM_DESCRIPTION"].ToString(); ds_TrgPrgDetails = BLL_LMS_Training.GET_Program_Summary(Convert.ToInt32(Request.QueryString["Program_Id"]), Convert.ToInt32(Request.QueryString["SCHEDULE_ID"]), Convert.ToInt32(Request.QueryString["Office_Id"]), Vessel_Id); lblRemarks.Text = ds_TrgPrgDetails.Tables[3].Rows[0]["Remarks"].ToString(); if (ds_TrgPrgDetails.Tables[3].Rows[0]["TRG_START_DATE"].ToString().Trim() != "") { lblTrgStDate.Text = UDFLib.ConvertDateToNull(ds_TrgPrgDetails.Tables[3].Rows[0]["TRG_START_DATE"].ToString()).Value.ToString("dd/MMM/yyyy"); } if (ds_TrgPrgDetails.Tables[3].Rows[0]["TRG_END_DATE"].ToString().Trim() != "") { lblTrgEnDate.Text = UDFLib.ConvertDateToNull(ds_TrgPrgDetails.Tables[3].Rows[0]["TRG_END_DATE"].ToString()).Value.ToString("dd/MMM/yyyy"); } if (ds_TrgPrgDetails.Tables[3].Rows[0]["Program_Category_Id"].ToString() == "4") { btndrillactivity.Visible = true; } else { btndrillactivity.Visible = false; } dtResourceItem = ds_TrgPrgDetails.Tables[1]; dtAttendees = ds_TrgPrgDetails.Tables[2]; gvTrainingProgram_Details.DataSource = ds_TrgPrgDetails.Tables[0]; gvTrainingProgram_Details.DataBind(); } //string msg1 = String.Format("$('.sailingInfo').SailingInfo();"); //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgshowdetails", msg1, true); }
protected void btnExport_Click(object sender, ImageClickEventArgs e) { int rowcount = ucCustomPagerItems.isCountRecord; string vesselcode = (ViewState["VesselCode"] == null) ? null : (ViewState["VesselCode"].ToString()); 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_QMS_RestHours.Get_RestHours_Index(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue), UDFLib.ConvertStringToNull(txtCrew.Text), UDFLib.ConvertStringToNull(ddlRank.SelectedValue), UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text), sortbycoloumn, sortdirection , 1, null, ref rowcount); string[] HeaderCaptions = { "Vessel", "Date", "Code", "Crew Name", "Rank", "Ship's Clocked Hours", "Working Hours", "Rest Hours", "Rest Hours Any 24", "Over Time", "Seafarer's Remarks", "Verifier's Remarks" }; string[] DataColumnsName = { "Vessel_Name", "REST_HOURS_DATE", "Staff_Code", "Staff_Name", "Staff_rank_Code", "SHIPS_CLOCKED_HOURS", "WORKING_HOURS", "REST_HOURS", "REST_HOURS_ANY24", "OverTime_HOURS", "Seafarer_Remarks", "Verifier_Remarks" }; GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "Rest Hour", "Rest_Hours_Index", ""); //ExcelDataExport objexp = new ExcelDataExport(); //objexp.WriteExcell(dt); }
public void BindGrid() { int rowcount = ucCustomPagerItems.isCountRecord; string vesselcode = (ViewState["VesselCode"] == null) ? null : (ViewState["VesselCode"].ToString()); 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_QMS_RestHours.Get_RestHours_Index(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue), UDFLib.ConvertStringToNull(txtCrew.Text), UDFLib.ConvertStringToNull(ddlRank.SelectedValue) , UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text), sortbycoloumn, sortdirection , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (dt.Rows.Count > 0) { gvDeckLogBook.DataSource = dt; gvDeckLogBook.DataBind(); } else { gvDeckLogBook.DataSource = dt; gvDeckLogBook.DataBind(); } }
protected void ImgExpExcel_Click(object sender, EventArgs e) { int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); string sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = ViewState["SORTDIRECTION"].ToString(); } DataTable dt = BLL_JRA_Hazards.GET_ASSESSMENT_SEARCH(DDLVessel.SelectedIndex <= 0 ? null : DDLVessel.SelectedValue, null, ddlChildWorkCateg.SelectedIndex <= 0 ? null : ddlChildWorkCateg.SelectedValue, ddlAssessmentStatus.SelectedIndex <= 0 ? null : ddlAssessmentStatus.SelectedValue.ToString(), UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), "", GetSessionUserID(), null, null, sortbycoloumn, sortdirection, ref rowcount).Tables[0]; string Header = (ddlChildWorkCateg.SelectedIndex > 0 ? ddlChildWorkCateg.SelectedItem.Text : "") + " Risk Assessment"; string[] HeaderCaptions = { "Vessel Name ", "Assessment No.", "Job Assessed", "Current Assessment Date", "Last Assessment Date", "Assessment Status", }; string[] DataColumnsName = { "Vessel_Name", "Work_Categ_Value", "Work_Category_Name", "Current_Assessment_Date", "Last_Assessment_Date", "Assessment_Status" }; GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "JobRiskAssessmentIndex", Header, ""); }
protected void btnsave_Click(object sender, EventArgs e) { if (HiddenFlag.Value == "Add") { //Added a new parameter (ddlDateFormat.SelectedValue) to save date format settings. int responseid = objBLL.InsertCompany(int.Parse(txtCompCode.Text.Trim()), int.Parse(ddlCompanyType.SelectedValue), txtCompName.Text.Trim(), txtRegNo.Text.Trim() , UDFLib.ConvertDateToNull(txtDtIncorp.Text.Trim()), UDFLib.ConvertToInteger(ddlCountryIncorp.SelectedValue), UDFLib.ConvertIntegerToNull(ddlCurrency.SelectedValue), txtAddrerss.Text.Trim() , UDFLib.ConvertIntegerToNull(ddlAddressCountry.SelectedValue), txtEmail.Text.Trim(), txtPhone.Text.Trim() , UDFLib.ConvertToInteger(Session["UserID"]), txtShortName.Text, txtEmail2.Text, txtPhone2.Text, txtFax1.Text, txtFax2.Text, ddlDateFormat.SelectedValue); if (responseid != -1) { objBLL.InsertCompanyReletionship(UDFLib.ConvertToInteger(ddlParentCompany.SelectedValue), responseid, UDFLib.ConvertToInteger(ddlRelation.SelectedValue), UDFLib.ConvertToInteger(Session["UserID"])); } else { string js1 = "alert('Company name already exists');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alertUser", js1, true); } } else { //Added a new parameter (ddlDateFormat.SelectedValue) to save date format settings. int responseid = objBLL.EditCompany(Convert.ToInt32(txtCompanyID.Text), Convert.ToInt32(txtCompCode.Text), Convert.ToInt32(ddlCompanyType.SelectedValue) , txtCompName.Text, txtShortName.Text, txtRegNo.Text, txtDtIncorp.Text, UDFLib.ConvertIntegerToNull(ddlCountryIncorp.SelectedValue), UDFLib.ConvertIntegerToNull(ddlCurrency.SelectedValue) , txtAddrerss.Text, UDFLib.ConvertIntegerToNull(ddlAddressCountry.SelectedValue), txtEmail.Text, txtPhone.Text, txtEmail2.Text, txtPhone2.Text, txtFax1.Text, txtFax2.Text, UDFLib.ConvertToInteger(Session["UserID"]), ddlDateFormat.SelectedValue); } Session["User_DateFormat"] = ddlDateFormat.SelectedValue; BindCompany(); string hidemodal = String.Format("hideModal('divadd')"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true); }
/// <summary> /// Excel export /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnExport_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()); } DataSet ds = objJobStatus.TecMachineryRunningHoursSearch(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue) , UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), null, null, ViewState["RecordDisplayType"].ToString(), UDFLib.ConvertIntegerToNull(ddlFunction.SelectedValue), UDFLib.ConvertStringToNull(ddlSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[0]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[0]), sortbycoloumn, sortdirection, null, null, ref rowcount, chkDisplayInheritingCounter.Checked == true ? 1 : 0); string[] HeaderCaptions = { "Vessel", "System Location", "Sub-System Location", "Date Hours Read", "Differential R.Hours", "Running Hours", "Created by", "Created Date" }; string[] DataColumnsName = { "Vessel_Name", "Location", "SubLocation", "Date_Hours_Read", "diff_in_Rhrs", "Runing_Hours", "Created_By", "Created_On" }; GridViewExportUtil.ShowExcel(ds.Tables[0], HeaderCaptions, DataColumnsName, "Machinery Running Hours", "Machinery Running Hours", ""); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true); } }
protected void Search_Worklist() { try { UpdateWorklistChecklist(); DataTable dtFilter = new DataTable(); dtFilter.Columns.Add("PRM_NAME", typeof(string)); dtFilter.Columns.Add("PRM_VALUE", typeof(object)); dtFilter.Rows.Add(new object[] { "@FLEET_ID", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@VESSEL_ID", UDFLib.ConvertIntegerToNull(ViewState["VID"]) }); dtFilter.Rows.Add(new object[] { "@ASSIGNOR", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@DEPT_SHIP", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@DEPT_OFFICE", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@PRIORITY", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@CATEGORY_NATURE", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@CATEGORY_PRIMARY", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@CATEGORY_SECONDARY", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@CATEGORY_MINOR", null, }); dtFilter.Rows.Add(new object[] { "@JOB_DESCRIPTION", UDFLib.ConvertStringToNull(null) }); dtFilter.Rows.Add(new object[] { "@JOB_STATUS", UDFLib.ConvertStringToNull(rblJobStaus.SelectedValue) }); dtFilter.Rows.Add(new object[] { "@JOB_TYPE", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@PIC", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@JOB_MODIFIED_IN", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@DATE_RAISED_FROM", UDFLib.ConvertDateToNull(null) }); dtFilter.Rows.Add(new object[] { "@DATE_RAISED_TO", UDFLib.ConvertDateToNull(null) }); dtFilter.Rows.Add(new object[] { "@DATE_CMPLTN_FROM", UDFLib.ConvertDateToNull(null) }); dtFilter.Rows.Add(new object[] { "@DATE_CMPLTN_TO", UDFLib.ConvertDateToNull(null) }); dtFilter.Rows.Add(new object[] { "@DEFER_TO_DD", (null) }); dtFilter.Rows.Add(new object[] { "@SENT_TO_SHIP", (null) }); dtFilter.Rows.Add(new object[] { "@HAVING_REQ_NO", (null) }); dtFilter.Rows.Add(new object[] { "@FLAGGED_FOR_MEETING", (null) }); dtFilter.Rows.Add(new object[] { "@INSPECTOR", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@PAGE_INDEX", ucCustomPagerctp.CurrentPageIndex }); dtFilter.Rows.Add(new object[] { "@PAGE_SIZE", ucCustomPagerctp.PageSize }); int Record_Count = 0; DataTable taskTable = objInsp.Get_WorkList_Index(dtFilter, ref Record_Count); grdJoblist.DataSource = taskTable; grdJoblist.DataBind(); ucCustomPagerctp.CountTotalRec = Record_Count.ToString(); ucCustomPagerctp.BuildPager(); DataTable dtPKIDs = taskTable.DefaultView.ToTable(true, new string[] { "WORKLIST_ID", "VESSEL_ID", "OFFICE_ID" }); dtPKIDs.PrimaryKey = new DataColumn[] { dtPKIDs.Columns["WORKLIST_ID"], dtPKIDs.Columns["VESSEL_ID"], dtPKIDs.Columns["OFFICE_ID"] }; Session["WORKLIST_PKID_NAV"] = dtPKIDs; lblRecordCount.Text = Record_Count.ToString(); } catch (Exception ex) { ////.WriteError(this.GetType().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex); string js = "alert('Error in loading data!! Error: " + UDFLib.ReplaceSpecialCharacter(ex.Message) + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true); } }
protected void Search_Worklist() { try { DataTable dtFilter = new DataTable(); dtFilter.Columns.Add("PRM_NAME", typeof(string)); dtFilter.Columns.Add("PRM_VALUE", typeof(object)); dtFilter.Rows.Add(new object[] { "@FLEET_ID", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@VESSEL_ID", UDFLib.ConvertIntegerToNull(Request.QueryString["VesselID"].ToString()) }); dtFilter.Rows.Add(new object[] { "@ASSIGNOR", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@DEPT_SHIP", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@DEPT_OFFICE", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@PRIORITY", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@CATEGORY_NATURE", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@CATEGORY_PRIMARY", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@CATEGORY_SECONDARY", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@CATEGORY_MINOR", null, }); dtFilter.Rows.Add(new object[] { "@JOB_DESCRIPTION", UDFLib.ConvertStringToNull(null) }); dtFilter.Rows.Add(new object[] { "@JOB_STATUS", UDFLib.ConvertStringToNull(null) }); dtFilter.Rows.Add(new object[] { "@JOB_TYPE", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@PIC", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@JOB_MODIFIED_IN", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@DATE_RAISED_FROM", UDFLib.ConvertDateToNull(null) }); dtFilter.Rows.Add(new object[] { "@DATE_RAISED_TO", UDFLib.ConvertDateToNull(null) }); dtFilter.Rows.Add(new object[] { "@DATE_CMPLTN_FROM", UDFLib.ConvertDateToNull(null) }); dtFilter.Rows.Add(new object[] { "@DATE_CMPLTN_TO", UDFLib.ConvertDateToNull(null) }); dtFilter.Rows.Add(new object[] { "@DEFER_TO_DD", (null) }); dtFilter.Rows.Add(new object[] { "@SENT_TO_SHIP", (null) }); dtFilter.Rows.Add(new object[] { "@HAVING_REQ_NO", (null) }); dtFilter.Rows.Add(new object[] { "@FLAGGED_FOR_MEETING", (null) }); dtFilter.Rows.Add(new object[] { "@INSPECTOR", UDFLib.ConvertIntegerToNull(null) }); dtFilter.Rows.Add(new object[] { "@PAGE_INDEX", ucCustomPagerctp.CurrentPageIndex }); dtFilter.Rows.Add(new object[] { "@PAGE_SIZE", ucCustomPagerctp.PageSize }); dtFilter.Rows.Add(new object[] { "@LOCATION_ID", UDFLib.ConvertIntegerToNull(Request.QueryString["LocationID"].ToString()) }); dtFilter.Rows.Add(new object[] { "@NODE_ID", UDFLib.ConvertIntegerToNull(Request.QueryString["LocationNodeID"].ToString() == "-1" ? null : Request.QueryString["LocationNodeID"].ToString()) }); dtFilter.Rows.Add(new object[] { "@InspectionID", UDFLib.ConvertIntegerToNull(Request.QueryString["InspID"]) }); int Record_Count = 0; DataSet taskTable = objInsp.INSP_Get_Worklist(dtFilter, ref Record_Count); if (taskTable.Tables.Count > 0) { Session["TaskTable"] = taskTable.Tables[0]; grdWLJobs.DataSource = taskTable.Tables[0]; grdWLJobs.DataBind(); ucCustomPagerctp.CountTotalRec = Record_Count.ToString(); ucCustomPagerctp.BuildPager(); } } catch (Exception ex) { ////.WriteError(this.GetType().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex); string js = "alert('Error in loading data!! Error: " + UDFLib.ReplaceSpecialCharacter(ex.Message) + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true); } }
protected void ddlVesselList_SelectedIndexChanged(object sender, EventArgs e) { ddlCrewList.DataSource = BLL_QMS_RestHours.CrewList_by_Date(UDFLib.ConvertDateToNull(txtFrom.Text), UDFLib.ConvertDateToNull(txtTo.Text), UDFLib.ConvertToInteger(ddlVesselList.SelectedValue)); ddlCrewList.DataTextField = "staff_name"; ddlCrewList.DataValueField = "CrewID"; ddlCrewList.DataBind(); }
protected void btnSave_Click(object sender, EventArgs e) { try { // rdoDeferToDrydock.Items[1].Selected = true; int Return_ID = 0; int retval = objBLLPurc.INSERT_ADHOC_JOB(UDFLib.ConvertToInteger(ViewState["Job_History_Id"]), UDFLib.ConvertToInteger(ViewState["OFFICE_ID"]), UDFLib.ConvertToInteger(ViewState["VESSEL_ID"]) , UDFLib.ConvertToInteger(ddlFunction.SelectedValue) , UDFLib.ConvertToInteger(ddlSysLocation.SelectedValue.ToString().Split(',')[0]) , UDFLib.ConvertToInteger(ddlSysLocation.SelectedValue.ToString().Split(',')[1]) , UDFLib.ConvertToInteger(ddlSubSystem_location.SelectedValue.ToString().Split(',')[1]) , UDFLib.ConvertToInteger(ddlSubSystem_location.SelectedValue.ToString().Split(',')[0]) , txtJobTitle.Text, txtJobDescription.Text , "PENDING", null , Convert.ToInt32(Session["userid"]) , UDFLib.ConvertIntegerToNull(ddlPIC.SelectedValue) , UDFLib.ConvertIntegerToNull(ddlAssignedBy.SelectedValue) , UDFLib.ConvertIntegerToNull(rdoDeferToDrydock.Items[0].Selected == true ? 1 : 0), ddlPriority.SelectedValue.ToString() , UDFLib.ConvertIntegerToNull(ddlInspector.SelectedValue) , UDFLib.ConvertDateToNull(txtInspectionDate.Text), UDFLib.ConvertIntegerToNull(ddlOnShip.SelectedValue) , UDFLib.ConvertIntegerToNull(ddlInOffice.SelectedValue) , UDFLib.ConvertDateToNull(txtExpectedComp.Text) , UDFLib.ConvertDateToNull(txtCompletedOn.Text) , UDFLib.ConvertToInteger(ddlPrimary.SelectedValue) , UDFLib.ConvertToInteger(ddlSecondary.SelectedValue) , UDFLib.ConvertToInteger(ddlPSCSIRE.SelectedValue) , cmbRequisition.SelectedValue , UDFLib.ConvertIntegerToNull(chkSafetyAlarm.Checked == true ? 1 : 0) , UDFLib.ConvertIntegerToNull(chkCalibration.Checked == true ? 1 : 0) , UDFLib.ConvertIntegerToNull(rbtnFunctional.Items[0].Selected == true ? 1 : 0) , ddlEffect.SelectedValue , UDFLib.ConvertToDecimal(txtbxSetPointDecimal.Text.Trim()) , int.Parse(ddlUnit.SelectedValue) , UDFLib.ConvertIntegerToNull(rbtnJobProcess.Items[0].Selected == true ? 1 : 0) , ref Return_ID ); ViewState["Job_History_Id"] = Return_ID; Session["Non_PMS_Job_History_Id"] = Return_ID; Session["Non_PMS_VESSEL_ID"] = ViewState["VESSEL_ID"]; ViewState["OFFICE_ID"] = 1; Session["Non_PMS_Office_ID"] = ViewState["OFFICE_ID"]; string js = "alert('Saved sucessfully!!');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "savingJob", js, true); BindJobDetails(); } catch (Exception ex) { string js = "alert('Error in saving data!! Error: " + ex.Message + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "errorsaving", js, true); } }
//private void BindPendingStatas() //{ // try // { // using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase()) // { // DataSet ds = new DataSet(); // DataTable dt = objTechService.GetRequisitionStageDetails( // "1", "313", (DateTime.Now.AddDays(-(DateTime.Now.DayOfYear) + 1)).ToString("dd-MM-yyyy"), (DateTime.Now.AddMonths(1).AddDays(-(DateTime.Now.Day))).ToString("dd-MM-yyyy")); // rgdReqAllStage.DataSource = dt; // rgdReqAllStage.DataBind(); // } // } // catch (Exception ex) // { // //.WriteError(this.GetType().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex); // } // finally // { // } //} public void BindSearchRequistionstages() { string ddDept = null; if (cmbDept.SelectedIndex != 0) { ddDept = UDFLib.ConvertStringToNull(cmbDept.SelectedValue.ToString()); } 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()); } BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase(); //DataTable dt = objTechService.GetRequisitionStageDetails(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue), // (txtReqNo.Text.Trim() != "" ? txtReqNo.Text.Trim() : null),(txtPoNo.Text.Trim() != "" ? txtPoNo.Text.Trim() : null),ddDept, // UDFLib.ConvertStringToNull(cmbUrgency.SelectedValue),UDFLib.ConvertIntegerToNull(txtTimeLapse.Text),UDFLib.ConvertIntegerToNull(ddlHoldUnhold.SelectedValue), // UDFLib.ConvertDateToNull(txtSearchJoinFromDate.Text.Trim()),UDFLib.ConvertDateToNull(txtSearchJoinToDate.Text.Trim()), // sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); DataTable dt = objTechService.GetRequisitionStageDetails(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue) , UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue) , txtReqNo.Text.Trim() != "" ? txtReqNo.Text.Trim() : null , txtPoNo.Text.Trim() != "" ? txtPoNo.Text.Trim() : null , ddDept, UDFLib.ConvertStringToNull(cmbUrgency.SelectedValue), UDFLib.ConvertIntegerToNull(txtTimeLapse.Text), UDFLib.ConvertIntegerToNull(ddlHoldUnhold.SelectedValue) , UDFLib.ConvertDateToNull(txtSearchJoinFromDate.Text.Trim()), UDFLib.ConvertDateToNull(txtSearchJoinToDate.Text.Trim()) , sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); //DataTable dt = objTechService.GetRequisitionStageDetails(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue) // , txtReqNo.Text.Trim() != "" ? txtReqNo.Text.Trim() : null, txtPoNo.Text.Trim() != "" ? txtPoNo.Text.Trim() : null, ddDept // , UDFLib.ConvertStringToNull(cmbUrgency.SelectedValue) // , UDFLib.ConvertIntegerToNull(txtTimeLapse.Text), UDFLib.ConvertIntegerToNull(ddlHoldUnhold.SelectedValue) // , UDFLib.ConvertDateToNull(txtSearchJoinFromDate.Text.Trim()) // , UDFLib.ConvertDateToNull(txtSearchJoinToDate.Text.Trim()) // , sortbycoloumn, sortdirection // , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (dt.Rows.Count > 0) { rgdReqAllStage.DataSource = dt; rgdReqAllStage.DataBind(); } else { rgdReqAllStage.DataSource = dt; rgdReqAllStage.DataBind(); } }
private void BindRestHoursDetails() { DataTable dt = BLL_QMS_RestHours.Get_RestHours_Report(UDFLib.ConvertDateToNull(txtFrom.Text), UDFLib.ConvertDateToNull(txtTo.Text), UDFLib.ConvertToInteger(ddlCrewList.SelectedValue), UDFLib.ConvertToInteger(ddlVesselList.SelectedValue)); if (dt.Rows.Count > 0) { lblStaffCode.Text = dt.Rows[0]["Staff_Code"].ToString(); lblStaffName.Text = dt.Rows[0]["Staff_Name"].ToString(); lblStaffRank.Text = dt.Rows[0]["Staff_rank_Code"].ToString(); txtSeafarerRemarks.Text = dt.Rows[0]["Seafarer_Remarks"].ToString(); txtVerifierRemarks.Text = dt.Rows[0]["Verifier_Remarks"].ToString(); lblManage.Text = dt.Rows[0]["Manager_Code"].ToString() + "-" + dt.Rows[0]["Manager_Rank"].ToString() + "-" + dt.Rows[0]["Manager_Name"].ToString(); lblDateofjoing.Text = dt.Rows[0]["Joining_Date"].ToString() != "" ? Convert.ToDateTime(dt.Rows[0]["Joining_Date"]).ToString("dd/MMM/yyyy") : ""; lblDateofsignoff.Text = dt.Rows[0]["Sign_Off_Date"].ToString() != "" ? Convert.ToDateTime(dt.Rows[0]["Sign_Off_Date"]).ToString("dd/MMM/yyyy") : ""; lblSignOn.Text = dt.Rows[0]["Sign_On_Date"].ToString() != "" ? Convert.ToDateTime(dt.Rows[0]["Sign_On_Date"]).ToString("dd/MMM/yyyy") + " " + Convert.ToDateTime(dt.Rows[0]["Sign_On_Date"]).ToString("HH:MM") : ""; // lblManagerRank.Text = dt.Rows[0]["Manager_Rank"].ToString(); lblRestHourDate.Text = " Date : " + dt.Rows[0]["REST_HOURS_DATE"].ToString(); if (dt.Rows[0]["IsEmergency"].ToString() == "1") { chkEmergency.Checked = true; } if (dt.Rows[0]["IsArrival"].ToString() == "1") { chkArrival.Checked = true; } if (dt.Rows[0]["IsDeparture"].ToString() == "1") { chkDeparture.Checked = true; } if (dt.Rows[0]["IsDrill"].ToString() == "1") { chkDrill.Checked = true; } if (dt.Rows[0]["IsEmergencyVerify"].ToString() == "1") { chkEmergencyVerify.Checked = true; } } else { lblStaffCode.Text = ""; lblStaffName.Text = ""; lblStaffRank.Text = ""; lblDateofjoing.Text = ""; lblDateofsignoff.Text = ""; txtSeafarerRemarks.Text = ""; txtVerifierRemarks.Text = ""; lblManage.Text = ""; lblSignOn.Text = ""; // lblManagerRank.Text = dt.Rows[0]["Manager_Rank"].ToString(); lblRestHourDate.Text = ""; } rpDeckLogBook01.DataSource = dt; rpDeckLogBook01.DataBind(); }
protected void SaveData() { try { string BillingStart = ""; string BillingEnd = ""; string LayCanEndDate = ""; string Delivery_Date = ""; string ReDelivery_Date = ""; int msg = 0; double AddressComm = 0.00; double InvoiceAmt = 0.00; double RecveiveAmt = 0.00; if (txtAddressCommision.Text != "") { AddressComm = Convert.ToDouble(txtAddressCommision.Text); } if (txtInvAmount.Text != "") { InvoiceAmt = Convert.ToDouble(txtInvAmount.Text); } if (txtReceivedamount.Text != "") { RecveiveAmt = Convert.ToDouble(txtReceivedamount.Text); } if (dtBillingStart.Text != "") { BillingStart = AddHourMin(dtBillingStart.Text, ddlBillingStartHours.SelectedValue, ddlBillingStartMins.SelectedValue); } if (dtBillingEnd.Text != "") { BillingEnd = AddHourMin(dtBillingEnd.Text, ddlBillingStartHours.SelectedValue, ddlBillingStartMins.SelectedValue); } if (Session["CPID"] != null) { if (ViewState["InvID"] != null && ViewState["InvID"].ToString() != "0") { msg = objHI.UPD_Hire_Invoice(UDFLib.ConvertIntegerToNull(ViewState["InvID"]), txtReference.Text, UDFLib.ConvertIntegerToNull(ddlStatus.SelectedValue), ddlStatus.SelectedItem.Text, ddlBank.SelectedValue, AddressComm, InvoiceAmt, RecveiveAmt, UDFLib.ConvertDateToNull(BillingStart), UDFLib.ConvertDateToNull(BillingEnd), UDFLib.ConvertDateToNull(txtDate.Text), UDFLib.ConvertDateToNull(txtDueDate.Text), txtInvRemarks.Text, UDFLib.ConvertToInteger(Session["UserID"].ToString())); } else if (ViewState["InvID"].ToString() == "0") { int RetValue = objHI.INS_Hire_Invoice(UDFLib.ConvertIntegerToNull(Session["CPID"]), UDFLib.ConvertIntegerToNull(ddlStatus.SelectedValue), ddlStatus.SelectedItem.Text, ddlBank.SelectedValue, txtReference.Text, AddressComm, InvoiceAmt, UDFLib.ConvertDateToNull(BillingStart), UDFLib.ConvertDateToNull(BillingEnd), UDFLib.ConvertDateToNull(txtDate.Text), UDFLib.ConvertDateToNull(txtDueDate.Text), txtInvRemarks.Text, UDFLib.ConvertToInteger(Session["UserID"].ToString())); ViewState["InvID"] = RetValue.ToString(); } } } catch (Exception ex) { string msg = ex.ToString(); } }
protected void btnSaveUserDetails_Click(object sender, EventArgs e) { lblMessage.Text = ""; UserProperties User = new UserProperties(); try { if (txtDateOfBirth.Text != "") { DateTime DOB = DateTime.Parse(txtDateOfBirth.Text); } } catch (Exception) { lblMessage.Text = "Please enter valid Date Of Birth."; return; } try { if (txtDateOfJoining.Text != "") { DateTime DOJ = DateTime.Parse(txtDateOfJoining.Text); } } catch (Exception) { lblMessage.Text = "Please enter valid Date Of Joining."; return; } try { if (txtDateOfProbation.Text != "") { DateTime DOP = DateTime.Parse(txtDateOfProbation.Text); } } catch (Exception) { lblMessage.Text = "Please enter valid Date Of Probation."; return; } try { objUserBLL.CreateUser(Convert.ToInt32(Session["USERID"]), txtFirstName.Text, "", txtLastName.Text, txtUserName.Text, DMS.DES_Encrypt_Decrypt.Encrypt(txtPassword.Text), null, txtEMail.Text , UDFLib.ConvertIntegerToNull(ddlDepartment.SelectedValue), UDFLib.ConvertIntegerToNull(ddlManager.SelectedValue), UDFLib.ConvertDecimalToNull(txtApprovalLimit.Text) , txtDesignation.Text, txtMobileNo.Text, UDFLib.ConvertDateToNull(txtDateOfBirth.Text), UDFLib.ConvertDateToNull(txtDateOfJoining.Text), UDFLib.ConvertDateToNull(txtDateOfProbation.Text) , UDFLib.ConvertStringToNull(txtPermanentAddress.Text), UDFLib.ConvertStringToNull(txtPresentAddress.Text), UDFLib.ConvertStringToNull(ddlUserType.SelectedValue) , UDFLib.ConvertIntegerToNull(ddlCompany.SelectedValue), UDFLib.ConvertIntegerToNull(ddlFleet.SelectedValue), null, int.Parse(ddlNationality.SelectedValue)); //lblMessage.Text = "User created successfully"; lblMessage.Text = "User account has been created successfully"; hlnk1.Text = "Click here to login as " + txtUserName.Text.Trim(); lblOr.Text = "Or"; hlnk2.Text = "Go back to User List"; btnSaveUserDetails.Enabled = false; } catch (Exception ex) { lblMessage.Text = ex.Message; } }
public static DataTable Get_CTM_Requests(DataTable FleetID, DataTable Vessel_ID, string FromDate, string ToDate, string CTMStatus, string SearchText, int?PendingWithUserID, int?Page_Index, int?Page_Size, ref int is_Fetch_Count) { try { return(DAL_PB_PortageBill.Get_CTM_Requests_DL(FleetID, Vessel_ID, UDFLib.ConvertDateToNull(FromDate), UDFLib.ConvertDateToNull(ToDate), CTMStatus, SearchText, PendingWithUserID, Page_Index, Page_Size, ref is_Fetch_Count)); } catch { throw; } }
protected void onDelete(object source, CommandEventArgs e) { string[] arg = e.CommandArgument.ToString().Split(','); string Currency = UDFLib.ConvertStringToNull(arg[0]); DateTime?Curr_Date = UDFLib.ConvertDateToNull(arg[1]); int retval = objBLLExchRate.Delete_ExchangeRate(Currency, Curr_Date); //int retval = objBLLExchRate.Delete_ExchangeRate(Currency,Curr_Date, Convert.ToInt32(Session["USERID"])); BindExchRate(); }
protected void gvAbsentees_RowDataBound(object sender, GridViewRowEventArgs e) { if (txtToDate.Text != "") { if (e.Row.RowType == DataControlRowType.Header) { ((Label)e.Row.Cells[5].FindControl("lblMonth2H")).Text = UDFLib.ConvertDateToNull(txtToDate.Text).Value.ToString("MMM/yyyy", CultureInfo.InvariantCulture); ((Label)e.Row.Cells[4].FindControl("lblMonth1H")).Text = (UDFLib.ConvertDateToNull(txtToDate.Text).Value.AddMonths(-1)).ToString("MMM/yyyy", CultureInfo.InvariantCulture); ((Label)e.Row.Cells[3].FindControl("lblMonth0H")).Text = (UDFLib.ConvertDateToNull(txtToDate.Text).Value.AddMonths(-2)).ToString("MMM/yyyy", CultureInfo.InvariantCulture); } } }
/// <summary> /// to fill machinery running hours data to grid view. /// </summary> public void BindRuningHours() { try { int rowcount = ucCustomPagerItems.isCountRecord; DataSet ds = new DataSet(); string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } ds = objJobStatus.TecMachineryRunningHoursSearch(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue), UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), null, null, ViewState["RecordDisplayType"].ToString(), UDFLib.ConvertIntegerToNull(ddlFunction.SelectedValue), UDFLib.ConvertStringToNull(ddlSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[0]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[0]) , sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount, chkDisplayInheritingCounter.Checked == true ? 1 : 0); if (ViewState["RecordDisplayType"] == "H") { gvRhrs.Columns[3].Visible = false; } else { gvRhrs.Columns[3].Visible = true; } if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (ds.Tables[0].Rows.Count > 0) { gvRhrs.DataSource = ds.Tables[0]; gvRhrs.DataBind(); } else { gvRhrs.DataSource = ds.Tables[0]; gvRhrs.DataBind(); } } catch (Exception ex) { throw ex; } }