Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MappedFields mappedFields = db.MappedFields.Find(id);

            db.MappedFields.Remove(mappedFields);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "FieldID,Field1,Field2,Field3,Field4,Field5,Field6,Field7,Field8,Field9,Field10,Field11")] MappedFields mappedFields)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mappedFields).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mappedFields));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "FieldID,Field1,Field2,Field3,Field4,Field5,Field6,Field7,Field8,Field9,Field10,Field11")] MappedFields mappedFields)
        {
            if (ModelState.IsValid)
            {
                db.MappedFields.Add(mappedFields);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(mappedFields));
        }
Ejemplo n.º 4
0
        // GET: MappedFields/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MappedFields mappedFields = db.MappedFields.Find(id);

            if (mappedFields == null)
            {
                return(HttpNotFound());
            }
            return(View(mappedFields));
        }
        private bool CompareMappedFields(MappedFields newMappedFields, MappedFields currMappedFields)
        {
            foreach (MappedField newField in newMappedFields.MappedField)
            {
                var query = currMappedFields.MappedField.Where(f =>
                                                               f.LeftName == newField.LeftName && f.MapFromSide == newField.MapFromSide &&
                                                               f.RightName == newField.RightName && f.valueMap == newField.valueMap);

                if (query.Count() == 0)
                {
                    return(false);
                }
            }

            return(true);
        }
        public void AcceptConfigViewChanges(IConfigView viewToAcceptChanges)
        {
            var connectionView = viewToAcceptChanges as PlainTextConnection;
            var mappingsView   = viewToAcceptChanges as PlainTextMappings;

            if (connectionView != null)
            {
                SourceFile    = connectionView.FileName;
                TextQualifier = connectionView.TextQualifier;
                Delimiter     = connectionView.Delimiter;
            }
            if (mappingsView != null)
            {
                MappedFields.Clear();
                foreach (var fieldMap in mappingsView.MappedFields)
                {
                    Map(fieldMap);
                }
            }
        }