Exemplo n.º 1
0
        public static void MyGetData(GridViewCustomBindingGetDataArgs e)
        {
            // Get the bl
            LicenseBL bl = new LicenseBL();

            e.Data = bl.GetLicensesByRange(e.DataRowCount, e.StartDataRowIndex, e.State.SortedColumns);
        }
Exemplo n.º 2
0
        public static void MyGetDataRowCount(GridViewCustomBindingGetDataRowCountArgs e)
        {
            // Get the bl
            LicenseBL bl = new LicenseBL();

            e.DataRowCount = bl.GetLicenseCount(e.FilterExpression);
        }
Exemplo n.º 3
0
 public LicenseProcess()
 {
     TandbergCAPrimary   = ConfigurationSettings.AppSettings["TandbergCAPrimary"];
     TandbergCASecondary = ConfigurationSettings.AppSettings["TandbergCASecondary"];
     objBL                = new LicenseBL();
     objEventLogger       = new EventLogger();
     objTransactionLogger = new TransactionLogger();
 }
Exemplo n.º 4
0
 public RMASwapBL()
 {
     connectionString      = ConfigurationSettings.AppSettings["sqlconn"];
     TSTConnectionString   = ConfigurationSettings.AppSettings["sqlconnMfgTST"];
     objCommonValidationBL = new CommonValidationBL();
     objCommonBL           = new CommonBL();
     objBL = new LicenseBL();
     objParentChildAssociationBL = new ParentChildAssociationBL();
     objEventLogger          = new EventLogger();
     objSoftDeleteLicensesBL = new SoftDeleteLicensesBL();
 }
Exemplo n.º 5
0
        //Code for RMASwap CR
        #region RMASWap
        /*new CR user logging 08/2013*/
        public string CallRMASwapLicense(string SNum, string SKUID, string SKUType, int Qty, int Index, string Version, DateTime ExpiryDate, int ShippedVersion, string requestingSystem)
        {
            string            licenseKey           = string.Empty;
            DFLicenseRequest  objDFLicenseRequest  = new DFLicenseRequest();
            DFLicenseResponse objDFLicenseResponse = new DFLicenseResponse();

            objDFLicenseRequest.RequestID        = Guid.NewGuid().ToString();
            objDFLicenseRequest.RequestingSystem = requestingSystem;//"INERNAL-REQ";
            objDFLicenseRequest.RequestDateTime  = DateTime.UtcNow;
            objDFLicenseRequest.SNum             = SNum;
            objDFLicenseRequest.SKUID            = SKUID;

            if (Qty > 0)
            {
                objDFLicenseRequest.Qty          = Qty;
                objDFLicenseRequest.QtySpecified = true;
            }
            if (Version.IsValidString())
            {
                objDFLicenseRequest.Version = Version;
            }

            if (ExpiryDate != null && ExpiryDate != DateTime.Parse("1/1/0001"))
            {
                objDFLicenseRequest.ExpDate          = ExpiryDate;
                objDFLicenseRequest.ExpDateSpecified = true;
            }
            if (Index > 0)
            {
                objDFLicenseRequest.Index          = Index;
                objDFLicenseRequest.IndexSpecified = true;
            }


            objDFLicenseResponse.RequestID      = objDFLicenseRequest.RequestID;
            objDFLicenseResponse.ResponseID     = objDFLicenseRequest.RequestID;
            objDFLicenseResponse.ResponseStatus = (int)Constants.ResponseStatus.Success;
            objBL = new LicenseBL();

            try
            {
                objDFLicenseResponse = objBL.GetRMALicense(objDFLicenseRequest, objDFLicenseResponse);
            }
            catch (Exception ex)
            {
                //SET FAILURE STATUS
                objDFLicenseResponse.ResponseStatus  = (int)Constants.ResponseStatus.ServiceUnavailable;
                objDFLicenseResponse.ResponseMessage = Constants.ResponseMessage[1000].ToString();
                objDFLicenseResponse.LicenseKey      = "";

                //LOG EXCEPTION
                objEventLogger.WriteLog("GetLicense:" + ex.Message + Environment.NewLine + ex.StackTrace, objDFLicenseRequest.RequestingSystem, DateTime.UtcNow, objDFLicenseRequest.RequestID);
            }
            finally
            {
                objDFLicenseResponse.ResponseDateTime = DateTime.UtcNow;

                //SERIALIZE REQUEST/RESPONSE
                string request  = "GetLicenseRequest";
                string response = "GetLicenseResponse";

                try
                {
                    request  = Util.SerializeObject(objDFLicenseRequest);
                    response = Util.SerializeObject(objDFLicenseResponse);
                }
                catch (Exception ex)
                {
                    objEventLogger.WriteLog("GetLicense:Request/Response Object Serialization Error: " + ex.Message + Environment.NewLine + ex.StackTrace, objDFLicenseRequest.RequestingSystem, DateTime.UtcNow, objDFLicenseRequest.RequestID);
                }

                if (!request.IsValidString())
                {
                    request = "GetLicenseRequest";
                }
                if (!response.IsValidString())
                {
                    response = "GetLicenseResponse";
                }


                //LOG REQUEST/RESPONSE
                objTransactionLogger.LogTransaction(objDFLicenseRequest.RequestID, objDFLicenseRequest.RequestDateTime, objDFLicenseRequest.RequestingSystem,
                                                    request, objDFLicenseResponse.ResponseID, objDFLicenseResponse.ResponseDateTime, response,
                                                    objDFLicenseResponse.ResponseStatus, objDFLicenseResponse.ResponseMessage, 0);

                //End Processing GetLicense
            }



            if (objDFLicenseResponse.ResponseStatus == (int)Constants.ResponseStatus.Success && !string.IsNullOrEmpty(objDFLicenseResponse.LicenseKey))
            {
                licenseKey = objDFLicenseResponse.LicenseKey;
            }
            else
            {
                licenseKey = "Fail to Generate Key";
            }


            return(licenseKey);
        }
Exemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="objDFLicenseRequest"></param>
        /// <returns></returns>
        private DFLicenseResponse GenerateNewLicense(DFLicenseRequest objDFLicenseRequest, int ShippedVersion, out int HistoricQty)
        {
            DFLicenseResponse objDFLicenseResponse = new DFLicenseResponse();

            objDFLicenseResponse.RequestID      = objDFLicenseRequest.RequestID;
            objDFLicenseResponse.ResponseID     = objDFLicenseRequest.RequestID;
            objDFLicenseResponse.ResponseStatus = (int)Constants.ResponseStatus.Success;
            objBL       = new LicenseBL();
            HistoricQty = 0;
            bool flag = ShippedVersion == 0 ? false : true;

            try
            {
                objBL.GetLicense(objDFLicenseRequest, objDFLicenseResponse, false, flag);
                HistoricQty = objBL.HistoricQty;
            }
            catch (Exception ex)
            {
                //SET FAILURE STATUS
                objDFLicenseResponse.ResponseStatus  = (int)Constants.ResponseStatus.ServiceUnavailable;
                objDFLicenseResponse.ResponseMessage = Constants.ResponseMessage[1000].ToString();
                objDFLicenseResponse.LicenseKey      = "";

                //LOG EXCEPTION
                objEventLogger.WriteLog("GetLicense:" + ex.Message + Environment.NewLine + ex.StackTrace, objDFLicenseRequest.RequestingSystem, DateTime.UtcNow, objDFLicenseRequest.RequestID);
            }
            finally
            {
                objDFLicenseResponse.ResponseDateTime = DateTime.UtcNow;

                //SERIALIZE REQUEST/RESPONSE
                string request  = "GetLicenseRequest";
                string response = "GetLicenseResponse";

                try
                {
                    request  = Util.SerializeObject(objDFLicenseRequest);
                    response = Util.SerializeObject(objDFLicenseResponse);
                }
                catch (Exception ex)
                {
                    objEventLogger.WriteLog("GetLicense:Request/Response Object Serialization Error: " + ex.Message + Environment.NewLine + ex.StackTrace, objDFLicenseRequest.RequestingSystem, DateTime.UtcNow, objDFLicenseRequest.RequestID);
                }

                if (!request.IsValidString())
                {
                    request = "GetLicenseRequest";
                }
                if (!response.IsValidString())
                {
                    response = "GetLicenseResponse";
                }


                //LOG REQUEST/RESPONSE
                objTransactionLogger.LogTransaction(objDFLicenseRequest.RequestID, objDFLicenseRequest.RequestDateTime, objDFLicenseRequest.RequestingSystem,
                                                    request, objDFLicenseResponse.ResponseID, objDFLicenseResponse.ResponseDateTime, response,
                                                    objDFLicenseResponse.ResponseStatus, objDFLicenseResponse.ResponseMessage, 0);

                //End Processing GetLicense
            }
            return(objDFLicenseResponse);
        }