public static ColorMappingDO GetColorMappingByID(int id)
        {
            ColorMapping colorMapping = GetAllAsQueryable().Where(x => x.ID == id).SingleOrDefault();

            if (colorMapping != null)
            {
                ColorMappingDO colorMappingDO = new ColorMappingDO();
                ObjectMapper.MapObjects<ColorMapping, ColorMappingDO>(colorMapping, colorMappingDO);
                return colorMappingDO;
            }
            return null;
        }
        public ActionResult Add(ColorMappingDO model, string saveAndNewButton)
        {

            int id = ColorMappingBL.Save(model, this.UserID);
            SetSuccessMessage("Kaydedildi");
            if (string.IsNullOrEmpty(saveAndNewButton) == false)
            {
                return RedirectToAction("Add");
            }

            return RedirectToAction("Edit", new { id = id });
        }
        public static int Save(ColorMappingDO colorMappingDO, int userID)
        {
            Repository<ColorMapping> repColor = new Repository<ColorMapping>(BeymenDataContextProvider.Instance);
            ColorMapping colorMapping;

            if (colorMappingDO.ID == 0)
            {
                colorMapping = new ColorMapping();
                ObjectMapper.MapObjects<ColorMappingDO, ColorMapping>(colorMappingDO, colorMapping);
                repColor.InsertOnSubmit(colorMapping);
            }
            else
            {
                colorMapping = repColor.GetAll().Where(x => x.ID == colorMappingDO.ID).SingleOrDefault();
                ObjectMapper.MapObjects<ColorMappingDO, ColorMapping>(colorMappingDO, colorMapping);
                repColor.UpdateByIdOnSubmit(colorMapping);
            }

            repColor.DCP.CommitChanges(userID);

            return colorMapping.ID;
        }
 public ActionResult Edit(ColorMappingDO model)
 {
     ColorMappingBL.Save(model, this.UserID);
     SetSuccessMessage("Kaydedildi");
     return RedirectToAction("Edit", new { id = model.ID });
 }
        public ActionResult Add()
        {
            ColorMappingDO model = new ColorMappingDO();

            return View(model);
        }