/// <summary> /// Created By : Sudheer /// Created Date : 15 Sep 2014 /// Modified By : /// Modified Date : /// Description : To Insert or Update the WOType A /// </summary> public static WOTypes GetWOTypeById(int? id) { var wotype = new WOTypes(); System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(); System.Reflection.MethodBase methodBase = stackFrame.GetMethod(); log.Debug("Start: " + methodBase.Name); try { SqlParameter[] sqlParams = new SqlParameter[1]; sqlParams[0] = new SqlParameter("@id", id); var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "[SpGetWOTypeById]", sqlParams); while (reader.Read()) { wotype.FetchService(wotype, new SafeDataReader(reader)); } return wotype; } catch (Exception ex) { log.Error("Error: " + ex); return wotype; } finally { log.Debug("End: " + methodBase.Name); } }
/// <summary> /// Created By : Sudheer /// Created Date : 15 Sep 2014 /// Modified By : /// Modified Date : /// Description : To Insert or Update the WOType A /// </summary> public static WOTypeInfo GetAllWOTypes(int startPage, int resultPerPage, string Name, int status, string OrderBy) { var data = new WOTypeInfo(); System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(); System.Reflection.MethodBase methodBase = stackFrame.GetMethod(); log.Debug("Start: " + methodBase.Name); try { SqlParameter[] sqlParams = new SqlParameter[5]; sqlParams[0] = new SqlParameter("@startPage", startPage); sqlParams[1] = new SqlParameter("@resultPerPage", resultPerPage); sqlParams[2] = new SqlParameter("@Name", Name); sqlParams[3] = new SqlParameter("@status", status); sqlParams[4] = new SqlParameter("@OrderBy", OrderBy); var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "[SpGetAllMWOType]", sqlParams); var safe = new SafeDataReader(reader); while (reader.Read()) { var wotype = new WOTypes(); wotype.FetchService(wotype, safe); data.WOTypeList.Add(wotype); data.wotypeCount = Convert.ToInt32(reader["wotypecount"]); } return data; } catch (Exception ex) { log.Error("Error: " + ex); return data; } finally { log.Debug("End: " + methodBase.Name); } }