public ActionResult Index()
        {
            HomeBL contextBL = new HomeBL();

            //ViewBag.Noticias = contextBL.getNoticias();

            /*ViewBag.Banner = contextBL.getBanners();
             * ViewBag.MiniBanner = contextBL.getMiniBanners();
             * ViewBag.EnlacesGris = contextBL.getEnlacesGris();
             * ViewBag.Eventos = contextBL.getEventos();*/
            //ViewBag.Revistas = contextBL.getRevistas();
            //ViewBag.Libros = contextBL.getLibros();

            /*ViewBag.SocialLinks = contextBL.getSocial();
             * ViewBag.EnlacesFooter = contextBL.getEnlacesFooter();
             * ViewBag.Youtube = contextBL.getYoutube();*/

            socialData.Url   = System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
            socialData.Title = ConfigurationManager.AppSettings["DefaultTitle"].ToString();
            ViewBag.Title    = ConfigurationManager.AppSettings["DefaultTitle"].ToString() + " - El " + CONSTANTES.URI_ESTUDIO;
            ViewBag.Social   = socialData;

            //RevistasBL revistasBL = new RevistasBL();

            //ViewBag.TipoRevistas = revistasBL.getTipoRevistas();
            //ViewBag.Revistas = revistasBL.getRevistasTop();

            return(View());
        }
Example #2
0
        public ActionResult SearchResults(FormCollection myCollection)
        {
            HomeBL          oHBL  = new HomeBL();
            ListingSearchVM oLSVM = oHBL.SearchListings(myCollection);

            return(View(oLSVM));
        }
        protected void initStartupVariables()
        {
            HomeBL contextBL = new HomeBL();

            ViewBag.EnlacesFooter = contextBL.getEnlacesFooter();
            this.navbar           = new Navbar();
            ViewBag.Navbar        = this.navbar;
            socialData            = new SocialDTO();
            //socialData.FbAppId = ConfigurationManager.AppSettings["FBAppID"].ToString();
            socialData.Type  = CONSTANTES.SOCIAL_DEFAULT_TYPE;
            socialData.Image = CONSTANTES.SOCIAL_DEFAULT_IMAGE;
            ViewBag.Social   = this.socialData;
            ViewBag.Title    = ConfigurationManager.AppSettings["DefaultTitle"].ToString();
        }
Example #4
0
        protected override void OnPreInit(EventArgs e)
        {
            if (MainUserInfo == null)
            {
                string UserID;
                if (Request.QueryString["Userid"] != null)
                {
                    UserID = Request.QueryString["Userid"].ToString();
                }
                else
                {
                    UserID = "0";
                }
                HomeBL  userBL = new HomeBL();
                NewUser ds     = null;
                try
                {
                    ds = userBL.GetUserDetails(Convert.ToInt32(UserID));

                    if (ds != null)
                    {
                        UserInfo userInfo1 = new UserInfo();
                        userInfo1.UserId       = ds.UserId;
                        userInfo1.RoleID       = (int)ds.RoleId;
                        userInfo1.UserName     = ds.UserName;
                        userInfo1.Area         = ds.Area;
                        userInfo1.MobileNumber = ds.MobileNumber;
                        userInfo1.HouseName    = ds.HouseName;
                        userInfo1.HouseNumber  = ds.HouseNo;
                        userInfo1.Name         = ds.Name;
                        userInfo1.Set();
                        if (userInfo1.RoleID == 2)
                        {
                            Response.Redirect("farmer.aspx", true);
                        }
                        else
                        {
                            Response.Redirect("Agriofficer.aspx", true);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
Example #5
0
        public void getMarketPrice()
        {
            HomeBL  objHomeBl = new HomeBL();
            DataSet ds        = new DataSet();

            ds = objHomeBl.GetMarketPriceDetails();
            foreach (DataRow drow in ds.Tables[0].Rows)
            {
                if (drow["produt"].ToString() == ProductPrice.Rubber.ToString())
                {
                    txtRubber.Text = drow["Price"].ToString();
                }
                else if (drow["produt"].ToString() == ProductPrice.Tapioca.ToString())
                {
                    txtTapioca.Text = drow["Price"].ToString();
                }
                else if (drow["produt"].ToString() == ProductPrice.Pepper.ToString())
                {
                    txtPepper.Text = drow["Price"].ToString();
                }
                else if (drow["produt"].ToString() == ProductPrice.Cocoa.ToString())
                {
                    txtCocoa.Text = drow["Price"].ToString();
                }
                else if (drow["produt"].ToString() == ProductPrice.payar.ToString())
                {
                    txtPayar.Text = drow["Price"].ToString();
                }
                else if (drow["produt"].ToString() == ProductPrice.paval.ToString())
                {
                    txtBitterQuard.Text = drow["Price"].ToString();
                }
                else if (drow["produt"].ToString() == ProductPrice.kovakka.ToString())
                {
                    Kovakka.Text = drow["Price"].ToString();
                }
                else if (drow["produt"].ToString() == ProductPrice.CoconutT.ToString())
                {
                    txtCoconut.Text = drow["Price"].ToString();
                }
                else if (drow["produt"].ToString() == ProductPrice.Banana.ToString())
                {
                    txtVazha.Text = drow["Price"].ToString();
                }
            }
        }
Example #6
0
        public ActionResult Index()
        {
            HomeBL homeBL = new HomeBL();

            return(View(homeBL.Initialize()));
        }
 public HomeController(HomeBL _homebl)
 {
     homebl = _homebl;
 }
Example #8
0
        public ActionResult Login(UserMasterPOCO user)
        {
            UserMasterBL   userMasterBL    = new UserMasterBL();
            HomeBL         homeBl          = new HomeBL();
            string         lsReturnMessage = "0";
            string         lsApprover      = "0"; // Added on 29th Jul 2021 @BK
            string         lsAllowSign     = "0"; // Added on 29th Jul 2021 @BK
            UserMasterPOCO lUser           = new UserMasterPOCO();

            lUser = homeBl.CheckUserLogin(user, ref lsReturnMessage);
            if (lsReturnMessage == "1")
            {
                string role = userMasterBL.GetRoleByUserId(lUser.UserId);
                if (!string.IsNullOrEmpty(role))
                {
                    System.Web.HttpContext.Current.Session["Role"] = role;
                }
                else
                {
                    return(Json(0, JsonRequestBehavior.AllowGet));
                }


                ////----------------------------------------------------------------------------------
                ///

                //_cache.Insert("VolMenuData", Server.MapPath("~/xmlMenu/" + "ALLVOLUMES.xml"));
                //_cache.Insert("ShipMenuData", Server.MapPath("~/xmlMenu/" + "ALLSHIPS1.xml"));


                ///---------------------------------------------------------------------------------
                ///



                Session["UserId"]          = lUser.UserId.ToString();
                Session["UserCode"]        = lUser.UserCode.ToString();
                Session["UserName"]        = lUser.UserName.ToString();
                Session["Email"]           = lUser.Email.ToString();
                Session["ShipId"]          = lUser.ShipId.ToString();
                Session["DashboardShipId"] = lUser.ShipId.ToString();
                Session["IsApprover"]      = lUser.IsApprover.ToString(); //Added on 29th Jul 2021 @BK
                lsApprover             = lUser.IsApprover.ToString();     //Added on 29th Jul 2021 @BK
                Session["IsAllowSign"] = lUser.IsAllowSign.ToString();    //Added on 29th Jul 2021 @BK
                lsAllowSign            = lUser.IsAllowSign.ToString();    //Added on 29th Jul 2021 @BK

                if (!string.IsNullOrEmpty(lUser.ShipName))
                {
                    Session["ShipName"] = lUser.ShipName.ToString();
                }
                else
                {
                    Session["ShipName"] = "";
                }

                if (!string.IsNullOrEmpty(lUser.VesselIMO))
                {
                    Session["VesselIMO"] = lUser.VesselIMO.ToString();
                }
                else
                {
                    Session["VesselIMO"] = "";
                }

                Session["UserType"] = lUser.UserType.ToString();
                //Session["IsAdmin"]      = lUser.IsAdmin.ToString();


                if (role == "OfficeAdmin" || role == "ShipAdmin")
                {
                    return(RedirectToAction("AdminDashboard", "Dashboard"));
                }
                else if (role == "OfficeUser")
                {
                    if (lsApprover == "1" && lsAllowSign == "0")
                    {
                        return(RedirectToAction("Index", "ApproverSign"));
                    }
                    else
                    {
                        return(RedirectToAction("UserDashboard", "Dashboard"));
                    }
                }
                else
                {
                    return(RedirectToAction("UserDashboard", "Dashboard"));
                }


                //return new RedirectToRouteResult(new RouteValueDictionary(
                //new { action = "UserDashboard", controller = "Dashboard" }));
            }
            else
            {
                return(Json(lsReturnMessage, JsonRequestBehavior.AllowGet));
            }
        }
Example #9
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            HomeBL userBL = new HomeBL();

            AgriAdviceEntity.AgricultureDetails obj = new AgriAdviceEntity.AgricultureDetails();
            obj.UserId = userInfo.UserId;
            if (txtVazha.Text == string.Empty)
            {
                obj.Banana = 0;
            }
            else
            {
                obj.Banana = Convert.ToInt32(txtVazha.Text);
            }
            if (txtCocoa.Text == string.Empty)
            {
                obj.Cocoa = 0;
            }
            else
            {
                obj.Cocoa = Convert.ToInt32(txtCocoa.Text);
            }
            if (txtCoconuttree.Text == string.Empty)
            {
                obj.CoconutTree = 0;
            }
            else
            {
                obj.CoconutTree = Convert.ToInt32(txtCoconuttree.Text);
            }
            if (txtPepper.Text == string.Empty)
            {
                obj.Pepper = 0;
            }
            else
            {
                obj.Pepper = Convert.ToInt32(txtPepper.Text);
            }
            if (txtRubber.Text == string.Empty)
            {
                obj.Rubber = 0;
            }
            else
            {
                obj.Rubber = Convert.ToInt32(txtRubber.Text);
            }
            if (txtTapioca.Text == string.Empty)
            {
                obj.Tapioca = 0;
            }
            else
            {
                obj.Tapioca = Convert.ToInt32(txtTapioca.Text);
            }
            if (txtVegetables.Text == string.Empty)
            {
                obj.Vegetables = 0;
            }
            else
            {
                obj.Vegetables = Convert.ToInt32(txtVegetables.Text);
            }
            int success = 0;

            success = userBL.SetAgricultureDetails(obj);
            if (success == -1)
            {
                lblMessage.Text      = "Agriculture details updated successfully";
                lblMessage.Visible   = true;
                lblMessage.ForeColor = System.Drawing.Color.Green;
            }
            else
            {
                lblMessage.Text      = "Agriculture details updation Failed";
                lblMessage.Visible   = true;
                lblMessage.ForeColor = System.Drawing.Color.Green;
            }
        }
Example #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         HomeBL userBL = new HomeBL();
         AgriAdviceEntity.AgricultureDetails obj = new AgriAdviceEntity.AgricultureDetails();
         obj = userBL.GetAgricultureDetails(userInfo.UserId);
         if (obj.Rubber == 0)
         {
             txtRubber.Text = "";
         }
         else
         {
             txtRubber.Text = obj.Rubber.ToString();
         }
         if (obj.Pepper == 0)
         {
             txtPepper.Text = "";
         }
         else
         {
             txtPepper.Text = obj.Pepper.ToString();
         }
         if (obj.Tapioca == 0)
         {
             txtTapioca.Text = "";
         }
         else
         {
             txtTapioca.Text = obj.Tapioca.ToString();
         }
         if (obj.Cocoa == 0)
         {
             txtCocoa.Text = "";
         }
         else
         {
             txtCocoa.Text = obj.Cocoa.ToString();
         }
         if (obj.CoconutTree == 0)
         {
             txtCoconuttree.Text = "";
         }
         else
         {
             txtCoconuttree.Text = obj.CoconutTree.ToString();
         }
         if (obj.Banana == 0)
         {
             txtVazha.Text = "";
         }
         else
         {
             txtVazha.Text = obj.Banana.ToString();
         }
         if (obj.Vegetables == 0)
         {
             txtVegetables.Text = "";
         }
         else
         {
             txtVegetables.Text = obj.Vegetables.ToString();
         }
     }
 }
Example #11
0
 public void GivenIAmOnTheExpediaHomePage()
 {
     obj = new HomeBL();
     Assert.IsTrue(obj.check_Homepage());
 }