예제 #1
0
    public WCFEmployee findCurrentRepresentative(string headid)
    {
        int         head       = Convert.ToInt32(headid);
        Employee    current    = dhmanager.getDepartmentRepresentative(head);
        WCFEmployee wcfcurrent = WCFEmployee.Make(current.employeecode, current.employeename, current.employeeemail, current.deptcode, current.role, current.del);

        return(wcfcurrent);
    }
예제 #2
0
    public WCFEmployee GetEmployeeByEmail(string email, string password)
    {
        Employee emp = LoginController.login(email, password);

        return(WCFEmployee.Make(emp.EmpID, emp.DeptCode, emp.EmpName, emp.Role, emp.Password
                                , emp.Email, emp.IsTempHead, emp.StartDate.GetValueOrDefault().ToShortDateString()
                                , emp.EndDate.GetValueOrDefault().ToShortDateString()));
    }
예제 #3
0
    //AUTHOR : KHIN MYO MYO SHWE
    public WCFEmployee GetDeptRep(string dcode)
    {
        Department d   = deptController.GetDepartByDepCode(dcode);
        Employee   emp = deptController.GetEmployeeListForDRepSelected(dcode);

        return(WCFEmployee.Make(emp.EmpID, d.DeptName, emp.EmpName, emp.Role, emp.Password
                                , emp.Email, emp.IsTempHead, emp.StartDate.GetValueOrDefault().ToShortDateString()
                                , emp.EndDate.GetValueOrDefault().ToShortDateString()));
    }
예제 #4
0
    public void setRepresentative(WCFEmployee remp)
    {
        int      emcode   = remp.Employeecode;
        string   deptcode = remp.Deptcode;
        Employee re       = dhmanager.getDepartmentRepresentativeByDept(deptcode);
        int      recode   = re.employeecode;

        dhmanager.changePreviousRepresentative(recode);
        dhmanager.setRepresentative(emcode);
    }
예제 #5
0
    //AUTHOR : KHIN MYO MYO SHWE
    public void UpdateDeptRep(WCFEmployee e)
    {
        Employee emp = new Employee
        {
            EmpID    = e.Eid,
            DeptCode = e.DeptCode,
            Role     = e.Role,
        };

        deptController.UpdateDeptRep(e.DeptCode, e.Eid);
    }
예제 #6
0
    public static WCFEmployee Make(int employeecode, string employeename, string employeeemail, string deptcode, string role, int del)
    {
        WCFEmployee item = new WCFEmployee();

        item.employeecode  = employeecode;
        item.employeename  = employeename;
        item.employeeemail = employeeemail;
        item.deptcode      = deptcode;
        item.role          = role;
        item.del           = del;
        return(item);
    }
예제 #7
0
 /*get employee by username and password*/
 public WCFEmployee getEmployee(String un, String psd)
 {
     try
     {
         Employee e = EmployeeOp.Authenticate(un, psd);
         return(WCFEmployee.Make(e.EmpID, e.DepartmentID, e.EmpTitle, e.EmpName, e.Email, e.Delegate, 1, e.DelegateStartDate.ToString(), e.DelegateEndDate.ToString()));
     }
     catch
     {
         return(WCFEmployee.Make(null, null, null, null, null, 0, 0, null, null));
     }
 }
예제 #8
0
    /*get employee list by department id*/
    public List <WCFEmployee> getEmpByDep(string deptId)
    {
        List <Employee>    e1 = EmployeeOp.getEmployee(deptId);
        List <WCFEmployee> l  = new List <WCFEmployee>();

        foreach (Employee e in e1)
        {
            l.Add(WCFEmployee.Make(e.EmpID, e.DepartmentID, e.EmpTitle, e.EmpName, e.Email, e.Delegate, 1, e.DelegateStartDate.ToString(), e.DelegateEndDate.ToString()));
        }

        return(l);
    }
예제 #9
0
    public List <WCFEmployee> populateEmployee(string headcode)
    {
        int hcode = Convert.ToInt32(headcode);
        List <WCFEmployee> wcfelist = new List <WCFEmployee>();
        List <Employee>    elist    = dhmanager.PopulateEmpList(hcode);

        foreach (Employee i in elist)
        {
            WCFEmployee e = WCFEmployee.Make(i.employeecode, i.employeename, i.employeeemail, i.deptcode, i.role, i.del);
            wcfelist.Add(e);
        }
        return(wcfelist);
    }
예제 #10
0
    //AUTHOR : KHIN MYO MYO SHWE
    public List <WCFEmployee> ListForDeptRep(string dcode, string id)
    {
        List <WCFEmployee> wlist = new List <WCFEmployee>();
        List <Employee>    elist = deptController.GetEmployeeListForDRep(dcode, Convert.ToInt16(id));

        foreach (Employee e in elist)
        {
            wlist.Add(WCFEmployee.Make(e.EmpID, e.DeptCode, e.EmpName, e.Role, e.Password, e.Email
                                       , e.IsTempHead, e.StartDate.GetValueOrDefault().ToShortDateString()
                                       , e.EndDate.GetValueOrDefault().ToShortDateString()));
        }
        return(wlist);
    }
예제 #11
0
 public WCFEmployee GetEmployee(string employeecode, string email, string password)
 {
     if (loginService.ValidateUser(email, password))
     {
         Employee    emp = dCon.GetEmployeeInfoByEmployeeCode(employeecode);
         WCFEmployee e   = new WCFEmployee(emp.EmployeeCode, emp.ReportTo, emp.DepartmentCode,
                                           emp.CurrentRoleCode, emp.EmployeeName, emp.EmployeeTitle, emp.UserName);
         return(e);
     }
     else
     {
         return(null);
     }
 }
예제 #12
0
    //AUTHOR : KHIN MYO MYO SHWE
    public void UpdateActingDHead(WCFEmployee e)
    {
        Employee emp = new Employee
        {
            EmpID      = e.Eid,
            DeptCode   = e.DeptCode,
            Role       = e.Role,
            IsTempHead = e.IsTemphead,
            StartDate  = Convert.ToDateTime(e.StartDate),
            EndDate    = Convert.ToDateTime(e.EndDate)
        };

        deptController.UpdateActingDHead(e.DeptCode, e.Eid, e.StartDate, e.EndDate);
    }
예제 #13
0
    public static WCFEmployee Make(int eid, string deptCode, string ename, string role, string password, string email, string isTemphead, string startDate, string endDate)
    {
        WCFEmployee e = new WCFEmployee();

        e.eid        = eid;
        e.deptCode   = deptCode;
        e.ename      = ename;
        e.role       = role;
        e.password   = password;
        e.email      = email;
        e.isTemphead = isTemphead;
        e.startDate  = startDate;
        e.endDate    = endDate;
        return(e);
    }
예제 #14
0
    public static WCFEmployee Make(string EmpId, string DepartmentId, string EmpTitle, string EmpName, string Email, int Delegate, int auth, string DelegateStartDate, string DelegateEndDate)
    {
        WCFEmployee e = new WCFEmployee();

        e.empId             = EmpId;
        e.departmentId      = DepartmentId;
        e.empTitle          = EmpTitle;
        e.empName           = EmpName;
        e.email             = Email;
        e.delegated         = Delegate;
        e.auth              = auth;
        e.delegateStartDate = DelegateStartDate;
        e.delegateEndDate   = DelegateEndDate;

        return(e);
    }
예제 #15
0
    //AUTHOR : KHIN MYO MYO SHWE
    public WCFEmployee GetActingDHead(string dcode)
    {
        int count = deptController.GetEmployeeListForActingDHeadSelectedCount(dcode);

        if (count > 0)
        {
            Department d   = deptController.GetDepartByDepCode(dcode);
            Employee   emp = deptController.GetEmployeeListForActingDHeadSelected(dcode);
            return(WCFEmployee.Make(emp.EmpID, d.DeptName, emp.EmpName, emp.Role, emp.Password
                                    , emp.Email, emp.IsTempHead, emp.StartDate.GetValueOrDefault().ToShortDateString()
                                    , emp.EndDate.GetValueOrDefault().ToShortDateString()));
        }
        else
        {
            return(WCFEmployee.Make(0, null, null, null, null, null, null, null, null));
        }
    }
예제 #16
0
    public WCFEmployee GetEmployeeById(int sessionID, int empNo)
    {
        WCFEmployee result = null;

        if (AndroidAuthenticationController.IsValidSessionId(sessionID))
        {
            Employee employee = AndroidController.GetEmployee(empNo);

            if (employee != null)
            {
                result = new WCFEmployee()
                {
                    DeptCode      = employee.DeptCode,
                    Email         = employee.Email,
                    EmpName       = employee.EmpName,
                    EmpNo         = employee.EmpNo.ToString(),
                    SessionExpiry = String.Format("{0:dd/MMM/yyyy}", employee.SessionExpiry),
                    SessionNo     = employee.SessionNo.ToString()
                };
            }
        }

        return(result);
    }
예제 #17
0
    /*getting current department representative */
    public WCFEmployee currentRep(string deptId)
    {
        Employee e = EmployeeOp.currentRep(deptId);

        return(WCFEmployee.Make(e.EmpID, e.DepartmentID, e.EmpTitle, e.EmpName, e.Email, e.Delegate, 1, e.DelegateStartDate.ToString(), e.DelegateEndDate.ToString()));
    }