Exemple #1
0
        public static FTPDetail GetFTPDetail()
        {
            CauHinhEntity cauHinhEntity = ManageBase.SelectCauHinh("FTPDetail");
            FTPDetail     fTPDetail     = null;
            bool          flag          = cauHinhEntity != null;

            if (flag)
            {
                fTPDetail = JsonConvert.DeserializeObject <FTPDetail>(cauHinhEntity.GiaTri);
            }
            bool flag2 = fTPDetail != null;

            if (flag2)
            {
                fTPDetail.Pass = Util.Decrypt(fTPDetail.Pass);
            }
            return(fTPDetail);
        }
Exemple #2
0
        public static CauHinhEntity SaveCauHinh(string tenCauHinh, string giaTri)
        {
            CauHinhEntity cauHinhEntity = ManageBase.SelectCauHinh(tenCauHinh);
            bool          flag          = cauHinhEntity == null;

            if (flag)
            {
                cauHinhEntity            = new CauHinhEntity();
                cauHinhEntity.TenCauHinh = tenCauHinh;
            }
            cauHinhEntity.GiaTri      = giaTri;
            cauHinhEntity.NguoiDungId = new int?(GlobalVariable.NguoiDungId);
            using (DataAccessAdapterBase dataAccessAdapterBase = new DataAccessAdapter(ManageBase.ConnectionString))
            {
                bool flag2 = !dataAccessAdapterBase.SaveEntity(cauHinhEntity, true);
                if (flag2)
                {
                    cauHinhEntity = null;
                }
            }
            return(cauHinhEntity);
        }