Ejemplo n.º 1
0
        public ActionResult Settings()
        {
            WarehouseBusinessLayer wbl = new WarehouseBusinessLayer();
            DataSet ds = new DataSet();

            ds = wbl.getWarehouseDetails(Convert.ToInt32(Session["UserID"]));

            return(View(ds));
        }
Ejemplo n.º 2
0
        public ActionResult LoggedIn()
        {
            if (Session["UserID"] != null)
            {
                int    id = Convert.ToInt32(Session["UserID"]);
                String ss;
                WarehouseBusinessLayer warehouseBL = new WarehouseBusinessLayer();
                Byte[]  dataInBytes        = warehouseBL.getWarehouse(id);
                Boolean value              = warehouseBL.getWarehouseAttr(id);
                WarehouseBusinessLayer wbl = new WarehouseBusinessLayer();

                DataSet ds           = wbl.getWarehouseDetails(id);
                DataRow dr           = ds.Tables[0].Rows[0];
                string  imageDataURL = "";
                if (dr["warehouseLogo"].ToString() != "")
                {
                    imageDataURL = string.Format("data:image;base64,{0}", dr["warehouseLogo"].ToString());
                }
                else
                {
                    imageDataURL = "/images/logo.png";
                }

                Session["logo"] = imageDataURL;


                try
                {
                    ss = System.Text.Encoding.UTF8.GetString(dataInBytes);
                }
                catch (Exception ex)
                {
                    if (value)
                    {
                        ss = "";
                    }
                    else
                    {
                        ss = null;
                    }
                }
                ViewBag.HtmlStr = ss;

                return(View());
            }
            else
            {
                return(RedirectToAction("Login"));
            }
        }
Ejemplo n.º 3
0
        public JsonResult GetAllUser()
        {
            try
            {
                List <WarehouseBL> allUser = new List <WarehouseBL>();

                WarehouseBusinessLayer wbl = new WarehouseBusinessLayer();
                DataSet     ds             = wbl.getWarehouseDetails(Convert.ToInt32(Session["UserID"]));
                DataRow     dr             = ds.Tables[0].Rows[0];
                WarehouseBL w = new WarehouseBL();
                w.scaledShelfLength = dr["scaledShelfLength"].ToString();
                w.scaledShelfWidth  = dr["scaledShelfWidth"].ToString();

                allUser.Add(w);

                return(new JsonResult {
                    Data = allUser, JsonRequestBehavior = JsonRequestBehavior.AllowGet
                });
            }
            catch (Exception ex)
            {
                return(null);
            }
        }