Ejemplo n.º 1
0
        private void BindFailed()
        {
            DataView dv = DBTrialRequestFailed.GetDataTable().DefaultView;

            dv.Sort               = ViewState[ConstFailedRequestSortingKey].ToString();
            dgFailed.DataSource   = dv;
            dgFailed.DataKeyField = "RequestID";
            dgFailed.DataBind();

            foreach (DataGridItem itm in dgFailed.Items)
            {
                ImageButton ib = (ImageButton)itm.FindControl("ibDelete");
                if (ib != null)
                {
                    ib.Attributes.Add("onclick", "return confirm('Do you really want to delete this failed request?')");
                }
            }
        }
Ejemplo n.º 2
0
        private TrialResult RequestTrial(
            string companyName
            , string sizeOfGroup
            , string description
            , string domain
            , string firstName
            , string lastName
            , string email
            , string phone
            , string country
            , string login
            , string password
            , string resellerGuid
            , string xml
            , string locale
            , string referrer
            , out int requestId
            , out string requestGuid
            )
        {
            TrialResult retVal = TrialResult.Failed;

            requestId   = -1;
            requestGuid = string.Empty;

            AspSettings settings = AspSettings.Load();

            domain += "." + settings.DnsParentDomain;
            try
            {
                //if (CManage.IsUserRegistered(settings, email))
                //    retVal = TrialResult.UserRegistered;
                //else
                if (CManage.CompanyExists(domain))
                {
                    retVal = TrialResult.DomainExists;
                }
                else
                {
                    requestId = DBTrialRequest.Create(
                        companyName,
                        sizeOfGroup,
                        description,
                        domain,
                        firstName,
                        lastName,
                        email,
                        phone,
                        country,
                        login,
                        password,
                        new Guid(resellerGuid),
                        xml,
                        locale
                        , referrer
                        );

                    TemplateVariables vars = DBTrialRequest.GetVariables(requestId);
                    requestGuid = vars["RequestGUID"];
                    retVal      = TrialResult.WaitingForActivation;

//					if (!string.IsNullOrEmpty(settings.OperatorEmail))
//						CManage.SendEmail(settings.OperatorEmail, EmailType.TrialNewRequest, vars);
                }
            }
            finally
            {
                if (retVal != TrialResult.Success && retVal != TrialResult.WaitingForActivation && retVal != TrialResult.RequestPending)
                {
                    object obj = null;
                    try
                    {
                        obj = new Guid(resellerGuid);
                    }
                    catch (ArgumentNullException)
                    {
                    }
                    catch (FormatException)
                    {
                    }

                    DBTrialRequestFailed.Create(
                        companyName,
                        sizeOfGroup,
                        description,
                        domain,
                        firstName,
                        lastName,
                        email,
                        phone,
                        login,
                        login,
                        password,
                        obj
                        , locale
                        , referrer
                        , (int)retVal
                        );
                }
            }
            return(retVal);
        }
Ejemplo n.º 3
0
        private void dgFailed_Delete(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            int RequestID = (int)dgFailed.DataKeys[e.Item.ItemIndex];

            DBTrialRequestFailed.Delete(RequestID);
        }