Example #1
0
        private bool ValidateUser(OtherInfoModel model)
        {
            var appSettings = ConfigurationManager.AppSettings;

            if (model.UserName == appSettings.Get("userNameOtherInfo") && model.Password == appSettings.Get("passwordOtherInfo"))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        // POST: OtherInfoApi
        public OtherInfoModel Post(OtherInfoModel model)
        {
            try
            {
                List <OtherInfoRowModel> ListaCalculada = new List <OtherInfoRowModel>();

                if (ValidateUser(model))
                {
                    foreach (var otherInfo in model.OtherInfoList)
                    {
                        var otherInfoCalculated = CalculateOtherInfoFlags(otherInfo);
                        ListaCalculada.Add(otherInfoCalculated);
                    }

                    model.OtherInfoList = ListaCalculada;
                    return(model);
                }
            }
            catch (Exception exception)
            {
                return(null);
            }
            return(model);
        }