/// <summary> /// Binding fleet /// </summary> public void BindFleetDLL() { try { BLL_Infra_VesselLib objVsl = new BLL_Infra_VesselLib(); DataTable FleetDT = objVsl.GetFleetList(Convert.ToInt32(Session["USERCOMPANYID"].ToString())); DDLFleet.Items.Clear(); DDLFleet.DataSource = FleetDT; DDLFleet.DataTextField = "Name"; DDLFleet.DataValueField = "code"; DDLFleet.DataBind(); ListItem li = new ListItem("--SELECT ALL--", "0"); DDLFleet.Items.Insert(0, li); } catch (Exception ex) { throw ex; } }
protected void btnClearFilter_Click(object sender, EventArgs e) { try { //txtFromDate.Text = ""; //txtToDate.Text = ""; 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())); DDLVessel.ClearSelection(); txtSatatus.Text = ""; txtTitle.Text = ""; DDLFleet.ClearSelection(); BindKitty(); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
public void BindFleetDLL() { try { BLL_Infra_VesselLib objVsl = new BLL_Infra_VesselLib(); DataTable FleetDT = objVsl.GetFleetList(Convert.ToInt32(Session["USERCOMPANYID"].ToString())); DDLFleet.DataSource = FleetDT; DDLFleet.DataTextField = "Name"; DDLFleet.DataValueField = "code"; DDLFleet.DataBind(); if (FleetDT.Rows.Count > 0) { if (Session["USERFLEETID"] != null && Session["USERFLEETID"].ToString() != "0") { DDLFleet.SelectItems(new string[] { Session["USERFLEETID"].ToString() }); } else { foreach (DataRow dr in FleetDT.Rows) { DDLFleet.SelectItems(new string[] { dr["code"].ToString() }); } } } CheckBox chAll = (CheckBox)DDLFleet.FindControl("chkSelectAll"); if (FleetDT.Rows.Count == DDLFleet.SelectedValues.Rows.Count) { chAll.Checked = true; } else { chAll.Checked = true; } Session["sFleet"] = DDLFleet.SelectedValues; } catch (Exception ex) { } }
/// <summary> /// Bind fleet /// </summary> public void BindFleetDLL() { try { BLL_Infra_VesselLib objVsl = new BLL_Infra_VesselLib(); DataTable FleetDT = objVsl.GetFleetList(Convert.ToInt32(Session["USERCOMPANYID"].ToString())); DDLFleet.Items.Clear(); DDLFleet.DataSource = FleetDT; DDLFleet.DataTextField = "Name"; DDLFleet.DataValueField = "code"; DDLFleet.DataBind(); ListItem li = new ListItem("-Select-", "0"); DDLFleet.Items.Insert(0, li); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true); } }
//string FolderPath = ""; //string[] fileName = null; protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["USERID"]) == "") { Response.Write("<center><br><br><h2><font color=gray>Session is lost. Please click on the Logout option and login again.</font></h2></center>"); Response.End(); } if (!IsPostBack) { BindFolder(); Load_DepartmentList(); BindFleetDLL(); if (!string.IsNullOrWhiteSpace(Convert.ToString(Session["USERFLEETID"]))) { DDLFleet.SelectItems(new string[] { Convert.ToString(Session["USERFLEETID"]) }); } BindVesselDDL(); } //UserAccessValidation(); }
public void FillDDL() { try { BLL_Infra_VesselLib objVsl = new BLL_Infra_VesselLib(); DataTable FleetDT = objVsl.GetFleetList(Convert.ToInt32(Session["USERCOMPANYID"].ToString())); DDLFleet.DataSource = FleetDT; DDLFleet.DataTextField = "Name"; DDLFleet.DataValueField = "code"; DDLFleet.DataBind(); DataTable dtVessel = objVsl.Get_VesselList(0, 0, Convert.ToInt32(Session["USERCOMPANYID"].ToString()), "", Convert.ToInt32(Session["USERCOMPANYID"].ToString())); DDLVessel.DataSource = dtVessel; DDLVessel.DataTextField = "Vessel_name"; DDLVessel.DataValueField = "Vessel_id"; DDLVessel.DataBind(); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
//string FolderPath = ""; //string[] fileName = null; protected void Page_Load(object sender, EventArgs e) { string FolderPath = ""; if (Convert.ToString(Session["USERID"]) == "") { Response.Write("<center><br><br><h2><font color=gray>Session is lost. Please click on the Logout option and login again.</font></h2></center>"); Response.End(); } if (Request.QueryString["Path"] == null) { Response.Write("<center><br><br><h2><font color=gray>This page is not accessible. Please click on the Logout option and login again.</font></h2></center>"); Response.End(); } if (!IsPostBack) { FolderPath = Request.QueryString["Path"].ToString(); string folderid = Request.QueryString["DocID"].ToString(); BindFolder(); Load_DepartmentList(); BindFleetDLL(); if (!string.IsNullOrWhiteSpace(Convert.ToString(Session["USERFLEETID"]))) { DDLFleet.SelectItems(new string[] { Convert.ToString(Session["USERFLEETID"]) }); } BindVesselDDL(); BindHeader(); } if (Request.Form["hdnVesionChecked"] == "true") { FolderPath = Request.Form["txtFolderName"].ToString(); hdnVesionChecked.Value = ""; string FileName = Session["FileName"].ToString(); string SourcePath = Server.MapPath("TempUpload").ToUpper() + "\\" + FileName; string DestinationPath = Server.MapPath(FolderPath); ////get the File ID by the file Name int fileID = objQMS.getFileIDByPath(FolderPath + "/" + FileName); objQMS.UpdateVersionInfoOfNewFileAdd(fileID, FileName, Convert.ToInt32(Session["USERID"]), ""); //need to create a another folder to keep the version file DataSet FileInfo = objQMS.getFileVersion(fileID); //create the version folder for the file at the first time if (FileInfo.Tables[0].Rows.Count > 0) { bool folderExists = Directory.Exists(DestinationPath + "\\" + FileInfo.Tables[0].Rows[0]["ID"].ToString()); if (!folderExists) { System.IO.Directory.CreateDirectory(DestinationPath + "\\" + FileInfo.Tables[0].Rows[0]["ID"].ToString()); } //create the version folder DestinationPath = DestinationPath + "\\" + FileInfo.Tables[0].Rows[0]["ID"].ToString() + "\\" + FileInfo.Tables[1].Rows[0]["Version"].ToString(); System.IO.Directory.CreateDirectory(DestinationPath); File.Copy(SourcePath, DestinationPath + "\\" + FileName, true); //txtRemarks.Text = ""; Response.Redirect("FileLoader.aspx?DocID=" + fileID); } } //UserAccessValidation(); }
/// <summary> /// Fill DropDownList ,Fleet,POType,AccountType,OwnerName,Urgency,DeliveryPort,ReqsnType,Vessel /// </summary> public void FillDDL() { try { BLL_Infra_VesselLib objVsl = new BLL_Infra_VesselLib(); DataTable FleetDT = objVsl.GetFleetList(Convert.ToInt32(Session["USERCOMPANYID"].ToString())); DDLFleet.DataSource = FleetDT; DDLFleet.DataTextField = "Name"; DDLFleet.DataValueField = "Code"; DDLFleet.DataBind(); DDLFleet.Items.Insert(0, new ListItem("-SELECT-", "0")); DataTable dt = BLL_PURC_Common.PURC_Get_PO_Type(UDFLib.ConvertToInteger(GetSessionUserID()), "PO_Create"); ddlPOType.DataSource = dt; ddlPOType.DataTextField = "PO_Type"; ddlPOType.DataValueField = "PO_Code"; ddlPOType.DataBind(); ddlPOType.Items.Insert(0, new ListItem("-SELECT-", "0")); DataTable dtAccountType = BLL_PURC_Common.PURC_Get_Sys_Variable(UDFLib.ConvertToInteger(GetSessionUserID()), "Account_Type"); ddlAccountType.DataSource = dtAccountType; ddlAccountType.DataTextField = "VARIABLE_NAME"; ddlAccountType.DataValueField = "VARIABLE_CODE"; ddlAccountType.DataBind(); ddlAccountType.Items.Insert(0, new ListItem("-SELECT-", "0")); DataTable dtOwnerName = BLL_PURC_Common.PURC_Get_Supplier_Type(UDFLib.ConvertToInteger(GetSessionUserID()), "OWNER"); ddlOwnerName.DataSource = dtOwnerName; ddlOwnerName.DataTextField = "Supplier_Name"; ddlOwnerName.DataValueField = "Supplier_Code"; ddlOwnerName.DataBind(); ddlOwnerName.Items.Insert(0, new ListItem("-SELECT-", "0")); DataTable dtItem = BLL_PURC_Common.PURC_Get_ItemCategory(UDFLib.ConvertToInteger(GetSessionUserID()), "UrgencyLevel"); ddlUrgency.DataTextField = "Category_Name"; ddlUrgency.DataValueField = "ID"; ddlUrgency.DataSource = dtItem; ddlUrgency.DataBind(); using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase()) { //DataTable dtPort = objTechService.LibraryGetSystemParameterList("7609", ""); DataTable dtPort = objTechService.getDeliveryPort(); ddlDeliveryPort.DataSource = dtPort; ddlDeliveryPort.DataTextField = "Port_Name"; ddlDeliveryPort.DataValueField = "Id"; ddlDeliveryPort.DataBind(); ddlDeliveryPort.Items.Insert(0, new ListItem("-SELECT-", "0")); } ddlReqsnType.Items.Insert(0, new ListItem("-SELECT-", "0")); ddlFunction.Items.Insert(0, new ListItem("-SELECT-", "0")); ddlCatalogue.Items.Insert(0, new ListItem("-SELECT-", "0")); ddlPortCall.Items.Insert(0, new ListItem("-SELECT-", "0")); DataTable dtVessel = objVsl.Get_UserVesselList_DL(0, 0, Convert.ToInt32(Session["USERCOMPANYID"].ToString()), "", Convert.ToInt32(Session["USERCOMPANYID"].ToString()), UDFLib.ConvertToInteger(GetSessionUserID())); if (DDLFleet.SelectedIndex != 0) { dtVessel.DefaultView.RowFilter = "Tech_Manager ='" + DDLFleet.SelectedItem.Text + "'"; } ddlVessel.DataSource = dtVessel; ddlVessel.DataTextField = "Vessel_name"; ddlVessel.DataValueField = "Vessel_id"; ddlVessel.DataBind(); BindPortCall(UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue)); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } finally { } }