private Dictionary <int, string> ShowAllEmployees()
        {
            Classes.CEmployees       cu       = new Classes.CEmployees();
            Dictionary <int, string> Get      = new Dictionary <int, string>();
            List <Models.MEmployees> GetUsers = new List <Models.MEmployees>();

            GetUsers = cu.GetAll();
            Get.Add(-1, "Please Select");
            for (int i = 0; i < GetUsers.Count; i++)
            {
                int    Key   = Convert.ToInt32(GetUsers[i].id);
                string Value = GetUsers[i].FirstName;
                Get.Add(Key, Value);
            }
            return(Get);
        }
Exemplo n.º 2
0
        private void BindData()
        {
            Classes.CEmployees       ce        = new Classes.CEmployees();
            List <Models.MEmployees> Employees = new List <Models.MEmployees>();

            Employees = ce.GetAll();
            if (Session["WareHouse"] != null)
            {
                string WareHouseId = Session["WareHouse"].ToString();
                Employees = (from o in Employees
                             where o.WareHouseId == WareHouseId
                             select o).ToList();
                grdEmployees.DataSource = Employees;
                grdEmployees.DataBind();
            }
        }
Exemplo n.º 3
0
        private void BindEmployeeDdl()
        {
            Classes.CEmployees       ce        = new Classes.CEmployees();
            Dictionary <int, string> Employees = new Dictionary <int, string>();
            List <Models.MEmployees> Get       = new List <Models.MEmployees>();

            Get = ce.GetAll();
            Get = Get.Where(o => o.WareHouseId == Session["WareHouse"].ToString()).ToList();
            Employees.Add(-1, "Please Select Employees");
            for (int i = 0; i < Get.Count; i++)
            {
                int    Id           = Convert.ToInt32(Get[i].id);
                string EmployeeName = Get[i].FirstName + "-" + Get[i].LastName;
                Employees.Add(Id, EmployeeName);
            }
            ddlEmployee.DataTextField  = "Value";
            ddlEmployee.DataValueField = "Key";
            ddlEmployee.DataSource     = Employees;
            ddlEmployee.DataBind();
        }