Example #1
0
        public static InsightSupplierContactLicense GetInsightSupplierContactLicenseByInsightSupplierContactLicenseId(int insightSupplierContactLicenseId)
        {
            Database  db         = DatabaseFactory.CreateDatabase("SPARInsightManagement");
            string    sqlCommand = "GetInsightSupplierContactLicenseByInsightSupplierContactLicenseId";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "@InsightSupplierContactLicenseId", DbType.Int32, insightSupplierContactLicenseId);
            db.AddOutParameter(dbCommand, "@InsightSupplierContactId", DbType.Int32, 4);
            db.AddOutParameter(dbCommand, "@AccessMethodId", DbType.Int32, 4);
            db.AddOutParameter(dbCommand, "@Username", DbType.String, 100);
            db.AddOutParameter(dbCommand, "@Password", DbType.String, 100);
            db.AddOutParameter(dbCommand, "@LicenseId", DbType.Int32, 4);
            db.AddOutParameter(dbCommand, "@QlikviewVersionId", DbType.Int32, 4);

            db.ExecuteNonQuery(dbCommand);

            InsightSupplierContactLicense insightSupplierContactLicense = new InsightSupplierContactLicense();

            insightSupplierContactLicense.InsightSupplierContactLicenseId = insightSupplierContactLicenseId;
            insightSupplierContactLicense.InsightSupplierContactId        = Convert.ToInt32(db.GetParameterValue(dbCommand, "InsightSupplierContactId"));
            insightSupplierContactLicense.AccessMethodId    = Convert.ToInt32(db.GetParameterValue(dbCommand, "AccessMethodId"));
            insightSupplierContactLicense.Username          = db.GetParameterValue(dbCommand, "Username").ToString();
            insightSupplierContactLicense.Password          = db.GetParameterValue(dbCommand, "Password").ToString();
            insightSupplierContactLicense.LicenseId         = Convert.ToInt32(db.GetParameterValue(dbCommand, "LicenseId"));
            insightSupplierContactLicense.QlikviewVersionId = Convert.ToInt32(db.GetParameterValue(dbCommand, "QlikviewVersionId"));

            return(insightSupplierContactLicense);
        }
Example #2
0
        public static List <InsightSupplierContactLicense> GetInsightSupplierContactLicenseListByInsightSupplierContactId(int insightSupplierContactId)
        {
            List <InsightSupplierContactLicense> list = new List <InsightSupplierContactLicense>();

            Database  db         = DatabaseFactory.CreateDatabase("SPARInsightManagement");
            string    sqlCommand = "GetInsightSupplierContactLicenseListByInsightSupplierContactId";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "@InsightSupplierContactId", DbType.Int32, insightSupplierContactId);

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    InsightSupplierContactLicense insightSupplierContactLicense = new InsightSupplierContactLicense();
                    insightSupplierContactLicense.InsightSupplierContactId        = insightSupplierContactId;
                    insightSupplierContactLicense.InsightSupplierContactLicenseId = Convert.ToInt32(dataReader["InsightSupplierContactLicenseId"]);
                    insightSupplierContactLicense.LicenseId       = Convert.ToInt32(dataReader["LicenseId"]);
                    insightSupplierContactLicense.LicenseKey      = dataReader["LicenseKey"].ToString();
                    insightSupplierContactLicense.Control         = dataReader["Control"].ToString();
                    insightSupplierContactLicense.LEF             = dataReader["LEF"].ToString();
                    insightSupplierContactLicense.QlikviewVersion = dataReader["QlikviewVersion"].ToString();
                    insightSupplierContactLicense.Account         = dataReader["Account"].ToString();
                    list.Add(insightSupplierContactLicense);
                }
            }
            return(list);
        }
Example #3
0
        public static InsightSupplierContactLicense GetInsightSupplierContactLicenseByInsightSupplierContactIdAccessMethodId(int insightSupplierContactId, int accessMethodId)
        {
            Database  db         = DatabaseFactory.CreateDatabase("SPARInsightManagement");
            string    sqlCommand = "GetInsightSupplierContactLicenseByInsightSupplierContactIdAccessMethodId";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "@InsightSupplierContactId", DbType.Int32, insightSupplierContactId);
            db.AddInParameter(dbCommand, "@AccessMethodId", DbType.Int32, accessMethodId);
            db.AddOutParameter(dbCommand, "@InsightSupplierContactLicenseId", DbType.Int32, 4);

            db.ExecuteNonQuery(dbCommand);

            InsightSupplierContactLicense insightSupplierContactLicense = new InsightSupplierContactLicense();

            insightSupplierContactLicense.InsightSupplierContactId        = insightSupplierContactId;
            insightSupplierContactLicense.AccessMethodId                  = accessMethodId;
            insightSupplierContactLicense.InsightSupplierContactLicenseId = Convert.ToInt32(db.GetParameterValue(dbCommand, "InsightSupplierContactLicenseId"));

            return(insightSupplierContactLicense);
        }