Ejemplo n.º 1
0
        public OperationResult Insert(PROD_GROUP_INDEXModel model)
        {
            var entity = new PROD_GROUP_INDEX
            {
                ID           = model.ID,
                Name         = model.Name,
                Description  = model.Description,
                ParentID     = model.ParentID,
                ColorBg      = model.ColorBg,
                ColorText    = model.ColorText,
                Picture      = model.Picture,
                DisplayOrder = model.DisplayOrder,
                Creator      = model.Creator,
                Modifier     = model.Modifier,
                CreateDate   = model.CreateDate,
                Modidate     = model.Modidate,
                Status       = model.Status?1:0,
                Item01       = model.Item01,
                Item02       = model.Item02,
                Item03       = model.Item03,
                Item04       = model.Item04,
                Item05       = model.Item05,
            };

            PROD_GROUP_INDEXRepository.Insert(entity);
            return(new OperationResult(OperationResultType.Success, "Added successfully"));
        }
Ejemplo n.º 2
0
        public OperationResult Update(PROD_GROUP_INDEXModel model)
        {
            var entity = PROD_GROUP_INDEXList.First(t => t.ID == model.ID);

            //entity.ID = model.ID;
            entity.Name         = model.Name;
            entity.Description  = model.Description;
            entity.ParentID     = model.ParentID;
            entity.ColorBg      = model.ColorBg;
            entity.ColorText    = model.ColorText;
            entity.Picture      = model.Picture;
            entity.DisplayOrder = model.DisplayOrder;
            entity.Creator      = model.Creator;
            entity.Modifier     = model.Modifier;
            entity.CreateDate   = model.CreateDate;
            entity.Modidate     = model.Modidate;
            entity.Status       = model.Status ? 1 : 0;
            entity.Item01       = model.Item01;
            entity.Item02       = model.Item02;
            entity.Item03       = model.Item03;
            entity.Item04       = model.Item04;
            entity.Item05       = model.Item05;

            PROD_GROUP_INDEXRepository.Update(entity);
            return(new OperationResult(OperationResultType.Success, "update completed"));
        }
Ejemplo n.º 3
0
        public OperationResult Delete(string ID)
        {
            var model = PROD_GROUP_INDEXList.FirstOrDefault(t => t.ID == ID);

            PROD_GROUP_INDEXRepository.Delete(model);
            return(new OperationResult(OperationResultType.Success, "successfully deleted"));
        }