private TemplateMapping FetchTemplateSetDetails(TemplateMapping TMapping, SafeDataReader dr) { TMapping.SetID = dr.GetInt32("SetID"); TMapping.SetName = dr.GetString("SetName"); TMapping.FilePath = dr.GetString("FilePath"); return TMapping; }
private TemplateMapping FetchTemplateFileDetails(TemplateMapping TMapping, SafeDataReader dr) { TMapping.SetID = dr.GetInt32("SetID"); TMapping.SetName = dr.GetString("SetName"); TMapping.FileName = dr.GetString("FileName"); TMapping.FileID = dr.GetInt32("FileID"); TMapping.FileFullName = dr.GetString("FileFullName"); TMapping.FilePath = dr.GetString("FilePath"); TMapping.TFileStatus = dr.GetBoolean("TFileStatus"); TMapping.Description = dr.GetString("Description"); TMapping.IsDefault = dr.GetString("IsDefault"); TMapping.IsMultiple = dr.GetString("IsMultiple"); TMapping.MultipleEntity = dr.GetString("MultipleEntity"); TMapping.SetDescription = dr.GetString("SetDescription"); TMapping.SetStatus = dr.GetBoolean("SetStatus"); return TMapping; }
private TemplateMapping FetchTemplateMDocMultipleEntity(TemplateMapping TMapping, SafeDataReader dr) { TMapping.EntityName = dr.GetString("EntityName"); TMapping.DisplayName = dr.GetString("DisplayName"); return TMapping; }
private TemplateMapping FetchTemplate(TemplateMapping TMapping, SafeDataReader dr) { TMapping.WOID = dr.GetInt32("WOID"); TMapping.SetID = dr.GetInt32("SetID"); TMapping.SetName = dr.GetString("SetName"); TMapping.FileName = dr.GetString("FileName"); TMapping.FileID = dr.GetInt32("FileID"); TMapping.FileFullName = dr.GetString("FileFullName"); TMapping.FilePath = dr.GetString("FilePath"); TMapping.TFileStatus = dr.GetBoolean("TFileStatus"); return TMapping; }
public static object InsertSetDetails(TemplateMapping data) { int output = 0; System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(); System.Reflection.MethodBase methodBase = stackFrame.GetMethod(); log.Debug("Start: " + methodBase.Name); try { SqlParameter[] sqlParams = new SqlParameter[6]; sqlParams[0] = new SqlParameter("@Wocode", data.WOCode); sqlParams[1] = new SqlParameter("@SetId", data.SetID); sqlParams[2] = new SqlParameter("@name", data.DisplayName); sqlParams[3] = new SqlParameter("@Description", data.Description); sqlParams[4] = new SqlParameter("@Status", data.TFileStatus); sqlParams[5] = new SqlParameter("@Output", 0); sqlParams[5].Direction = ParameterDirection.Output; SqlHelper.ExecuteNonQuery(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpInsertTemplatesSet", sqlParams); output = Convert.ToInt32(sqlParams[5].Value); } catch (Exception ex) { log.Error("Error: " + ex); } log.Debug("End: " + methodBase.Name); return output; // return result; }
/// <summary> /// Description : To WO-Templates Data /// Created By : Sudheer /// Created Date : 25th Aug 2014 /// Modified By : /// Modified Date : /// <returns></returns> /// </summary> public static TemplateInfo GetTemplateSetData(string WoTypeID) { var data = new TemplateInfo(); System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(); System.Reflection.MethodBase methodBase = stackFrame.GetMethod(); log.Debug("Start: " + methodBase.Name); try { tempinfo objtempinfo = new tempinfo(); SqlParameter[] sqlParams = new SqlParameter[1]; sqlParams[0] = new SqlParameter("@WOTYPEID", WoTypeID); var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "[SPGetTemplateSetByWOType]", sqlParams); var safe = new SafeDataReader(reader); while (reader.Read()) { var Template = new TemplateMapping(); Template.FetchTemplateSetDetails(Template, safe); data.TemplateList.Add(Template); } } catch (Exception ex) { log.Error("Error: " + ex); } log.Debug("End: " + methodBase.Name); return data; }
public static List<TemplateMapping> GetMDocMultipleEntity(string WOCode) { var data = new TemplateInfo(); List<TemplateMapping> MaintempLst = new List<TemplateMapping>(); 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("@WOCode", WOCode); var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetMDoC", sqlParams); var safe = new SafeDataReader(reader); while (reader.Read()) { TemplateMapping Template = new TemplateMapping(); Template.FetchTemplateMDocMultipleEntity(Template, safe); MaintempLst.Add(Template); } } catch (Exception ex) { log.Error("Error: " + ex); } log.Debug("End: " + methodBase.Name); return MaintempLst; }
public JsonResult InsertSetDetails(string woCode, string setName, string description, bool setStatus, string SetID) { System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(); System.Reflection.MethodBase methodBase = stackFrame.GetMethod(); log.Debug("Start: " + methodBase.Name); try { var setData = new TemplateMapping { SetID = (SetID == "0" ? 0 : Convert.ToInt32(SetID)), WOCode = woCode, DisplayName = setName, TFileStatus = setStatus, Description = description }; var data1 = TemplateMapping.InsertSetDetails(setData); return Json(data1); } catch (Exception ex) { log.Error("Error: " + ex); return Json(-1); } finally { log.Debug("End: " + methodBase.Name); } }