public ActionResult Index() { try { var msg = Connection.GDgetAllMassageType("Y"); List <GDgetAllMassageType_Result> msglist = msg.ToList(); MessageTypeModel tcm = new MessageTypeModel(); List <MessageTypeModel> tcmlist = msglist.Select(x => new MessageTypeModel { MessageTypeDescription = x.MessageTypeDescription, MessageTypeId = x.MessageTypeId, CreatedBy = x.CreatedBy, CreatedDate = x.CreatedDate, IsActive = x.IsActive, ModifiedBy = x.ModifiedBy, ModifiedDate = x.ModifiedDate }).ToList(); return(View(tcmlist)); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public ActionResult Delete(long Code) { try{ MessageTypeModel TModel = new MessageTypeModel(); TModel.MessageTypeId = Code; return(PartialView("DeleteView", TModel)); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public EnvelopeModel(Envelope envelope, Exception exception = null) { Headers = envelope.Headers; CorrelationId = envelope.CorrelationId; ParentId = envelope.ParentId; Description = envelope.ToString(); Source = envelope.Source; Destination = envelope.Destination; Message = envelope.Message; MessageType = new MessageTypeModel(envelope.Message?.GetType()); Attempts = envelope.Attempts; Exception = exception?.Message; StackTrace = exception?.ToString(); HasError = exception != null ? true : false; }
public ActionResult Delete(MessageTypeModel Model) { UserId = USession.User_Id; try { Connection.GDdeleteMassageType("N", Model.MessageTypeId, UserId); Connection.SaveChanges(); return(Json(true, JsonRequestBehavior.AllowGet)); //return RedirectToAction("Index"); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public ActionResult Edit(MessageTypeModel Model) { UserId = USession.User_Id; try { tblMessageType TCtable = Connection.tblMessageTypes.SingleOrDefault(x => x.MessageTypeId == Model.MessageTypeId); Connection.GDModifyMassageType(Model.MessageTypeDescription, Model.MessageTypeId, UserId); Connection.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public ActionResult Edit(long Code) { try{ MessageTypeModel TModel = new MessageTypeModel(); tblMessageType TCtable = Connection.tblMessageTypes.SingleOrDefault(x => x.MessageTypeId == Code); TModel.IsActive = TCtable.IsActive; TModel.MessageTypeId = TCtable.MessageTypeId; TModel.MessageTypeDescription = TCtable.MessageTypeDescription; return(PartialView("EditView", TModel)); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public void AddMBaseMessage(MessageTypeModel message) { SpName = "mbase_saveMessage"; try { SqlParameter[] param = { new SqlParameter("@MessageType", SqlDbType.VarChar, 5) { Value = message.MessageType }, new SqlParameter("@TranCode", SqlDbType.VarChar, 5) { Value = message.TranCode }, new SqlParameter("@Seq", SqlDbType.Int) { Value = message.Seq }, new SqlParameter("@FieldName", SqlDbType.VarChar, 20) { Value = message.FieldName.Trim() }, new SqlParameter("@Length", SqlDbType.VarChar, 3) { Value = message.Length }, new SqlParameter("@DataType", SqlDbType.VarChar, 2) { Value = message.DataType }, new SqlParameter("@StartIndex", SqlDbType.Int) { Value = message.StartIndex }, new SqlParameter("@EndIndex", SqlDbType.Int) { Value = (int.Parse(message.Length) + message.StartIndex) - 1 }, new SqlParameter("@Mandatory", SqlDbType.VarChar, 3) { Value = message.Mandatory }, new SqlParameter("@Description", SqlDbType.VarChar, 200) { Value = message.Description.Trim() }, new SqlParameter("@DefaultValue", SqlDbType.VarChar, 50) { Value = message.DefaultValue }, new SqlParameter("@Remark", SqlDbType.NVarChar, 200) { Value = message.Remark.Trim() } }; SQLSingleton.Instance.RunStoreProcedure(SpName, param, out oMessage); } catch (Exception ex) { Logging.WriteLog(ex.Message); } }