public void Edit(Account entity) { try { string queryString = string.Format(" UPDATE [Account] " + " SET [NarrationDetails] = N'{0}'" + ",[TransactionType] = N'{1}'" + ",[PaymentMode] = N'{2}'" + ",[Amount] = '{3}'" + //",[Balance] = '{4}'" + ",[TransactionDate]= GETDATE()" + ",[Remark]='{4}'" + ",[CustomerName]=N'{5}'" + ",[BankName]=N'{6}'" + ",[ChqDDNumber]=N'{7}'" + ",[ContactNo]=N'{8}'" + " WHERE SrNo = {9};", entity.NarrationDetails, entity.TransactionType, entity.PaymentMode, entity.Amount, entity.Remark, entity.CustomerName, entity.BankName, entity.ChqDDNumber, entity.ContactNo, entity.SrNo); string s = queryString; int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString); } catch (Exception ex) { throw; } }
public void Delete(int Id) { try { string queryString = string.Format(" DELETE FROM [StudentLedger] WHERE StudentLedgerId = {0};", Id); int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString); } catch (Exception ex) { throw; } }
public void Delete(int Id) { try { string queryString = string.Format(" DELETE FROM [ReligionDetails] WHERE ReligionId = {0};", Id); int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString); } catch (Exception ex) { throw; } }
public void Add(Employee entity, int schoolId) { try { string queryString = string.Format("INSERT INTO [Employee]([SchoolId],[EmployeeCode],[Password],[FirstName],[MiddleName],[LastName],[Category],[Address],[ContactNo],[DOB],[JoiningDate])" + " VALUES( N'{0}', N'{1}',N'{2}',N'{3}', N'{4}', N'{5}', N'{6}',N'{7}', N'{8}', convert(date,'{9}',105), convert(date,'{10}',105)) ;", schoolId, entity.EmployeeCode, entity.Password, entity.FirstName, entity.MiddleName, entity.LastName, entity.Category, entity.Address, entity.ContactNo, entity.DOB, entity.JoiningDate); string s = queryString; int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString); } catch (Exception ex) { throw; } }
public void Add(Account entity, int schoolId) { try { string queryString = string.Format("INSERT INTO [Account]([SchoolId], [NarrationDetails],[TransactionType],[PaymentMode], [Amount], [TransactionDate], [Remark],[CustomerName],[BankName],[ChqDDNumber],[ContactNo])" + "VALUES('{0}', N'{1}',N'{2}', '{3}', '{4}', GETDATE(), N'{5}', N'{6}', N'{7}',N'{8}',N'{9}');", schoolId, entity.NarrationDetails, entity.TransactionType, entity.PaymentMode, entity.Amount, entity.Remark, entity.CustomerName, entity.BankName, entity.ChqDDNumber, entity.ContactNo); int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString); } catch (Exception ex) { throw; } }
public void leaveApply(EmployeeLeaveTransaction entity) { try { string queryString; if (entity.LeavesInDays != 0) { queryString = string.Format("INSERT INTO [EmployeeLeaveTransaction]([EmployeeId],[TransactionType],[LeaveType],[LeaveFromDate],[LeaveToDate],[LeavesInDays],[BalanceLeaves],[Remark],[TransactionDate])" + "VALUES('{0}', N'{1}',N'{2}',convert(date,'{3}',105), convert(date,'{4}',105), '{5}', '{6}', N'{7}',GETDATE());", entity.EmployeeId, "Dr", entity.LeaveType, entity.LeaveFromDate, entity.LeaveToDate, entity.LeavesInDays, entity.BalanceLeaves, entity.Remark); int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString); } } catch (Exception ex) { throw; } }
public void addLeaves(List <EmployeeLeaveTransaction> entities) { try { string queryString; foreach (var entity in entities) { if (entity.LeavesInDays != 0) { queryString = string.Format("INSERT INTO [EmployeeLeaveTransaction]([EmployeeId],[TransactionType],[LeaveType],[LeaveFromDate],[LeaveToDate],[LeavesInDays],[BalanceLeaves],[Remark],[TransactionDate])" + "VALUES('{0}', N'{1}',N'{2}',GETDATE(), GETDATE(), '{3}', '{4}', N'{5}',GETDATE());", entity.EmployeeId, "Cr", 1, entity.LeavesInDays, entity.BalanceLeaves, entity.Remark); int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString); } } } catch (Exception ex) { throw; } }
public void Edit(Employee entity) { try { string queryString = string.Format(" UPDATE [Employee] " + " SET [EmployeeCode] = '{0}'" + ",[FirstName] = '{1}'" + ",[MiddleName] = '{2}'" + ",[LastName] = '{3}'" + ",[Category]='{4}'" + ",[Address]='{5}'" + ",[ContactNo]='{6}'" + ",[DOB]=convert(date,'{7}',105)" + ",[JoiningDate]=convert(date,'{8}',105)" + " WHERE EmployeeId = {9};", entity.EmployeeCode, entity.FirstName, entity.MiddleName, entity.LastName, entity.Category, entity.Address, entity.ContactNo, entity.DOB, entity.JoiningDate, entity.EmployeeId); int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString); } catch (Exception ex) { throw; } }