//public static IEnumerable<DataRow> GetEmployees() //{ // BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); // qb.SetInParam("@EmployeeId", DBNull.Value, SqlDbType.UniqueIdentifier); // DataSet ds = qb.ExecuteDataset("spGetEmployee", CommandType.StoredProcedure); // if (ds.Tables.Count > 0) // { // return ds.Tables[0].AsEnumerable(); // } // else // { // return null; // } //} public static long UpdateEmployee(Employees employeeDetails) { BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); qb.ClearParameters(); qb.SetInParam("@EmployeeId", employeeDetails.EmployeeId, SqlDbType.UniqueIdentifier); qb.SetInParam("@FirstName ", employeeDetails.FirstName, SqlDbType.NVarChar); qb.SetInParam("@MiddleName", employeeDetails.MiddleName, SqlDbType.NVarChar); qb.SetInParam("@LastName", employeeDetails.LastName, SqlDbType.NVarChar); qb.SetInParam("@Designation", employeeDetails.Designation, SqlDbType.NVarChar); qb.SetInParam("@Gender", employeeDetails.Gender, SqlDbType.NVarChar); qb.SetInParam("@DateOfBirth", employeeDetails.DateOfBirth, SqlDbType.DateTime); qb.SetInParam("@Anniversary", "1901-01-01", SqlDbType.DateTime); qb.SetInParam("@Remarks", employeeDetails.Remarks, SqlDbType.NVarChar); qb.SetInParam("@DateOfJoining", employeeDetails.DateOfJoining, SqlDbType.DateTime); qb.SetInParam("@DateOfRelieving", employeeDetails.DateOfRelieving, SqlDbType.DateTime); qb.SetInParam("@PanNo", employeeDetails.PanNo, SqlDbType.NVarChar); qb.SetInParam("@FatherName", employeeDetails.FatherName, SqlDbType.NVarChar); qb.SetInParam("@EmployeeType", employeeDetails.EmployeeType, SqlDbType.NVarChar); qb.SetInParam("@BankDetail", employeeDetails.BankDetail, SqlDbType.NVarChar); qb.SetInParam("@OrignalDateOfBirth", employeeDetails.OrignalDateOfBirth, SqlDbType.DateTime); var result = qb.ExecuteNonQuery("spUpdateEmployee"); return(result); }
public static long InsertTaxSavingType(TaxSavingTypeModel taxSavingType) { BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); qb.ClearParameters(); qb.SetInParam("@TaxSavingTypeName", taxSavingType.TaxSavingTypeName, SqlDbType.NVarChar); qb.SetInParam("@TaxCategoryCode", taxSavingType.TaxCategoryCode, SqlDbType.NVarChar); var result = qb.ExecuteNonQuery("spInsertTaxSavingType", CommandType.StoredProcedure); return(result); }
public static long DeleteHoliday(DateTime holidaydate) { try { long result; BuildQuery bq = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); bq.ClearParameters(); bq.SetInParam("@HolidayDate", holidaydate, SqlDbType.DateTime); result = bq.ExecuteNonQuery("spDeleteHoliday"); return(result); } catch (Exception ex) { throw ex; } }
public static long InsertHoliday(HolidayModel holiday) { try { BuildQuery qb = new BuildQuery(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); qb.ClearParameters(); qb.SetInParam("@HolidayDate", holiday.HolidayDate, SqlDbType.DateTime); qb.SetInParam("@Name", holiday.Name, SqlDbType.NVarChar); qb.SetInParam("@Remarks", holiday.Remark, SqlDbType.NVarChar); var result = qb.ExecuteNonQuery("spInsertHoliday", CommandType.StoredProcedure); return(result); } catch (Exception ex) { throw ex; } }