예제 #1
0
        public string AddNinio(ref OperationResult objOperationResult, ninioDto objNinioDto, List <string> ClientSession)
        {
            string NewId0 = null;

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();
                ninio objEntity = ninioAssembler.ToEntity(objNinioDto);
                objEntity.d_InsertDate   = DateTime.Now;
                objEntity.i_InsertUserId = Int32.Parse(ClientSession[2]);
                objEntity.i_IsDeleted    = 0;

                int intNodeId = int.Parse(ClientSession[0]);
                NewId0 = Common.Utils.GetNewId(intNodeId, Utils.GetNextSecuentialId(intNodeId, 356), "NÑ");;
                objEntity.v_NinioId = NewId0;

                dbContext.AddToninio(objEntity);
                dbContext.SaveChanges();

                objOperationResult.Success = 1;
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "NÑ", "v_NinioId=" + NewId0.ToString(), Success.Ok, null);
            }
            catch (Exception ex)
            {
                objOperationResult.Success          = 0;
                objOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);

                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "NÑ", "v_NinioId=" + NewId0.ToString(), Success.Failed, objOperationResult.ExceptionMessage);
            }
            return(NewId0);
        }