private void PopulateLine() { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); DataSet ds = dbinteract.GetNVOCCLine(-1, string.Empty); ddlLine.DataValueField = "pk_NVOCCID"; ddlLine.DataTextField = "NVOCCName"; ddlLine.DataSource = ds; ddlLine.DataBind(); ddlLine.Items.Insert(0, new ListItem("All", "0")); }
protected void Page_Load(object sender, EventArgs e) { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); if (!IsPostBack) { GeneralFunctions.PopulateDropDownList(ddlLine, EMS.BLL.EquipmentBLL.DDLGetLine()); GeneralFunctions.PopulateDropDownList(ddlVessel, dbinteract.PopulateDDLDS("trnVessel", "pk_VesselID", "VesselName"), true); GeneralFunctions.PopulateDropDownList(ddlLoc, dbinteract.PopulateDDLDS("DSR.dbo.mstLocation", "pk_LocID", "LocName", true), true); GenerateReport(); } }
protected void ddlLocation_SelectedIndexChanged(object sender, EventArgs e) { ListItem Li = null; ddlEmptyYard.Items.Clear(); BLL.DBInteraction dbinteract = new BLL.DBInteraction(); GeneralFunctions.PopulateDropDownList(ddlEmptyYard, dbinteract.PopulateDDLDS("dbo.mstAddress", "fk_AddressID", "AddrName", "Where (AddrActive=1 and AddrType='3' and fk_LocationID=" + ddlLocation.SelectedValue, true)); //Li = new ListItem("SELECT", "0"); //ddlBookingParty.Items.Insert(0, Li); }
private void LoadData(string VoyageId) { int intVoyageId = 0; if (VoyageId == "" || !Int32.TryParse(VoyageId, out intVoyageId)) { return; } BLL.DBInteraction dbinteract = new BLL.DBInteraction(); System.Data.DataSet ds = dbinteract.GetVoyage(Convert.ToInt32(VoyageId), "a", "", "", "", 0); if (!ReferenceEquals(ds, null) && ds.Tables[0].Rows.Count > 0) { ddlLoc.SelectedValue = ds.Tables[0].Rows[0]["pk_LocID"].ToString(); GeneralFunctions.PopulateDropDownList(ddlTerminalID, dbinteract.PopulateDDLDS("mstTerminal", "pk_TerminalID", "TerminalName] + '-' + [terminal", "Where fk_LocationID=" + ddlLoc.SelectedValue)); ddlTerminalID.SelectedValue = ds.Tables[0].Rows[0]["fl_TerminalID"].ToString(); txtAltLGNo.Text = ds.Tables[0].Rows[0]["AltLGNo"].ToString(); txtCargoDesc.Text = ds.Tables[0].Rows[0]["CargoDesc"].ToString(); txtExcRate.Text = ds.Tables[0].Rows[0]["ImpXChangeRate"].ToString(); txtIGMNo.Text = ds.Tables[0].Rows[0]["IGMNo"].ToString(); //txtCallSign.Text = ds.Tables[0].Rows[0]["CallSign"].ToString(); txtLGNo.Text = ds.Tables[0].Rows[0]["LGNo"].ToString(); txtLightHouse.Text = ds.Tables[0].Rows[0]["LightHouseDue"].ToString(); txtMotherDaughter.Text = ds.Tables[0].Rows[0]["MotherDaughterDtl"].ToString(); txtPCCNo.Text = ds.Tables[0].Rows[0]["PCCNo"].ToString(); txtTime.Text = ds.Tables[0].Rows[0]["ETATime"].ToString(); txtTotLine.Text = ds.Tables[0].Rows[0]["TotalLines"].ToString(); txtVCN.Text = ds.Tables[0].Rows[0]["VCN"].ToString(); ddlVessel.SelectedValue = ds.Tables[0].Rows[0]["fk_VesselID"].ToString(); txtVIA.Text = ds.Tables[0].Rows[0]["VIANo"].ToString(); txtVoyageNo.Text = ds.Tables[0].Rows[0]["VoyageNo"].ToString(); ddlCrewEffList.SelectedValue = ds.Tables[0].Rows[0]["CrewEffectList"].ToString(); ddlCrewList.SelectedValue = ds.Tables[0].Rows[0]["CrewList"].ToString(); ddlMaritime.SelectedValue = ds.Tables[0].Rows[0]["MaritimeList"].ToString(); ddlPessengerList.SelectedValue = ds.Tables[0].Rows[0]["PassengerList"].ToString(); ddlSameButton.SelectedValue = ds.Tables[0].Rows[0]["SameButtonCargo"].ToString(); ddlShipStoreSubmitted.SelectedValue = ds.Tables[0].Rows[0]["ShipStoreSubmitted"].ToString(); ddlTerminalID.SelectedValue = ds.Tables[0].Rows[0]["fl_TerminalID"].ToString(); txtdtETA.Text = ds.Tables[0].Rows[0]["ETADate"].ToString().Split(' ')[0]; txtdtLand.Text = ds.Tables[0].Rows[0]["AddLandingDate"].ToString().Split(' ')[0]; txtDtIGM.Text = ds.Tables[0].Rows[0]["IGMDate"].ToString().Split(' ')[0]; txtdtLand.Text = ds.Tables[0].Rows[0]["LandingDate"].ToString().Split(' ')[0]; hdnLandingDT.Value = ds.Tables[0].Rows[0]["LandingDate"].ToString().Split(' ')[0]; //Rajen hdnOldLandingDT.Value = ds.Tables[0].Rows[0]["LandingDate"].ToString().Split(' ')[0]; txtdtPCC.Text = ds.Tables[0].Rows[0]["PCCDate"].ToString().Split(' ')[0]; //txtdtAddLand.Text = ds.Tables[0].Rows[0]["__"].ToString(); ((TextBox)AutoCompletepPort1.FindControl("txtPort")).Text = ds.Tables[0].Rows[0]["lastport"].ToString(); ((TextBox)AutoCompletepPort2.FindControl("txtPort")).Text = ds.Tables[0].Rows[0]["lastport1"].ToString(); ((TextBox)AutoCompletepPort3.FindControl("txtPort")).Text = ds.Tables[0].Rows[0]["lastport2"].ToString(); ((TextBox)AutoCompletepPort4.FindControl("txtPort")).Text = ds.Tables[0].Rows[0]["portDischarge"].ToString(); } }
private void PopulateLine() { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); DataSet ds = dbinteract.GetNVOCCLine(-1, string.Empty); ddlLine.DataValueField = "pk_NVOCCID"; ddlLine.DataTextField = "NVOCCName"; ddlLine.DataSource = ds; ddlLine.DataBind(); ddlLine.Items.Insert(0, new ListItem(Constants.DROPDOWNLIST_DEFAULT_TEXT, Constants.DROPDOWNLIST_DEFAULT_VALUE)); }
private void PopulateLine() { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); DataSet ds = dbinteract.GetFwdLine(); ddlLine.DataValueField = "pk_FlineID"; ddlLine.DataTextField = "LineName"; ddlLine.DataSource = ds; ddlLine.DataBind(); //ddlLine.Items.Insert(0, new ListItem(Constants.DROPDOWNLIST_DEFAULT_TEXT, Constants.DROPDOWNLIST_DEFAULT_VALUE)); ddlLine.Items.Insert(0, new ListItem(Constants.DROPDOWNLIST_ALL_TEXT, Constants.DROPDOWNLIST_DEFAULT_VALUE)); }
private void PopulateServices(int LineID) { //List<IService> lstService = new ServiceBLL() //ServiceEntity oService = (ServiceEntity)ServiceBLL.GetServiceWithLine(LineID); BLL.DBInteraction dbinteract = new BLL.DBInteraction(); DataSet ds = dbinteract.GetServiceForLine(LineID); ddlServices.DataValueField = "fk_ServiceNameID"; ddlServices.DataTextField = "Servicename"; ddlServices.DataSource = ds; ddlServices.DataBind(); ddlServices.Items.Insert(0, new ListItem(Constants.DROPDOWNLIST_ALL_TEXT, Constants.DROPDOWNLIST_DEFAULT_VALUE)); }
protected void Page_Load(object sender, EventArgs e) { RetriveParameters(); CheckUserAccess(); BLL.DBInteraction dbinteract = new BLL.DBInteraction(); if (!IsPostBack) { GeneralFunctions.PopulateDropDownList(ddlLine, EMS.BLL.EquipmentBLL.DDLGetLine()); GeneralFunctions.PopulateDropDownList(ddlLoc, dbinteract.PopulateDDLDS("DSR.dbo.mstLocation", "pk_LocID", "LocAbbr", true), true); //GeneralFunctions.PopulateDropDownList(ddlStatus, EMS.BLL.EquipmentBLL.DDLGetStatus()); //GeneralFunctions.PopulateDropDownList(ddlContainerType, EMS.BLL.EquipmentBLL.DDLGetContainerType()); ddlEmptyYard.Enabled = false; } }
private void LandingDateCheck(BLL.DBInteraction dbinteract, string VoyageId) { Decimal ERate; if (VoyageId != "-1") { if (txtdtLand.Text.Trim() != "") { ERate = dbinteract.GetExchnageRate(Convert.ToDateTime(txtdtLand.Text)); //txtExcRate.Text = hdntxtExcRate.Value = dbinteract.GetExchnageRate(Convert.ToDateTime(txtdtLand.Text)).ToString(); trLandDate.Style.Add("display", " "); } else { trLandDate.Style.Add("display", "none"); ERate = dbinteract.GetExchnageRate(DateTime.Today); } if (decimal.Parse(txtExcRate.Text) < ERate) { string msg; msg = "Rate should be Greater than Today's EXchange Rate "; { GeneralFunctions.RegisterAlertScript(this, msg); return; } } } else { trLandDate.Style.Add("display", "none"); txtExcRate.Text = hdntxtExcRate.Value = dbinteract.GetExchnageRate(DateTime.Today).ToString(); txtdtLand.ReadOnly = true; } if (VoyageId == "-1") { int cnt = EMS.BLL.VoyageBLL.IfExistInBL(ddlVessel.SelectedIndex > 0 ? Convert.ToInt32(ddlVessel.SelectedValue) : 0, Convert.ToInt32(VoyageId)).Rows.Count; if (cnt <= 0) { txtdtLand.ReadOnly = true; txtdtLand.Enabled = false; dtLand_.Enabled = false; txtdtLand.Style.Add("background-color", "#E6E6E6"); } } }
private void LoadData(string SortExp, string direction) { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); int VesselPrefix = Convert.ToInt32(ddlVesselPrefix.SelectedValue); string VesselName = string.IsNullOrEmpty(txtVesselName.Text) ? "" : txtVesselName.Text.Trim(); int vesselFlag = dbinteract.GetId("Country", ((TextBox)AutoCompleteCountry1.FindControl("txtCountry")).Text); // int countryId=Convert.ToInt32(ddlLocation.SelectedValue); lblErrorMsg.Text = ""; if (!ReferenceEquals(Session[Constants.SESSION_SEARCH_CRITERIA], null)) { SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA]; if (!ReferenceEquals(searchCriteria, null)) { BuildSearchCriteria(searchCriteria); gvwLoc.PageIndex = searchCriteria.PageIndex; if (searchCriteria.PageSize > 0) { gvwLoc.PageSize = searchCriteria.PageSize; } try { System.Data.DataSet ds = dbinteract.GetVessel(-1, VesselPrefix, VesselName, vesselFlag); System.Data.DataView dv = new System.Data.DataView(ds.Tables[0]); if (!string.IsNullOrEmpty(SortExp) && !string.IsNullOrEmpty(direction) && SortExp != "Location") { dv.Sort = SortExp + " " + direction; } gvwLoc.DataSource = dv; } catch (Exception ex) { gvwLoc.DataSource = null; lblErrorMsg.Text = "Error Occured.Please try again."; } gvwLoc.DataBind(); } } }
void fillAllDropdown() { ListItem Li = null; BLL.DBInteraction dbinteract = new BLL.DBInteraction(); #region Location // PopulateDropDown((int)Enums.DropDownPopulationFor.Location, ddlLocation, 0); Li = new ListItem("SELECT", "0"); ddlLocation.Items.Insert(0, Li); //Li = new ListItem("ALL", "-1"); //ddlLocation.Items.Insert(1, Li); #endregion #region Line PopulateDropDown((int)Enums.DropDownPopulationFor.Line, ddlNvocc, 0); Li = new ListItem("SELECT", "0"); ddlNvocc.Items.Insert(0, Li); #endregion #region Party Master ////Li = new ListItem("ALL", "-1"); ////GeneralFunctions.PopulateDropDownList(ddlBookingParty, dbinteract.PopulateDDLDS("DSR.dbo.mstCustomer", "pk_CustID", "CustName", true), false); //GeneralFunctions.PopulateDropDownList(ddlBookingParty, dbinteract.PopulateDDLDS("dsr.dbo.mstCustomer", "pk_CustID", "CustName", "Where Active='Y' and (CorporateorLocal='C' OR fk_LocID=" + ddlLocation.SelectedValue, true), false); ////PopulateDropDown((int)Enums.DropDownPopulationFor.ExpBookingParty, ddlBookingParty, 0); ////ddlBookingParty.Items.Insert(0, Li); #endregion #region ContainerType //GridViewRow cntrtypes = gvContainer.HeaderRow; ////GridViewRow item = (GridViewRow)((DropDownList)sender).NamingContainer; //DropDownList ddlCntrType = (DropDownList)cntrtypes.FindControl("ddlCntrType"); GeneralFunctions.PopulateDropDownList(ddlCntrType, dbinteract.PopulateDDLDS("mstContainerType", "pk_ContainerTypeID", "ContainerAbbr")); ////Li = new ListItem("ALL", "-1"); ////PopulateDropDown((int)Enums.DropDownPopulationFor.Services, ddlService, 0); ////ddlService.Items.Insert(0, Li); #endregion }
private void LoadData(string SortExp, string direction) { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); //int VesselPrefix = Convert.ToInt32(ddlVesselPrefix.SelectedValue); string Location = string.IsNullOrEmpty(TxtLocation.Text) ? "" : TxtLocation.Text.Trim(); string LineName = string.IsNullOrEmpty(txtLine.Text) ? "" : txtLine.Text.Trim(); //int vesselFlag = // int countryId=Convert.ToInt32(ddlLocation.SelectedValue); lblErrorMsg.Text = ""; if (!ReferenceEquals(Session[Constants.SESSION_SEARCH_CRITERIA], null)) { SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA]; if (!ReferenceEquals(searchCriteria, null)) { BuildSearchCriteria(searchCriteria); gvwLoc.PageIndex = searchCriteria.PageIndex; if (searchCriteria.PageSize > 0) { gvwLoc.PageSize = searchCriteria.PageSize; } try { //System.Data.DataSet ds = dbinteract.GetFreeDays(-1, Location, LineName, searchCriteria); //System.Data.DataView dv = new System.Data.DataView(ds.Tables[0]); //if (!string.IsNullOrEmpty(SortExp) && !string.IsNullOrEmpty(direction) && SortExp != "Location") // dv.Sort = SortExp + " " + direction; //gvwLoc.DataSource = dv; gvwLoc.DataSource = dbinteract.GetFreeDays(-1, Location, LineName, searchCriteria); gvwLoc.DataBind(); } catch (Exception ex) { gvwLoc.DataSource = null; lblErrorMsg.Text = "Error Occured.Please try again."; } gvwLoc.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { RetriveParameters(); BLL.DBInteraction dbinteract = new BLL.DBInteraction(); if (!IsPostBack) { GeneralFunctions.PopulateDropDownList(ddlLine, EMS.BLL.EquipmentBLL.DDLGetLine()); GeneralFunctions.PopulateDropDownList(ddlVessel, dbinteract.PopulateDDLDS("trnVessel", "pk_VesselID", "VesselName"), true); GeneralFunctions.PopulateDropDownList(ddlLoc, dbinteract.PopulateDDLDS("DSR.dbo.mstLocation", "pk_LocID", "LocName", true), true); if (_LocationSpecific) { ddlLoc.SelectedValue = Convert.ToString(_userLocation); ddlLoc.Enabled = false; } // GenerateReport(); } }
private void SaveData(string ServTaxId) { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); bool isedit = FreeLinkID != "-1" ? true : false; int result = dbinteract.AddEditFreeDays(_userId, Convert.ToInt32(FreeLinkID), Convert.ToInt32(txtFreeDays.Text), Convert.ToInt32(ddlLoc.SelectedValue), Convert.ToInt32(ddlLine.SelectedValue), isedit); if (result > 0) { Response.Redirect("~/MasterModule/ManageFreeDays.aspx"); } else { GeneralFunctions.RegisterAlertScript(this, "Error Occured"); } }
private void SaveData(string NVOCCId) { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); bool isedit = NVOCCId != "-1" ? true : false; if (!isedit) { if (!dbinteract.IsUnique("mstNVOCC", "NVOCCName", txtLineName.Text.Trim())) { GeneralFunctions.RegisterAlertScript(this, "Line Name must be unique. The given name has already been used for another Line. Please try with another one."); return; } } if (fuLogo.HasFile) { hdnLogo.Value = "~/MasterModule/Image/" + fuLogo.GetImageFileName(); fuLogo.PostedFile.SaveAs(Server.MapPath(hdnLogo.Value)); } else { hdnLogo.Value = ""; } decimal impComm = 0; decimal rBuffer = 0; decimal.TryParse(txtImpCommsn.Text, out impComm); decimal.TryParse(txtRBuffer.Text, out rBuffer); decimal expCommsn = 0; decimal.TryParse(txtExportCommission.Text, out expCommsn); char ExpBook = ddlExpBook.SelectedValue == "y"?'1':'0'; int result = dbinteract.AddEditLine(_userId, Convert.ToInt32(NVOCCId), txtLineName.Text.Trim(), string.IsNullOrEmpty(txtFreeDays.Text) ? -1 : Convert.ToInt32(txtFreeDays.Text), txtContact.Text, impComm, expCommsn, ExpBook, rBuffer, hdnLogo.Value, isedit); if (result > 0) { Response.Redirect("~/MasterModule/ManageLine.aspx"); } else { GeneralFunctions.RegisterAlertScript(this, "Error Occured"); } }
private void LoadData(string SortExp, string direction) { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); string voyageType = ddlVoyageType.SelectedValue; string VesselName = string.IsNullOrEmpty(txtVesselName.Text) ? "" : txtVesselName.Text.Trim(); string voyageNo = string.IsNullOrEmpty(txtVoyageNo.Text) ? "" : txtVoyageNo.Text.Trim(); //string igmNo = string.IsNullOrEmpty(txtIGMNo.Text) ? "" : txtIGMNo.Text.Trim(); lblErrorMsg.Text = ""; if (!ReferenceEquals(Session[Constants.SESSION_SEARCH_CRITERIA], null)) { SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA]; if (!ReferenceEquals(searchCriteria, null)) { BuildSearchCriteria(searchCriteria); gvwLoc.PageIndex = searchCriteria.PageIndex; if (searchCriteria.PageSize > 0) { gvwLoc.PageSize = searchCriteria.PageSize; } try { System.Data.DataSet ds = dbinteract.GetMLVoyage(-1, voyageType, VesselName, voyageNo); System.Data.DataView dv = new System.Data.DataView(ds.Tables[0]); if (!string.IsNullOrEmpty(SortExp) && !string.IsNullOrEmpty(direction) && SortExp != "Location") { dv.Sort = SortExp + " " + direction; } gvwLoc.DataSource = dv; } catch (Exception ex) { gvwLoc.DataSource = null; lblErrorMsg.Text = "Error Occured.Please try again."; } gvwLoc.DataBind(); } } }
private void LoadData(string SortExp, string direction) { string portCode = string.IsNullOrEmpty(txtPortCode.Text) ? "" : txtPortCode.Text.Trim(); string portname = string.IsNullOrEmpty(txtPortName.Text) ? "" : txtPortName.Text.Trim(); lblErrorMsg.Text = ""; if (!ReferenceEquals(Session[Constants.SESSION_SEARCH_CRITERIA], null)) { SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA]; if (!ReferenceEquals(searchCriteria, null)) { BuildSearchCriteria(searchCriteria); gvwLoc.PageIndex = searchCriteria.PageIndex; if (searchCriteria.PageSize > 0) { gvwLoc.PageSize = searchCriteria.PageSize; } BLL.DBInteraction dbinteract = new BLL.DBInteraction(); try { System.Data.DataSet ds = dbinteract.GetPort(-1, portCode, portname); System.Data.DataView dv = new System.Data.DataView(ds.Tables[0]); if (!string.IsNullOrEmpty(SortExp) && !string.IsNullOrEmpty(direction)) { dv.Sort = SortExp + " " + direction; } gvwLoc.DataSource = dv; } catch (Exception ex) { gvwLoc.DataSource = null; lblErrorMsg.Text = "Error Occured.Please try again."; } gvwLoc.DataBind(); } } }
private void LoadData(string NVOCCId) { ClearText(); SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA]; int intNVOCCId = 0; if (NVOCCId == "" || !Int32.TryParse(NVOCCId, out intNVOCCId)) { return; } BLL.DBInteraction dbinteract = new BLL.DBInteraction(); System.Data.DataTable dt = dbinteract.GetSlotOperator(Convert.ToInt32(NVOCCId), "", searchCriteria); if (!ReferenceEquals(dt, null) && dt.Rows.Count > 0) { txtSlotOperatorName.Text = dt.Rows[0]["SlotOperatorName"].ToString(); } }
private void LoadData(string VoyageId) { int intVoyageId = 0; if (VoyageId == "" || !Int32.TryParse(VoyageId, out intVoyageId)) { return; } BLL.DBInteraction dbinteract = new BLL.DBInteraction(); System.Data.DataSet ds = dbinteract.GetMLVoyage(Convert.ToInt32(VoyageId), "a", "", ""); if (!ReferenceEquals(ds, null) && ds.Tables[0].Rows.Count > 0) { ddlVessel.SelectedValue = ds.Tables[0].Rows[0]["fk_VesselID"].ToString(); txtVoyageNo.Text = ds.Tables[0].Rows[0]["MLVoyageNo"].ToString(); //txtdtActivity.Text = ds.Tables[0].Rows[0]["ActivityDate"].ToString(); //((TextBox)AutoCompletepPort4.FindControl("txtPort")).Text = ds.Tables[0].Rows[0]["lastport"].ToString(); } }
private void LoadData(string countryID) { ClearText(); int intCountryId = 0; if (countryID == "" || !Int32.TryParse(countryID, out intCountryId)) { return; } BLL.DBInteraction dbinteract = new BLL.DBInteraction(); System.Data.DataSet ds = dbinteract.GetCountry(Convert.ToInt32(countryID), "", "");//country if (!ReferenceEquals(ds, null) && ds.Tables[0].Rows.Count > 0) { txtCountryName.Text = ds.Tables[0].Rows[0]["CountryName"].ToString(); txtAbbr.Text = ds.Tables[0].Rows[0]["CountryAbbr"].ToString(); txtGMT.Text = ds.Tables[0].Rows[0]["GMT"].ToString(); txtISD.Text = ds.Tables[0].Rows[0]["ISDCode"].ToString(); txtSector.Text = ds.Tables[0].Rows[0]["Sector"].ToString(); } }
private void SaveData(string ServTaxId) { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); DateTime maxDate = Convert.ToDateTime(GeneralFunctions.DecryptQueryString(Request.QueryString["dt"])); if (ServTaxId == "-1") { txtStDate.Text = DatePicker1.dt.ToShortDateString(); if (DatePicker1.dt.CompareTo(maxDate) < 0) { GeneralFunctions.RegisterAlertScript(this, "Start Date must be greater than: " + maxDate.ToShortDateString()); return; } } else { if (dbinteract.InvoiceDateCheck(Convert.ToDateTime(txtStDate.Text)) > 0) { GeneralFunctions.RegisterAlertScript(this, "This Date has been already used for Invoice. It can not be edited"); return; } } bool isedit = ServTaxId != "-1" ? true : false; int result = dbinteract.AddEditSTax(_userId, Convert.ToInt32(ServTaxId), Convert.ToDateTime(txtStDate.Text), ExtentionClass.TryParseBlankAsZero(txtAddiCess.Text), ExtentionClass.TryParseBlankAsZero(txtCess.Text), ExtentionClass.TryParseBlankAsZero(txtTax.Text), ddlStatus.SelectedIndex == 0 ? true : false, isedit); if (result > 0) { Response.Redirect("~/MasterModule/ManageServTax.aspx"); } else { GeneralFunctions.RegisterAlertScript(this, "Error Occured"); } }
private void LoadData(string portId) { ClearText(); int intportId = 0; if (portId == "" || !Int32.TryParse(portId, out intportId)) { return; } BLL.DBInteraction dbinteract = new BLL.DBInteraction(); System.Data.DataSet ds = dbinteract.GetPort(Convert.ToInt32(portId), "", ""); if (!ReferenceEquals(ds, null) && ds.Tables[0].Rows.Count > 0) { txtPortName.Text = ds.Tables[0].Rows[0]["PortName"].ToString(); txtPortCode.Text = ds.Tables[0].Rows[0]["PortCode"].ToString(); ddlICD.SelectedIndex = Convert.ToInt32(ds.Tables[0].Rows[0]["ICDIndicator"]); txtPortAddressee.Text = ds.Tables[0].Rows[0]["PortAddressee"].ToString(); txtAdd1.Text = ds.Tables[0].Rows[0]["Address2"].ToString(); txtAdd2.Text = ds.Tables[0].Rows[0]["Address3"].ToString(); txtExportPort.Text = ds.Tables[0].Rows[0]["ExportPort"].ToString(); } }
private void LoadData(string FreeLinkID) { ClearText(); SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA]; BLL.DBInteraction dbinteract = new BLL.DBInteraction(); int intServTaxId = 0; if (FreeLinkID == "" || !Int32.TryParse(FreeLinkID, out intServTaxId)) { return; } System.Data.DataSet ds = dbinteract.GetFreeDays(FreeLinkID.ToInt(), "", "", searchCriteria); if (!ReferenceEquals(ds, null) && ds.Tables[0].Rows.Count > 0) { txtFreeDays.Text = ds.Tables[0].Rows[0]["DefaultFreeDays"].ToString(); ddlLoc.SelectedValue = ds.Tables[0].Rows[0]["fk_LocationID"].ToString(); ddlLine.SelectedValue = ds.Tables[0].Rows[0]["fk_NVOCCID"].ToString(); //ddlStatus.SelectedIndex = Convert.ToString(ds.Tables[0].Rows[0]["LinkStatus"]) == "Active" ? 1 : 0; } }
private void SaveCountry(string countryId) { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); bool isedit = countryId != "-1" ? true : false; bool s = dbinteract.IsUnique("mstCountry", "CountryAbbr", txtAbbr.Text.Trim()); if (!dbinteract.IsUnique("mstCountry", "CountryAbbr", txtAbbr.Text.Trim()) && !isedit) { GeneralFunctions.RegisterAlertScript(this, "Country Abbr Must Be unique"); return; } int result = dbinteract.AddEditCountry(_userId, Convert.ToInt32(countryId), txtCountryName.Text.Trim().ToUpper(), txtAbbr.Text.Trim().ToUpper(), txtGMT.Text.ToUpper(), txtISD.Text.ToUpper(), txtSector.Text.ToUpper(), isedit); if (result > 0) { Response.Redirect("~/MasterModule/ManageCountry.aspx"); } else { GeneralFunctions.RegisterAlertScript(this, "Error Occured"); } }
private void SaveData(string VesselId) { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); bool isedit = VesselId != "-1" ? true : false; if (!isedit) { // if (dbinteract.GetPort(-1, txtPortCode.Text.Trim(), "").Tables[0].Rows.Count > 0) if (!dbinteract.IsUnique("trnVessel", "VesselName", txtVesselName.Text.Trim())) { GeneralFunctions.RegisterAlertScript(this, "Vessel Name must be unique. Please try with another one."); return; } } Entity.Vessel vessel = new Entity.Vessel(); vessel.VesselID = Convert.ToInt32(VesselId); vessel.AgentCode = txtAgentCode.Text.ToUpper(); //vessel.CallSign = txtCallSign.Text; vessel.IMONumber = txtIMO.Text.ToUpper(); //string port = ((TextBox)AutoCompletepPort1.FindControl("txtPort")).Text; //port = port.Contains(',') && port.Split(',').Length >= 1 ? port.Split(',')[1].Trim() : ""; //vessel.LastPortCalled = dbinteract.GetId("Port", port); vessel.MasterName = txtMasterCode.Text.ToUpper(); vessel.PANNo = txtPan.Text.ToUpper(); vessel.ShippingLineCode = txtShipLineCode.Text.ToUpper(); vessel.VesselFlag = dbinteract.GetId("Country", ((TextBox)AutoCompleteCountry1.FindControl("txtCountry")).Text); vessel.VesselName = txtVesselName.Text.ToUpper(); vessel.VesselPrefix = Convert.ToInt32(ddlVesselPrefix.SelectedValue); vessel.CallSign = TxtCallSign.Text.ToUpper(); vessel.VesselAbbr = txtVesselAbbr.Text.ToUpper(); //if (vessel.LastPortCalled == 0) //{ // GeneralFunctions.RegisterAlertScript(this, "Last_Port_Called is Invalid. Please rectify."); // return; //} if (vessel.VesselFlag == 0) { GeneralFunctions.RegisterAlertScript(this, "Vessel_Flag is Invalid. Please rectify."); return; } else if (ddlVesselPrefix.SelectedValue == "0") { GeneralFunctions.RegisterAlertScript(this, "Please Select a vessel prefix first"); return; } int result = dbinteract.AddEditVessel(_userId, isedit, vessel); if (result > 0) { Response.Redirect("~/MasterModule/ManageVessel.aspx"); } else { GeneralFunctions.RegisterAlertScript(this, "Error Occured"); } }
private void LoadShip_Tax(int _userId, BLL.DBInteraction dbinteract) { System.Data.DataSet ds = dbinteract.GetShipLine_Tax(_userId); txtPan.Text = ds.Tables[0].Rows[0]["PANNo"].ToString(); txtShipLineCode.Text = ds.Tables[0].Rows[0]["ShippingLineCode"].ToString(); }