public Boolean guardar(clsBodega ctm, ref string Mensaje) { try { using (INVENTARIOEntities te = new INVENTARIOEntities()) { Bodega tm = new Bodega(); tm. IdEmpresa = Convert.ToInt32(ctm.empresa); tm.IdBodega = ctm.codigo; tm.Decripcion = ctm.descripcion; tm.Capacidadm2 = ctm.capacidadm2; tm.IdResponsable = Convert.ToInt32(ctm.responsable); tm.IdPercha = Convert.ToInt32(ctm.percha); tm.Direccion = ctm.direccion; tm.Telefono = ctm.telefono; tm.IdEstado = Convert.ToInt32(ctm.estado); te.AddToBodega(tm); te.SaveChanges(); } return true; } catch (Exception e) { Mensaje = "ERROR" + e.InnerException + e.Message; //System.Windows.Forms.MessageBox.Show("error al guardar" + e); return false; } }