Exemplo n.º 1
0
        private bool checkContainerStatus(bool fromSaveButton)
        {
            lblError.Text = "";
            System.Data.DataSet ds = EquipmentBLL.CheckContainerStatus(txtContainerNo.Text.Trim());
            string abbr            = string.Empty;

            try
            {
                if (ds.Tables.Count > 0)
                {
                    abbr = Convert.ToString(ds.Tables[0].Rows[0]["MoveAbbr"]);
                }
            }
            catch
            {
            }



            bool canEditable = false;

            if (abbr == string.Empty)
            {
                GeneralFunctions.RegisterAlertScript(this, "This container-number doesn't exists");
                lblError.Text = "This container-number doesn't exists or its movement id is null";
            }
            else
            {
                if (abbr.ToUpper() != "RCVE" && abbr.ToUpper() != "OFFH")
                {
                    GeneralFunctions.RegisterAlertScript(this, "Container status is not RCVE/OFFH and hence repair entry is not possible");
                }
                else
                {
                    if (!fromSaveButton)
                    {
                        GeneralFunctions.RegisterAlertScript(this, "Container status is RCVE/OFFH.");
                    }
                    canEditable = true;
                }
            }


            return(canEditable);
        }