public activitylog GetActivityLog(int ID) { activitylog objActivityLog = new activitylog(); try { ActivityLogDataService.CreateSession(); objActivityLog = ActivityLogDataService.GetActivityLog(ID); } catch (Exception ex) { } finally { ActivityLogDataService.CloseSession(); } return(objActivityLog); }
public activitylog AddActivityLog(activitylog objActivityLog) { try { ActivityLogDataService.CreateSession(); ActivityLogDataService.BeginTransaction(); ActivityLogDataService.AddActivityLog(objActivityLog); ActivityLogDataService.CommitTransaction(true); } catch (Exception ex) { } finally { ActivityLogDataService.CloseSession(); } return(objActivityLog); }
private void button4_Click_1(object sender, EventArgs e) { //actlog MySqlConnection sqlcon = new MySqlConnection("DATA SOURCE= 127.0.0.1; INITIAL CATALOG=it_2d; UID=root"); MySqlCommand sqlcom = new MySqlCommand("SELECT * FROM tbl_activitylog", sqlcon); MySqlDataAdapter sqlDA = new MySqlDataAdapter(); DataSet2 ds = new DataSet2(); sqlcon.Open(); sqlcom.CommandType = CommandType.Text; sqlDA.SelectCommand = sqlcom; sqlDA.Fill(ds, "activitylog"); // dataGridView1.DataSource = ds; // dataGridView1.DataMember = "tbl_penalty"; activitylog cry = new activitylog(); cry.SetDataSource(ds); crystalReportViewer1.ReportSource = cry; sqlcon.Close(); }
public static void AddActivityLog(int userID, int clientID, string module, string view, string url, string activity) { activitylog log = new activitylog(); IActivityLogDataService dataService = new ActivityLogDataService(); ActivityLogBusinessService aLogBusinessService = new ActivityLogBusinessService(dataService); try { log.UserID = userID; log.ClientID = clientID; log.LogTime = DateTime.Now; log.Module = module; log.View = view; log.Url = url; log.Description = activity; aLogBusinessService.AddActivityLog(log); } catch (Exception ex) { } }
public void UpdateActivityLog(activitylog objActivityLog) { dbConnection.activitylogs.Add(objActivityLog); }
public activitylog GetActivityLog(int ID) { activitylog objActivityLog = dbConnection.activitylogs.SingleOrDefault(u => u.ID == ID); return(objActivityLog); }