Ejemplo n.º 1
0
        /// <summary>
        /// Updates the text representation of the grades
        /// </summary>
        public void UpdateRanges()
        {
            aMaxLabel.Text = AMax.ToString(CultureInfo.CurrentCulture);
            aMinLabel.Text = AMin.ToString(CultureInfo.CurrentCulture);

            bMaxLabel.Text = BMax.ToString(CultureInfo.CurrentCulture);
            bMinLabel.Text = BMin.ToString(CultureInfo.CurrentCulture);

            cMaxLabel.Text = CMax.ToString(CultureInfo.CurrentCulture);
            cMinLabel.Text = CMin.ToString(CultureInfo.CurrentCulture);

            dMaxLabel.Text = DMax.ToString(CultureInfo.CurrentCulture);
            dMinLabel.Text = DMin.ToString(CultureInfo.CurrentCulture);

            fPointLabel.Text = FPoint.ToString(CultureInfo.CurrentCulture);
        }
Ejemplo n.º 2
0
    public void FillPortCall()
    {
        int       Port_Call_Id = UDFLib.ConvertToInteger(Request.QueryString["StatusID"].ToString());
        DataTable dt           = objPortCall.Get_PortCall_List(Port_Call_Id, UDFLib.ConvertToInteger(ddlVessel.SelectedValue));

        //if(Port_Call_Id == 0)
        //    chkAutoDate.Enabled=false;
        if (dt.Rows.Count > 0)
        {
            tr1.Visible = true;
            ViewState["ReturnPortCallID"] = Request.QueryString["StatusID"].ToString();
            char[]   delimiterChars = { ' ', ',', '.', ':', '\t' };
            string   ArrivalDate, BerthingDate, DepartureDate;
            string[] ADate, BDate, DDate;
            string   Arrhr, Arrmin, Brhr, BrMin, DHr, DMin;

            if (dt.Rows[0]["Arrival"].ToString() != "")
            {
                ArrivalDate = dt.Rows[0]["Arrival"].ToString();
                DateTime dtArr = Convert.ToDateTime(dt.Rows[0]["Arrival"].ToString());
                ADate = ArrivalDate.Split(delimiterChars);
                //This change has been done to change the date format as per user selection
                dtpArrival.Text          = UDFLib.ConvertUserDateFormat(Convert.ToString(dtArr));
                Arrhr                    = ADate[1].ToString();
                Arrmin                   = ADate[2].ToString();
                ddlArrHour.SelectedValue = Arrhr.ToString();
                ddlArrMin.SelectedValue  = Arrmin.ToString();
            }
            else
            {
                if (ViewState["dtpArrival"] != null)
                {
                    //This change has been done to change the date format as per user selection
                    dtpArrival.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(ViewState["dtpArrival"]));

                    ddlArrHour.SelectedValue = ViewState["ddlArrHour"].ToString();
                    ddlArrMin.SelectedValue  = ViewState["ddlArrMin"].ToString();
                }
            }
            if (dt.Rows[0]["Berthing"].ToString() != "")
            {
                BerthingDate = dt.Rows[0]["Berthing"].ToString();
                DateTime dtBer = Convert.ToDateTime(dt.Rows[0]["Berthing"].ToString());
                BDate = BerthingDate.Split(delimiterChars);
                //This change has been done to change the date format as per user selection
                dtpBerthing.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(dtBer));

                Brhr  = BDate[1].ToString();
                BrMin = BDate[2].ToString();
                ddlBerthingHour.SelectedValue = Brhr.ToString();
                ddlBerthingMin.SelectedValue  = BrMin.ToString();
            }
            if (dt.Rows[0]["Departure"].ToString() != "")
            {
                DepartureDate = dt.Rows[0]["Departure"].ToString();
                DateTime dtDep = Convert.ToDateTime(dt.Rows[0]["Departure"].ToString());
                DDate = DepartureDate.Split(delimiterChars);
                //This change has been done to change the date format as per user selection
                dtpDeparture.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(dtDep));
                DHr  = DDate[1].ToString();
                DMin = DDate[2].ToString();
                ddlDepHr.SelectedValue  = DHr.ToString();
                ddlDepmin.SelectedValue = DMin.ToString();
            }
            else
            {
                if (ViewState["dtpDeparture"] != null)
                {
                    //This change has been done to change the date format as per user selection
                    dtpDeparture.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(ViewState["dtpDeparture"]));

                    ddlDepHr.SelectedValue  = ViewState["ddlDepHr"].ToString();
                    ddlDepmin.SelectedValue = ViewState["ddlDepmin"].ToString();
                }
            }
            DDLPort.SelectedValue = dt.Rows[0]["Port_ID"].ToString();
            if (dt.Rows[0]["Port_ID"].ToString() == "0")
            {
                txtlocation.Text       = dt.Rows[0]["Port_Name"].ToString();
                txtlocation.Visible    = true;
                chkNewLocation.Checked = true;
                DDLPort.Visible        = false;
            }
            else
            {
                txtlocation.Visible = false;
                DDLPort.Visible     = true;
                //DDLPort.Enabled = false;
            }

            //chkNewLocation.Visible = false;
            ddlCharterAgent.SelectedValue = dt.Rows[0]["Charterers_Agent"].ToString();
            ddlOwnersAgent.SelectedValue  = dt.Rows[0]["Owners_ID"].ToString();
            int warrisk   = Convert.ToInt16(dt.Rows[0]["IsWarRisk"].ToString());
            int ShipCrane = Convert.ToInt16(dt.Rows[0]["IsShipCraneReq1"].ToString());
            if (warrisk == 1)
            {
                chkWarRisk.Checked = true;
            }
            if (ShipCrane == 1)
            {
                chkShipCrane.Checked = true;
            }
            string Port_Call_Status = Convert.ToString(dt.Rows[0]["Port_Call_Status"].ToString());
            if (Port_Call_Status == "OMITTED")
            {
                chkPortCallStatus.Checked = true;
            }
            txtPortRemark.Text = dt.Rows[0]["Port_Remarks"].ToString();


            if (dt.Rows[0]["Auto_Date"].ToString() == "Y")
            {
                chkAutoDate.Checked     = true;
                dtpArrival.Enabled      = false;
                dtpBerthing.Enabled     = false;
                dtpDeparture.Enabled    = false;
                ddlArrHour.Enabled      = false;
                ddlArrMin.Enabled       = false;
                ddlBerthingHour.Enabled = false;
                ddlBerthingMin.Enabled  = false;
                ddlDepHr.Enabled        = false;
                ddlDepmin.Enabled       = false;
            }
            else
            {
                chkAutoDate.Checked     = false;
                dtpArrival.Enabled      = true;
                dtpBerthing.Enabled     = true;
                dtpDeparture.Enabled    = true;
                ddlArrHour.Enabled      = true;
                ddlArrMin.Enabled       = true;
                ddlBerthingHour.Enabled = true;
                ddlBerthingMin.Enabled  = true;
                ddlDepHr.Enabled        = true;
                ddlDepmin.Enabled       = true;
            }
        }
    }