public void CalificationProjectConfigValidate_Upsert()
        {
            ConfigValidateModel oReturn = new ConfigValidateModel()
            {
                CalificationProjectConfigValidateId = 0,
                CalificationProjectConfigId         = 3,
                Operator = new Company.Models.Util.CatalogModel()
                {
                    ItemId = 2001001
                },
                Value  = "10",
                Result = "5",
                Enable = true
            };

            oReturn = ProveedoresOnLine.CalificationProject.Controller.CalificationProject.CalificationProjectConfigValidate_Upsert(oReturn);
            Assert.AreEqual(true, oReturn.CalificationProjectConfigId > 0 && oReturn.CalificationProjectConfigValidateId > 0);
        }
Beispiel #2
0
        public static ConfigValidateModel CalificationProjectConfigValidate_Upsert(ConfigValidateModel oConfigValidateModel)
        {
            LogManager.Models.LogModel oLog = Company.Controller.Company.GetGenericLogModel();
            try
            {
                if (oConfigValidateModel != null)
                {
                    oConfigValidateModel.CalificationProjectConfigValidateId = DAL.Controller.CalificationProjectDataController.Instance.CalificationProjectConfigValidateUpsert
                                                                               (
                        oConfigValidateModel.CalificationProjectConfigValidateId,
                        oConfigValidateModel.CalificationProjectConfigId,
                        oConfigValidateModel.Operator.ItemId,
                        oConfigValidateModel.Value,
                        oConfigValidateModel.Result,
                        oConfigValidateModel.Enable
                                                                               );
                    oLog.IsSuccess = true;
                }
            }
            catch (Exception err)
            {
                oLog.IsSuccess = false;
                oLog.Message   = err.Message + " - " + err.StackTrace;
                throw err;
            }
            finally
            {
                oLog.LogObject = oConfigValidateModel;

                oLog.RelatedLogInfo.Add(new LogManager.Models.LogInfoModel()
                {
                    LogInfoType = "CalificationProjectValidateId",
                    Value       = oConfigValidateModel.CalificationProjectConfigValidateId.ToString(),
                });

                LogManager.ClientLog.AddLog(oLog);
            }
            return(oConfigValidateModel);
        }