Ejemplo n.º 1
0
        private void filterGv(int job)
        {
            List <int>            emID = new List <int>();
            List <EmployeeScore>  s    = new List <EmployeeScore>();
            EmployeeJobRepository ej   = new EmployeeJobRepository();
            DataTable             dt   = ej.findEmployeeByJob(job);
            EmployeeScore         ss   = new EmployeeScore();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                emID.Add(dt.Rows[i][1].ToString().ToInt());
                ss = er.getEmployeeScore(emID[i]);
                s.Add(ss);
            }
            DataTable data = new DataTable();

            data = OnlineTools.ToDataTable(s);
            gvEmployees.DataSource = data;
            gvEmployees.DataBind();
            for (int i = 0; i < data.Rows.Count; i++)
            {
                GridViewRow row   = gvEmployees.Rows[i];
                var         input = new HtmlInputGenericControl("number");
                input       = (HtmlInputGenericControl)row.FindControl("Score");
                input.Value = er.getEmployeeScore(emID[i]).Score.ToString();
            }
        }
Ejemplo n.º 2
0
        private void fillListBox()
        {
            EmployeeJobRepository ej = new EmployeeJobRepository();

            SelectedSubGroups.DataSource     = ej.getEmployeeJobs(empid);
            SelectedSubGroups.DataTextField  = "JobTitle";
            SelectedSubGroups.DataValueField = "JobID";
            SelectedSubGroups.DataBind();
        }
Ejemplo n.º 3
0
 protected void RemoveFromSub_Click(object sender, EventArgs e)
 {
     if (SelectedSubGroups.SelectedIndex != -1)
     {
         EmployeeJobRepository ej = new EmployeeJobRepository();
         ej.DeleteByEmpid_Jobid(empid, SelectedSubGroups.SelectedItem.Value.ToInt());
         SelectedSubGroups.Items.RemoveAt(SelectedSubGroups.SelectedIndex);
     }
 }
        public void GetAll_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new EmployeeJobRepository(context);

            // Act
            IEnumerable <employeeJob> result = repository.GetAll();

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(context.employeeJob.Count(), result.Count());
        }
        public void GetById_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new EmployeeJobRepository(context);
            int id         = 1;

            // Act
            employeeJob result = repository.GetById(id);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(id, result.id);
        }
Ejemplo n.º 6
0
        public void GetAllFilterByCurrent_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new EmployeeJobRepository(context);
            var service    = new EmployeeJobService(repository);

            // Act
            IEnumerable <EmployeeJobModel> result = service.GetAllFilterByCurrent();

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(context.employeeJob.Where(x => x.isCurrent).Count(), result.Count());
            Assert.AreEqual(result.Where(x => x.IsCurrent).Count(), result.Count());
        }
Ejemplo n.º 7
0
        public void GetById_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new EmployeeJobRepository(context);
            var service    = new EmployeeJobService(repository);
            int id         = 1;

            // Act
            EmployeeJobModel result = service.GetById(id);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(id, result.Id);
        }
Ejemplo n.º 8
0
        private void setLabels()
        {
            EmployeesRepository er = new EmployeesRepository();
            DataTable           dt = er.getEmployeeProfileInfo(empid);

            lbladdress.Value    = dt.Rows[0][8].ToString();
            lblcitystate.Value  = dt.Rows[0][21].ToString();
            lblemail.Value      = dt.Rows[0][10].ToString();
            lblfullname.Value   = dt.Rows[0][20].ToString();
            lblid.Value         = dt.Rows[0][0].ToString();
            lblmobile.Value     = dt.Rows[0][9].ToString();
            lblusername.Value   = dt.Rows[0][3].ToString();
            lblzip.Value        = dt.Rows[0][11].ToString();
            hFullName.InnerText = dt.Rows[0][20].ToString();
            EmployeeJobRepository ejr   = new EmployeeJobRepository();
            DataTable             dtJob = ejr.getEmployeeJobs(empid);

            lbxJobs.DataSource     = dtJob;
            lbxJobs.DataTextField  = "JobTitle";
            lbxJobs.DataValueField = "JobID";
            lbxJobs.DataBind();

            setImage();
        }
Ejemplo n.º 9
0
 protected void AddToSub_Click(object sender, EventArgs e)
 {
     if (SubGroups.SelectedIndex != -1)
     {
         bool   isadd = false;
         string text  = SubGroups.SelectedItem.Text;
         string value = SubGroups.SelectedItem.Value;
         for (int i = 0; i < SelectedSubGroups.Items.Count; i++)
         {
             if (SelectedSubGroups.Items[i].Text == text)
             {
                 isadd = true;
             }
         }
         if (!isadd)
         {
             SelectedSubGroups.Items.Add(new ListItem(text, value));
             JobEmployee je = new JobEmployee();
             je.EmployeeID = empid;
             je.JobID      = value.ToInt();
             EmployeeJobRepository ejr = new EmployeeJobRepository();
             ejr.SaveJobEmployee(je);
             NoItemDiv.InnerText = "";
         }
         else
         {
             NoItemDiv.InnerText           = "این مورد قبلا اضافه شده است!";
             NoItemDiv.Attributes["class"] = "error";
         }
     }
     else
     {
         NoItemDiv.InnerText           = "شما هیچ موردی را انتخاب نکرده اید!";
         NoItemDiv.Attributes["class"] = "error";
     }
 }