public static IEnumerable <tblTimeExpensesSummary> GetUserById(int in_id)
    {
        TNEDataContext tb = new TNEDataContext();

        tb.tblTimeExpensesSummaries.Single(p => p.Id == in_id);
        return(tb.tblTimeExpensesSummaries);
    }
Beispiel #2
0
    public static void Update(int id)
    {
        TNEDataContext t    = new TNEDataContext();
        var            item = t.tblTimeExpensesSummaries.Single(p => p.Id == id);

        item.LastUpdated = DateTime.Now;
        t.SubmitChanges();
    }
Beispiel #3
0
    protected void SendExcelInfo()
    {
        if (!string.IsNullOrEmpty(txtEndDateExcel.Text) && !string.IsNullOrEmpty(txtStartDateExcel.Text))
        {
            if (Convert.ToDateTime(txtStartDateExcel.Text) <= Convert.ToDateTime(txtEndDateExcel.Text))
            {
                string         datetime = DateTime.Now.ToShortDateString();
                TNEDataContext t        = new TNEDataContext();

                var xl = from g in t.tblTimeExpensesSummaries
                         where g.Date >= Convert.ToDateTime(txtStartDateExcel.Text) &&
                         g.Date <= Convert.ToDateTime(txtEndDateExcel.Text) &&
                         g.NewId.ToString() == userId.ToString()
                         orderby g.Date descending
                         select new
                {
                    Day             = g.Date,
                    Description     = g.WorkDescription,
                    Hours           = g.WorkHrs,
                    Comments        = g.Comments,
                    PaymentReceived = g.PaymentReceived
                };

                GridView newGrid = new GridView();
                newGrid.DataSource = xl;
                newGrid.DataBind();
                try
                {
                    bl.Export(String.Format("TNE_{0}.xls", datetime), newGrid);
                }
                catch (Exception)
                {
                }
            }
        }
    }
Beispiel #4
0
    public static IEnumerable <tblTimeExpensesSummary> Select()
    {
        TNEDataContext t = new TNEDataContext();

        return(t.tblTimeExpensesSummaries);
    }