// GET: Home
        public ViewResult Index()  //To display employee details
        {
            IEnumerable <Employee> employees = Repositary.GetEmployee();

            ViewData["Employees"] = employees;
            return(View());
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Repositary        r            = new Repositary();
            List <Product>    L            = r.GetData();
            List <BrandItems> listofbrands = r.GetBrand();
            int itemId = Convert.ToInt32(Request.QueryString["id"].ToString());

            foreach (Product P in L)
            {
                if (P.Id == itemId)
                {
                    Image1.ImageUrl = "~//" + P.URL;
                    Label1.Text     = P.Name;
                    Label2.Text     = P.Price.ToString();
                    Label3.Text     = P.Description;
                    foreach (BrandItems B in listofbrands)
                    {
                        if (P.Bid == B.BrandId)
                        {
                            Label4.Text = B.BrandName;
                        }
                    }
                }
            }
        }
        // GET: ReviewSchedulerController
        public ActionResult Index()
        {
            IEnumerable <Employee> employees = Repositary.GetEmployee();

            ViewData["Employees"] = employees;
            return(View());
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Repositary obj = new Repositary();

            id = Convert.ToInt32(Request.QueryString["id"].ToString());
            //Repositary obj=new Repositary();
            if (!IsPostBack)
            {
                List <Product> L = obj.GetData();
                foreach (Product P in L)
                {
                    if (P.Id == id)
                    {
                        Image2.ImageUrl = "~//" + P.URL;
                        Name.Text       = P.Name;

                        List <BrandItems> B = obj.GetBrand();
                        foreach (BrandItems BI in B)
                        {
                            Brands.Items.Add(new ListItem(BI.BrandName, BI.BrandId.ToString()));
                        }
                        price.Text = P.Price.ToString();
                        dec.Text   = P.Description;
                    }
                }
            }
        }
        public ActionResult UpdateAvatars(string secret)
        {
            int userCount = 0;

            try
            {
                if (secret == "TeamBins")
                {
                    IRepositary repo  = new Repositary();
                    var         users = repo.GetUsers().Where(s => String.IsNullOrEmpty(s.Avatar)).ToList();
                    foreach (var user in users)
                    {
                        user.Avatar = UserService.GetGravatarHash(user.EmailAddress);
                        var result = repo.SaveUser(user);
                        if (result.Status)
                        {
                            userCount++;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                return(Content(ex.Message + ex.InnerException != null ? ex.InnerException.ToString() : ""));
            }
            return(Content(userCount.ToString() + " user's avatar updated"));
        }
        public ActionResult IndexDataPassing() //To redirect Tempdata
        {
            IEnumerable <Employee> employees = Repositary.GetEmployee();

            ViewBag.Employees     = employees;
            ViewData["Employees"] = employees;
            TempData["Employees"] = employees;
            return(RedirectToAction("TempDataPassing"));
        }
        public void Mapper <SourceType>(SourceType EmpDTO)
        {
            SourceType   sourceObj      = EmpDTO;
            EmployeeData destinationObj = new EmployeeData();
            Repositary   repository     = new Repositary();

            repository.Map <SourceType, EmployeeData>(sourceObj, destinationObj);
            foreach (var v in destinationObj.GetType().GetProperties())
            {
                Console.WriteLine(v.GetValue(destinationObj));
            }
            Console.WriteLine(destinationObj.EmpAdress.city);
            Console.WriteLine(destinationObj.EmpAdress.location);
        }
Beispiel #8
0
 public DashboardController()
 {
     repo = new Repositary();
 }
Beispiel #9
0
 public UsersController()
 {
     repo = new Repositary();
 }
 public ProjectsController()
 {
     repo        = new Repositary();
     userService = new UserService(repo);
 }
 public ProjectsController(IProjectManager projectManager)
 {
     repo                = new Repositary();
     userService         = new UserService(repo);
     this.projectManager = projectManager;
 }