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();
                }
            }
        }
示例#2
0
        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();
            }
        }