Exemple #1
0
        public DataSet GetDegrees()
        {
            string Querry = "select id,degree from Degree";

            ds = database.Read(Querry);

            return(ds);
        }
        /// <summary>
        /// Assign Leave to all employees
        /// </summary>
        public void AssignAll(AssignLeaves Al)
        {
            string  Querry = "select EmployeeID from Employee";
            DataSet ds     = DataBase.Read(Querry);

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                AssignLeave(new AssignLeaves()
                {
                    EmployeeID = ds.Tables[0].Rows[i][0].ToString(), LeaveTypeID = Al.LeaveTypeID, Count = Al.Count
                });
            }
        }/// <summary>
Exemple #3
0
        public DataSet GetAttendance(int EmployeeID)
        {
            string  Querry   = string.Format("select EmployeeId,Date,ArrivalTime,DepartureTime,UpdatedOn from AttendanceRecord where EmployeeID='{0}'", EmployeeID);
            db      database = new db();
            DataSet ds       = database.Read(Querry);

            return(ds);
        }
Exemple #4
0
        public DataSet GetPublications()
        {
            Querry = @"select x.Title,x.PublishDate,x.Description,x.Authors,y.FileName,y.Fileid,x.id from Publications as x inner join PublicationAttachment as y on
x.id=y.PublicationId where x.Employeeid=" + EmployeeId;
            DataSet d1 = database.Read(Querry);

            return(d1);
        }
        public void NotifyAcceptedLeave()
        {// call when leave has been accpted
            string  Querry  = string.Format("select Employee.EmployeeName,Employee.Email from LeaveApplication inner join Employee on LeaveApplication.EmployeeID=Employee.EmployeeID where LeaveApplication.LeaveApplicationID={0}", ApplicationId);
            db      d1      = new db();
            DataSet ds      = d1.Read(Querry);
            string  Subject = System.Configuration.ConfigurationManager.AppSettings["SubjectAccept"];;
            string  Content = "";
            Email   e1      = new Email();

            //e1.Send(ds.Tables[0].Rows[0][1].ToString(), Subject, Content);
            e1 = null;
            d1 = null;
            ds = null;
        }
Exemple #6
0
        public bool IsLeaveApplied()
        {
            string  Querry   = string.Format("");
            db      database = new db();
            DataSet ds       = database.Read(Querry);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #7
0
        public Employee GetManager()
        {
            string   Querry   = string.Format("select d.EmployeeName as ManagerName,d.Email from Employee e inner join Employee d on e.Manager = d.EmployeeID where e.EmployeeID ={0}", EmployeeID);
            Employee e1       = new Employee();
            db       database = new db();
            DataSet  ds       = database.Read(Querry);

            if (ds.Tables[0].Rows.Count == 0)
            {
                return(null);
            }
            e1.EmployeeName = ds.Tables[0].Rows[0][0].ToString();
            e1.Email        = ds.Tables[0].Rows[0][1].ToString();
            return(e1);
        }
Exemple #8
0
        public static bool IsUnderManagement(string ApplicationId, int UserId)
        {//this will check for leave applicant is under management of current login user...
            string  Querry = "select Employee.Manager from LeaveApplication inner join Employee on LeaveApplication.EmployeeID=Employee.EmployeeID where LeaveApplication.LeaveApplicationID=" + ApplicationId;
            DataSet ds     = database.Read(Querry);

            if (ds.Tables[0].Rows[0][0] == System.DBNull.Value)
            {//if some one has no manager then he may be the top manager so currently we are returning false...
                return(false);
            }
            if (Convert.ToInt32(ds.Tables[0].Rows[0][0]) == UserId)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #9
0
        public void NotifyAbsentees()
        {
            string  Subject = System.Configuration.ConfigurationManager.AppSettings["SubjectAttandance"];
            string  Body    = "";
            string  Querry  = string.Format("select EmployeeName,Email from Employee where EmpNo='{0}'", EmpNo);
            db      d1      = new db();
            DataSet ds      = d1.Read(Querry);

            if (ds.Tables[0].Rows.Count > 0)
            {
                string Name = ds.Tables[0].Rows[0][0].ToString();
                string mail = ds.Tables[0].Rows[0][1].ToString();
                Body = string.Format("Dear {0} you are absent at {1} kindly for more information check your dashboard Thankyou.", Name, Date);
                if (AttendanceRecord(Body) > 0)
                {
                    Email e1 = new Email();
                    e1.Send(mail, Subject, Body);
                }
            }
        }
Exemple #10
0
 public DataSet GetExperiences()
 {
     Querry = string.Format("select * from experience where Employeeid='{0}'", EmployeeId);
     return(database.Read(Querry));
 }
Exemple #11
0
        public List <Department> GetDepartments()
        {
            List <Department> Departments = new List <Department>();

            string command = "Select * from departments";

            DataSet ds = database.Read(command);

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                Department d1 = new Department();
                d1.DepartmentId = ds.Tables[0].Rows[i][0].ToString();
                d1.department   = ds.Tables[0].Rows[i][1].ToString();
                Departments.Add(d1);
            }

            return(Departments);
        }
Exemple #12
0
        public DataSet DownloadFile(int FileId)
        {
            string Querry = string.Format("select Files.Content,Attachments.FileName from Files inner join Attachments on Attachments.FileId = Files.FileId where Files.FileId ={0}", FileId);

            return(database.Read(Querry));
        }
Exemple #13
0
 public DataSet GetAcheivement()
 {
     Querry = string.Format("select Acheivement.id as 'AcheivementID',AcheivementAttachments.FileId as 'FileID',AcheivementAttachments.id as 'AcheivementAttachID' ,Title,Date,Description,FileName,Content from Acheivement inner join AcheivementAttachments on Acheivement.id=AcheivementId inner join Files on Files.FileId=AcheivementAttachments.FileId where EmployeeID={0}", EmployeeID);
     return(database.Read(Querry));
 }
Exemple #14
0
        public DataSet GetDegrees()
        {
            string Querry = string.Format("select * from degree");

            return(database.Read(Querry));
        }