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); } }
public void BindIndex() { 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_Search(txtCardNumber.Text != "" ? txtCardNumber.Text : null, (DataTable)Session["sVesselCode"], UDFLib.ConvertToDate(txtFromDate.Text).ToShortDateString(), UDFLib.ConvertToDate(txtToDate.Text).ToShortDateString(), ddlStatus.SelectedIndex == 0 ? null : ddlStatus.SelectedValue, sortbycoloumn, sortdirection , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } gvPhoneCardRequest.DataSource = dt; gvPhoneCardRequest.DataBind(); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
public void BindKitty() { 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_Search(txtSatatus.Text != "" ? txtSatatus.Text : null, null, txtTitle.Text != "" ? txtTitle.Text : null, null, null, null, (DataTable)Session["sVesselCode"], UDFLib.ConvertUserDateFormat(txtFromDate.Text), UDFLib.ConvertUserDateFormat(txtToDate.Text), sortbycoloumn, sortdirection , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (dt.Rows.Count > 0) { gvPhoneCardKitty.DataSource = dt; gvPhoneCardKitty.DataBind(); } } 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); } }
public static DataTable ConsumptionGetMonth(NameValueCollection nvc, ref string reportfile, ref string filename) { DataTable dt = new DataTable(); if (nvc["quotationid"] != string.Empty) { dt = BLL_PB_PhoneCard.PhoneCard_Consumption_GetCardByMonth(nvc["month"].ToString(), nvc["year"].ToString()); } reportfile = HttpContext.Current.Server.MapPath("MonthConsumptionReport.rpt"); filename = "";// HttpContext.Current.Server.MapPath("../Attachments/Purchase/OrderForm/") + dt.Rows[0]["FLDFORMNO"].ToString().Replace("/", "-") + dt.Rows[0]["FLDVENDORCODE"].ToString().Replace("/", "-") + DateTime.Now.ToString("yyyyMMdd") + ".pdf"; return(dt); }
private void BindRequestInfo(string requestid, string vesselid) { DataTable dt = BLL_PB_PhoneCard.PhoneCord_Request_Edit(int.Parse(requestid), int.Parse(vesselid)); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; lblRequestNumber.Text = dr["REQUEST_NUMBER"].ToString(); lblVesselname.Text = dr["VESSEL_NAME"].ToString(); lblRequestDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToDateTime(dr["DATE_OF_CREATION"].ToString()).ToShortDateString()); lblPortageBillDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToDateTime(dr["PBILL_DATE"].ToString()).ToShortDateString()); lblTotalRequest.Text = dr["TOTAL_REQUEST"].ToString(); lblStatus.Text = dr["REQUEST_STATUS"].ToString(); } }
protected void UpdateStatus(object source, CommandEventArgs e) { try { BLL_PB_PhoneCard.PhoneCord_Request_UpdateStatus(int.Parse(e.CommandArgument.ToString().Split(',')[0].ToString()), int.Parse(e.CommandArgument.ToString().Split(',')[1].ToString()), int.Parse(Session["USERID"].ToString())); //string js = "alert('Query Saved !!');hideModal('DivSendForApp');"; //ScriptManager.RegisterStartupScript(this, this.GetType(), "script2", js, true); string js = "alert('eChat card has been uploaded for the requested staffs !!');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script2", js, true); BindIndex(); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
protected void btnSaveEventEdit_Click(object sender, EventArgs e) { try { if (ddlCard.SelectedIndex > 0) { int res = BLL_PB_PhoneCard.PhoneCard_RequestItem_Update(int.Parse(ViewState["CREWID"].ToString()), int.Parse(ddlCard.SelectedValue), int.Parse(ViewState["vesselid"].ToString()), int.Parse(ViewState["voyageid"].ToString()), 1); string Deptmodal = String.Format("hideModal('divUploadCard',false);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "divUploadCard", Deptmodal, true); cmdHiddenSubmit_Click(null, null); } } catch (Exception ex) { } }
protected void onUpdate(object source, CommandEventArgs e) { try { DataTable dt = BLL_PB_PhoneCard.PhoneCord_RequestItem_Edit(int.Parse(e.CommandArgument.ToString())); ViewState["CREWID"] = e.CommandArgument.ToString(); txtCrewName.Text = dt.Rows[0]["STAFF_NAME"].ToString(); txtRequestUnit.Text = dt.Rows[0]["CARD_UNITS"].ToString(); ViewState["vesselid"] = dt.Rows[0]["VESSEL_ID"].ToString(); ViewState["voyageid"] = dt.Rows[0]["VOYAGEID"].ToString(); string Deptmodal = String.Format("showModal('divUploadCard',false);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "divUploadCard", Deptmodal, true); } catch (Exception ex) { } }
protected void btnSaveEventEdit_Click(object sender, EventArgs e) { try { int vesselid = int.Parse(ddlVesselAdd.SelectedValue); int res = BLL_PB_PhoneCard.PhoneCard_Kitty_Insert(int.Parse(txtCardNumber.Text), txtPin.Text, int.Parse(txtUnit.Text), txtDetail.Text, txtSubDetail.Text, "", 1, vesselid, UDFLib.ConvertIntegerToNull(SupplierList.SelectedValue)); //string js = "alert('Query Saved !!');hideModal('DivSendForApp');"; //ScriptManager.RegisterStartupScript(this, this.GetType(), "script2", js, true); string Deptmodal = String.Format("alert('Data Saved !!');hideModal('divUploadCard',false);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "divUploadCard", Deptmodal, true); BindKitty(); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
public void BindViews() { try { int rowcount = ucCustomPagerItems.isCountRecord; string requestid = ViewState["REQUESTID"].ToString(); string vesselid = ViewState["VESSELID"].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_PB_PhoneCard.PhoneCord_RequestItem_Search(int.Parse(requestid), int.Parse(vesselid), sortbycoloumn, sortdirection , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (dt.Rows.Count > 0) { gvPhoneCardRequest.DataSource = dt; gvPhoneCardRequest.DataBind(); } else { gvPhoneCardRequest.DataSource = dt; gvPhoneCardRequest.DataBind(); } } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
protected void btnSave_Click(object sender, EventArgs e) { string cardno = string.Empty; string Ucardno = string.Empty; string ecardno = string.Empty; try { if (ViewState["kittyTable"] != null) { string js = ""; int j = 0; int k = 0; DataTable dt = (DataTable)ViewState["kittyTable"]; if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { int i = BLL_PB_PhoneCard.PhoneCard_Kitty_Insert(int.Parse(dr[0].ToString()), dr[1].ToString(), int.Parse(dr[2].ToString()), dr[3].ToString(), dr[4].ToString(), Session["filename"].ToString(), 1, UDFLib.ConvertToInteger(ddlVessels.SelectedValue), UDFLib.ConvertIntegerToNull(uc_SupplierListRFQ.SelectedValue)); if (i == -1) { j = 1; cardno += dr[0].ToString() + ","; } else { k = 1; Ucardno += dr[0].ToString() + ","; } } if (j == 1 && k == 0) { js = "alert( 'Card Number " + cardno.TrimEnd(',') + " already present !!');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script2", js, true); } else if (j == 1 & k == 1) { if (!string.IsNullOrEmpty(cardno)) { js = "alert( 'Card Number " + Ucardno.TrimEnd(',') + " Uploaded !!\\nCard Number " + cardno.TrimEnd(',') + " already present !! ');"; } ScriptManager.RegisterStartupScript(this, this.GetType(), "script2", js, true); } else if (j == 0 & k == 1) { js = "alert('Kitty has been uploaded !!'); window.close();"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script2", js, true); } } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "script2", "alert('File contains no data')", true); } } } catch { ScriptManager.RegisterStartupScript(this, this.GetType(), "script2", "alert('Card Number " + ecardno.TrimEnd(',') + " is invalid')", true); } }