public List <TicketNature> TicketNature() { var TktNatures = new List <TicketNature>(); foreach (var name in Enum.GetNames(typeof(Ticket_Nature))) { TicketNature ug = new TicketNature(); ug.NatureID = (int)Enum.Parse(typeof(Ticket_Nature), name); ug.Nature = name; TktNatures.Add(ug); } return(TktNatures); }
public ActionResult AddTicketNature(string tn) { if (string.IsNullOrEmpty(tn)) { return(Json(new { status = false }, JsonRequestBehavior.AllowGet)); } TicketNature m = new TicketNature(); m.Nature = tn; string msg = ""; var flag = TnBAL.AddTicketNature(m, out msg); return(Json(new { status = flag > 0 }, JsonRequestBehavior.AllowGet)); }
public List <TicketNature> Map(IDataReader reader) { List <TicketNature> tns = new List <TicketNature>(); while (reader.Read()) { TicketNature tn = new TicketNature(); tn.NatureID = Convert.ToInt32(reader["ID"] == DBNull.Value ? 0 : reader["ID"]); tn.Nature = reader["Nature"] == DBNull.Value ? "" : reader["Nature"].ToString(); tn.Status = Convert.ToBoolean(reader["IsActive"] == DBNull.Value ? 1 : reader["IsActive"]); tns.Add(tn); } return(tns); }
public int AddTicketNature(TicketNature tn, out string msg) { var flag = 0; msg = ""; try { SqlParameter[] parameters = { new SqlParameter("@TicketNature", tn.Nature), new SqlParameter("@Type", "B") }; flag = ExecuteNonQuery("SP_Manage_Ticket_Nature", parameters); } catch (Exception ex) { flag = 0; msg = "Unable to add due to " + ex.Message; } return(flag); }
public int AddTicketNature(TicketNature tn, out string msg) { return(tnRepo.AddTicketNature(tn, out msg)); }