Ejemplo n.º 1
0
 public ActionResult SelectCrop(watershed_policy crop)
 {
     WaterShed.WaterShedservice.Service1Client sc = new WaterShed.WaterShedservice.Service1Client();
     if (sc.AddPolicy(crop))
     {
         ViewData.Add("SelectCrop", "success");
     }
     else
     {
         ViewData.Add("SelectCrop", "fail");
     }
     return(View());
 }
Ejemplo n.º 2
0
        public ActionResult ForgetPassword(User user)
        {
            // User users = DAL.AuthenticationDal.checkEmail(user);

            WaterShed.WaterShedservice.Service1Client client = new WaterShed.WaterShedservice.Service1Client();

            String mail = client.ForgetPassword(user);

            this.ViewData.Add("mail", mail);



            return(View());
        }
Ejemplo n.º 3
0
        public ActionResult Register(User user)
        {
            // ViewBag.Message = "Your contact page.";
            //user.role = "admin";
            WaterShed.WaterShedservice.Service1Client auth = new WaterShed.WaterShedservice.Service1Client();
            bool status = auth.doRegister(user);

            if (status == true)
            {
                return(RedirectToAction("Login"));
            }
            else
            {
                return(View());
            }
        }
Ejemplo n.º 4
0
 public ActionResult AddCrop(BOM.watershed_crop crop)
 {
     WaterShed.WaterShedservice.Service1Client service = new WaterShed.WaterShedservice.Service1Client();
     bool status = service.doAddCrop(crop);
     String msg = "";
     if (status)
     {
         msg = "add";
     }
     else
     {
         msg = "not";
     }
     TempData.Add("msg", msg);
     return View();
 }
Ejemplo n.º 5
0
        public ActionResult Login(User user)
        {
            ViewBag.Message = "Your contact page.";


            WaterShed.WaterShedservice.Service1Client auth = new WaterShed.WaterShedservice.Service1Client();
            User users = BOL.Authentication.Login(user) as User;

            if (null == users)
            {
                this.Response.Redirect("Login");
            }
            else
            {
                User us = Session["user"] as User;
                us.email   = users.email;
                us.Name    = users.Name;
                us.role    = users.role;
                us.uid     = users.uid;
                us.pincode = users.pincode;
                this.Session.Add("user", us);
                if (us.role.Equals("admin"))
                {
                    //this.Response.Redirect("/Home/Index");
                    return(this.RedirectToAction("AddDetail", "WaterShed"));
                }
                if (us.role.Equals("StateAgent"))
                {
                    return(this.RedirectToAction("AddVillageDetail", "WaterShed"));
                }
                if (us.role.Equals("user"))
                {
                    return(this.RedirectToAction("SelectCrop", "Account"));
                }
            }

            return(View());
        }