Beispiel #1
0
        public List<WcfService1.ServiceModels.TaskCls> LoadTask(int UserId)
        {
            DataSet dset = new DataSet();
            DataTable dt = new DataTable();

            DBManager DbObj = new DBManager();

            DbParameter[] dbparms = new DbParameter[1];
            dbparms[0] = DbObj.CreateParameter("@Userid", UserId);

            dt = DbObj.GetDataTabe("GetTask", dbparms, CommandType.StoredProcedure);

            List<TaskCls> TaskList = new List<TaskCls>();
            foreach (DataRow dr in dt.Rows)
            {
                TaskList.Add(new TaskCls
                {
                    Task = (dr["Task"].ToString()),
                    Task_Des = (dr["Task_Des"].ToString()),
                    Priority = (dr["Priority"].ToString()),
                    CurrentTime = (dr["CurrentTime"].ToString()),
                    Active_Status = (dr["Active_Status"].ToString())

                });

            }
            return TaskList;
        }