Beispiel #1
0
 /// <summary>
 /// ������CreateUserWizard�򵼵���һ����ťʱ�������¼�
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void CreateUserWizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
 {
     //�����ҳ���ڵڶ�ҳ�����û��ڵ�һҳ���� ���FirstName��LastName���浽ViewState�С�
     if (CreateUserWizard1.ActiveStep.ID == "WizardStep2")
     {
         TextBox t = ((TextBox)CreateUserWizard1.ActiveStep.FindControl("TextBox1"));
         ViewState["firstname"]=t.Text;
         t = ((TextBox)CreateUserWizard1.ActiveStep.FindControl("TextBox2"));
         ViewState["lastname"]=t.Text;
     }
     //����л���ѡ���ɫ����ʱ����ʱ�û������ɹ�����������¼�����û���Ϣ���浽���Ի��С�
     if (CreateUserWizard1.ActiveStep.ID == "WizardStep1")
     {
         //��ȡ��ǰ��¼���û���
         MembershipUser objUser = Membership.GetUser();
         //��ȡ��ɫѡ��DropDownList��
         DropDownList ddl = ((DropDownList)CreateUserWizard1.ActiveStep.FindControl("DropDownList1"));
         if (ddl != null)
         {
             //���ָ�µ��û���ָ���Ľ�ɫ
             Roles.AddUserToRole(objUser.UserName, ddl.SelectedValue);
         }
         //������Ի���Ϣ
         Profile.UserName = objUser.UserName;
         Profile.Email = objUser.Email;
         Profile.FirstName=ViewState["firstname"].ToString();
         Profile.LastName=ViewState["lastname"].ToString();
         Profile.JobSeeker.ResumeID = -1;
         Profile.Employer.CompanyID = -1;
     }
 }
    protected void CreateUserWizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        TextBox TextBoxNume = CreateUserWizard1.FindControl("TextBoxNume") as TextBox;
        if (TextBoxNume != null) {
            Profile.Nume = TextBoxNume.Text;
        }
        TextBox TextBoxPrenume = CreateUserWizard1.FindControl("TextBoxPrenume") as TextBox;
        if (TextBoxPrenume != null) {
            Profile.Prenume = TextBoxPrenume.Text;
        }
        TextBox TextBoxOras = CreateUserWizard1.FindControl("TextBoxOras") as TextBox;
        if (TextBoxOras != null) {
            Profile.Oras = TextBoxOras.Text;
        }

        RadioButtonList RadioButtonListSex = CreateUserWizard1.FindControl("RadioButtonListSex") as RadioButtonList;
        if (RadioButtonListSex != null) {
            Profile.Sex = Int32.Parse(RadioButtonListSex.SelectedValue);
        }

        TextBox TextBoxDataNasterii = CreateUserWizard1.FindControl("TextBoxDataNasterii") as TextBox;
        if (TextBoxDataNasterii != null) {
            Profile.DataNasterii = DateTime.Parse(TextBoxDataNasterii.Text);
        }
    }
 protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     ResultLabel.Text = "Your name is "
         + YourNameTextBox.Text
         + "<br />Your favourite language is "
         + FavoriteLanguageDropDownList.SelectedValue;
 }
Beispiel #4
0
    protected void CreateUserWizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        if (Page.IsValid)
        {

        }
    }
    protected void SuperCopyWizard_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        if (SuperCopyWizard.ActiveStepIndex == 0)
        {
            //The user clicked next on the first step, get the second step ready to go
            //Save the selected channel name
            m_CurrentChannelID = int.Parse(uxChannel.SelectedValue);
            m_CurrentChannelName = uxChannel.SelectedItem.Text;

            //Set the text of the various labels
            uxChannelName2.Text = m_CurrentChannelName;
            uxCurrentChannelName.Text = m_CurrentChannelName;
            uxSourceDateName.Text = uxSourceDay.SelectedDate.ToShortDateString();
            uxDestStartDate.Text = uxSourceDay.SelectedDate.AddDays(1).ToShortDateString();
            uxDestEndDate.Text = uxEndDate.SelectedDate.ToShortDateString();

            //Set the highest step completed
            m_StepCompleted = 1;
        }

        if (SuperCopyWizard.ActiveStepIndex == 1)
        {
            //The user clicked next on the second step, actually perform the manipulation

            ClearAndCopyRuns();

            //Set the highest step completed
            m_StepCompleted = 2;
        }
    }
    protected void CreateUserWizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        if (CreateUserWizard1.ActiveStep.ID == "WizardStep2")
        {
            TextBox t = ((TextBox)CreateUserWizard1.ActiveStep.FindControl("TextBox1"));
            ViewState["firstname"]=t.Text;
            t = ((TextBox)CreateUserWizard1.ActiveStep.FindControl("TextBox2"));
            ViewState["lastname"]=t.Text;
        }

        if (CreateUserWizard1.ActiveStep.ID == "WizardStep1")
        {
            MembershipUser objUser = Membership.GetUser();
            DropDownList ddl = ((DropDownList)CreateUserWizard1.ActiveStep.FindControl("DropDownList1"));
            if (ddl != null)
            {
                Roles.AddUserToRole(objUser.UserName, ddl.SelectedValue);
            }
            Profile.UserName = objUser.UserName;
            Profile.Email = objUser.Email;
            Profile.FirstName=ViewState["firstname"].ToString();
            Profile.LastName=ViewState["lastname"].ToString();
            Profile.JobSeeker.ResumeID = -1;
            Profile.Employer.CompanyID = -1;
        }
    }
    /// <summary>
    /// Handles the FinishButtonClick event of the Wizard1 control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.Web.UI.WebControls.WizardNavigationEventArgs"/> instance containing the event data.</param>
    protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        try
        {
            Customer myCustomer = new Customer();
            myCustomer.Username = txtUsername.Text;
            myCustomer.Address1 = txtAddress1.Text;
            myCustomer.City = txtCity.Text;
            myCustomer.Country = drpDwnCountry.SelectedValue;
            myCustomer.CreditCardType = drpDwnCredit.SelectedValue;
            myCustomer.FirstName = txtFirstName.Text;
            myCustomer.LastName = txtLastName.Text;
            myCustomer.Age = Convert.ToInt32(txtAge.Text);
            myCustomer.MailCode = txtPostalCode.Text;
            myCustomer.Region = txtRegion.Text;
            myCustomer.Email = txtEmail.Text;
            myCustomer.Password = txtPassword.Text;
            myCustomer.Register();

            if (myCustomer.CustomerID < 0)
                throw new Exception();
            else
                lblStatus.Text = " Customer " + myCustomer.CustomerID + " Registered!";
        }
        catch (Exception ex)
        {
            String strEx = ex.Message;
            lblStatus.Text = "Problem Registering, Try Again? " + strEx;
        }
    }
Beispiel #8
0
        public void wzCouponAdd_OnFinishButtonClick(object sender, WizardNavigationEventArgs e)
        {
            CouponData couponData = new CouponData();
            //type data
            couponData.Code = this.ClientData.TypeData.Code;
            couponData.CurrencyId = this.ClientData.TypeData.CurrencyID;
            couponData.Description = this.ClientData.TypeData.Description.Replace(">", "").Replace("<", "");
            couponData.IsActive = this.ClientData.TypeData.Enabled;
            couponData.DiscountType = this.ClientData.TypeData.CouponType == TypeClientData.CouponTypes.Amount ? EkEnumeration.CouponDiscountType.Amount : EkEnumeration.CouponDiscountType.Percent;

            //discount
            switch(this.ClientData.TypeData.CouponType)
            {
                case TypeClientData.CouponTypes.Amount:
                    couponData.DiscountValue = this.ClientData.AmountData.Amount;
                    couponData.MaximumAmount = 0; //set maximum amount to zero since discount type is amount
                    break;
                case TypeClientData.CouponTypes.Percent:
                    couponData.DiscountValue = this.ClientData.PercentData.Percent;
                    couponData.MaximumAmount = this.ClientData.PercentData.MaxRedemptionAmount;
                    break;
            }

            //scope type
            switch (this.ClientData.ScopeData.CouponScope)
            {
                case CouponScope.EntireBasket:
                    couponData.CouponType = EkEnumeration.CouponType.BasketLevel;
                    break;
                case CouponScope.AllApprovedItems:
                    couponData.CouponType = EkEnumeration.CouponType.AllItems;
                    break;
                case CouponScope.MostExpensiveItem:
                    couponData.CouponType = EkEnumeration.CouponType.MostExpensiveItem;
                    break;
                case CouponScope.LeastExpensiveItem:
                    couponData.CouponType = EkEnumeration.CouponType.LeastExpensiveItem;
                    break;
            }

            //scope
            couponData.ExpirationDate = this.ClientData.ScopeData.ExpirationDate;
            couponData.StartDate = this.ClientData.ScopeData.StartDate;
            couponData.OnePerCustomer = this.ClientData.ScopeData.IsOnePerCustomer;
            couponData.MinimumAmount = this.ClientData.ScopeData.MinBasketValue;
            couponData.MaximumUses = this.ClientData.ScopeData.MaxRedemptions;
            couponData.IsCombinable = this.ClientData.ScopeData.IsCombinable;
            couponData.IsApplicabletoSubscriptions = this.ClientData.ScopeData.IsApplicabletoSubscriptions;
            couponData.AppliesToQuantity = this.ClientData.ScopeData.IsApplicabletoallQuantities;

            //add coupon
            _CouponApi.Add(couponData);

            //set coupon id for finish ascx
            ucFinish.CouponId = couponData.Id;

            //set items associated with coupon
            base.SetCouponItems(this.ClientData.ScopeData.CouponScope, couponData, this.ClientData.ItemsData);
        }
 protected void CreateUserWizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     if (ddl_Staff.SelectedValue != "")
     {
         UserBLL.Membership_SetStaffID(CreateUserWizard1.UserName, int.Parse(ddl_Staff.SelectedValue));
         Roles.AddUserToRole(CreateUserWizard1.UserName, "全体员工");
     }
 }
Beispiel #10
0
    protected void Wizard1_NextButtonClick (object sender, WizardNavigationEventArgs e)
    {
        int checkstep = e.CurrentStepIndex;
        VerifyStep(e, checkstep);
        if (e.Cancel)
            Wizard1.ActiveStepIndex = checkstep;

        RefreshSummary();

    }
    protected void CreateUserWizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        RealStateDSTableAdapters.aspnet_UsersInRolesTableAdapter adapter = new RealStateDSTableAdapters.aspnet_UsersInRolesTableAdapter();
        string SRoleID = Convert.ToString(adapter.QueryRoleIDByRoleName(this.DropDownList1.SelectedValue));
        string SUserID = Convert.ToString(adapter.QueryUserIDByUserName(this.User.Identity.Name));

        System.Guid UserID = new Guid(SUserID);
        System.Guid RoleID = new Guid(SRoleID);

        adapter.InsertUserInRole(UserID, RoleID);
    }
 protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
 {
     if (DetailsView1.CurrentMode == DetailsViewMode.Insert)
     {
         DetailsView1.InsertItem(true);
     }
     else if (DetailsView1.CurrentMode == DetailsViewMode.Edit)
         DetailsView1.UpdateItem(true);
     GridView1.DataBind();
     ModalPopupExtender1.Show();
 }
    protected void Checkout_Wizard_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        Profile.Cart.Items.Clear();

        Profile.Name = txtName.Text;
        Profile.Address = txtAddress.Text;
        Profile.City = txtCity.Text;
        Profile.State = txtState.Text;
        Profile.PostCode = txtPostCode.Text;
        Profile.Country = txtCountry.Text;

        Server.Transfer("~/Pages/StampCatalogue.aspx");
    }
Beispiel #14
0
    protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        switch (e.CurrentStepIndex)
        {
            case 1: return;

            case 2: return;

            case 3: return;

            case 4: return;
        }
    }
 protected void checkoutWizard_NextButtonClick(object sender, WizardNavigationEventArgs e)
 {
     switch (e.NextStepIndex) {
         case 1:
             SetItemList();
             break;
         case 2:
             SetQuantity();
             break;
         case 3:
             SetDespatchAddress();
             break;
     }
 }
Beispiel #16
0
 protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
 {
     //如果当前页面是第一页
     if (Wizard1.ActiveStepIndex == 0)
     {
         Session["RealName"] = TextBox1.Text;
         Session["Email"] = TextBox2.Text;
     }
     //如果当前页面是第二页
     if (Wizard1.ActiveStepIndex == 1)
     {
         Session["UserName"] = TextBox3.Text;
         Session["Password"] = TextBox4.Text;
     }
 }
    protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        string a = Session[0].ToString();
        int SectionId = int.Parse(Session["SectionId"].ToString());
        WorkingHours[] wh = WorkingHours.GetBySectionId(SectionId);

        int TemplateId = int.Parse(TemplateDropDownList.SelectedValue);
        TimeTableListView.GroupItemCount = TimeTableTemplate.GetNoOfPeriods(TemplateId);

        if (wh == null || wh.Length != (6 * TimeTableTemplate.GetNoOfPeriods((int)Section.GetTemplateId(SectionId))))
        {
            WorkingHours.CreateEmptyCells(SectionId, TemplateId);
            EmptyCellsCreated = true;
        }
        ModalPopupExtender1.Show();
    }
    protected void Wizard1_FinishButtonClick1(object sender, WizardNavigationEventArgs e)
    {
        string fileName = Server.MapPath("~/App_Data/comments.txt");
        string MailBody = System.IO.File.ReadAllText(fileName);
        MailBody = MailBody.Replace("##Name##", txtName.Text);
        MailBody = MailBody.Replace("##Email##", txtEmail.Text);
        MailBody = MailBody.Replace("##Rating##", txtRating.Text);
        MailBody = MailBody.Replace("##Comments##", txtComments.Text);

        MailMessage myMessage = new MailMessage();
        myMessage.Subject = "Enquiry";
        myMessage.Body = MailBody;
        myMessage.From = new MailAddress(txtEmail.Text.Trim());
        myMessage.To.Add(new MailAddress("*****@*****.**"));
        SmtpClient mySmtpClient = new SmtpClient();
        mySmtpClient.Send(myMessage);
    }
    protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        ShoppingCart.ShippingInfo shippingInfo = new ShoppingCart.ShippingInfo();
        shippingInfo.FirstName = txtFirstName.Text;
        shippingInfo.LastName = txtLastName.Text;
        shippingInfo.Address = txtAddress.Text;
        shippingInfo.PostCode = txtPostalCode.Text;
        shippingInfo.City = txtCity.Text;
        shippingInfo.Country = txtCountry.Text;
        shippingInfo.Email = txtEmail.Text;
        shippingInfo.Phone = txtPhone.Text;

        Profile.ShoppingCart.setShippingInfo(shippingInfo);
        Payment pp_payment = new Payment(this.Page, ltlEncrypted);
        //pp_payment.registerAndSubmitPPForm(Profile.User.ShoppingCart);

        String testStop = "Stop Here";
    }
Beispiel #20
0
 protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     if (CheckBox1.Checked)
     {
         string str = "Dear " + TextBox1.Text + " " +
             TextBox2.Text + ", your ticket from";
         str += DropDownList2.SelectedValue +
             " to " + DropDownList1.SelectedValue;
         str += " on " +
             Calendar1.SelectedDate.ToShortDateString() +
             " for " + DropDownList3.SelectedValue;
         str += " people has been booked";
         Label1.Text = str;
     }
     else
     {
         Label1.Text = "Please visit again";
     }
 }
    protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        con = new SqlConnection(WebConfigurationManager.ConnectionStrings["myConnectionString"].ToString());
        con.Open();
        //Object for card detail validation
        BookingService cardAuth = new BookingService();
        bool auth = cardAuth.CheckCard(txtCardNumber.Text, txtCVV.Text);
        if(txtMatchId.Text.Trim()=="" || txtSeats.Text.Trim()=="" || txtAmount.Text.Trim()=="" || txtCardNumber.Text.Trim()=="" || txtCVV.Text.Trim()=="")
            lblError.Text = "Please fill all the given fields";
        else if (auth)
        {
            lblError.Text = "";
            //Query to get the user id from DB
            string query = string.Format("SELECT user_id FROM users WHERE user_name='{0}'", Session["UserName"].ToString());
            da = new SqlDataAdapter(query, con);
            dt = new DataTable();
            da.Fill(dt);

            int user_id = Convert.ToInt32(dt.Rows[0]["user_id"].ToString());
            int match_id = Convert.ToInt32(txtMatchId.Text);
            int amount = Convert.ToInt32(txtSeats.Text) * 1500;
            string card_type;

            if (rdoCreditCard.Checked == true)
                card_type = rdoCreditCard.Text;
            else
                card_type = rdoDebitCard.Text;

            //Inserting payment details after all the validations.
            query = string.Format("INSERT INTO booking VALUES({0},{1},{2},{3},'{4}')", user_id, match_id, amount, Convert.ToInt32(txtSeats.Text), card_type);

            //Executing query
            da = new SqlDataAdapter(query, con);
            dt = new DataTable();
            da.Fill(dt);
            lblError.Text = "Booking successfull. You'll recieve your tickets through postal mail in few days";
        }
        else
        {
            lblError.Text = "Please press on \"Validate Card\" button to get your card verified.";
        }
    }
Beispiel #22
0
    protected void CreateUserWizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        conn = new MySql.Data.MySqlClient.MySqlConnection();
            conn.ConnectionString = myConnectionString;

            MySqlCommand cmd = new MySqlCommand("Insert INTO Klient(id_klient, Imie, Nazwisko, Nr_telefonu, Mail,Status_id_status) VALUES (@id_klient,@Imie,@Nazwisko, @Nr_telefonu,@Mail,@Status) ", conn);

            cmd.CommandType = CommandType.Text;
            //specify the data to be inserted into the table
            cmd.Parameters.AddWithValue("@id_klient", Membership.GetUser(CreateUserWizard1.UserName).ProviderUserKey);
            cmd.Parameters.AddWithValue("@Imie", txtImie.Text);
            cmd.Parameters.AddWithValue("@Nazwisko", txtNazwisko.Text);
            cmd.Parameters.AddWithValue("@Nr_telefonu", txtTel.Text);
            cmd.Parameters.AddWithValue("@Mail", Membership.GetUser().Email);
            cmd.Parameters.AddWithValue("@Status", 1);

            conn.Open();
            cmd.ExecuteNonQuery();
            conn.Close();
    }
Beispiel #23
0
    protected void Wizard1_FinishButtonClick (object sender, WizardNavigationEventArgs e)
    {
        RefreshSummary();
        for (int i = 0; i < Wizard1.WizardSteps.Count; ++i)
        {
            VerifyStep(e, i);
            if (e.Cancel)
            {
                e.Cancel = false;
                Wizard1.FinishDestinationPageUrl = "";
                Wizard1.ActiveStepIndex = i;
                return;
            }
        }

        Person reciever = Person.FromIdentity(recieverPersonID);
        string msg = SummaryPanel.InnerHtml.Replace("\r", "").Replace("<br />", "\r\n");
        reciever.SendNotice("Beställning Fraktdokument", msg, Organization.PPSEid);
        Wizard1.FinishDestinationPageUrl = "DHL.aspx?Steps=Done";
    }
Beispiel #24
0
	protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
	{
		StringBuilder sb = new StringBuilder();
		sb.Append("You chose: <br />");
		sb.Append("Programming Language: ");
		sb.Append(lstLanguage.Text);
		sb.Append("<br />Total Employees: ");
		sb.Append(txtEmpCount.Text);
		sb.Append("<br />Total Locations: ");
		sb.Append(txtLocCount.Text);
		sb.Append("<br />Licenses Required: ");
		foreach (ListItem item in lstTools.Items)
		{
			if (item.Selected)
			{
				sb.Append(item.Text);
				sb.Append(" ");
			}
		}
		lblSummary.Text = sb.ToString();
	}
    /// <summary>
    /// Handles the FinishButtonClick event of the wzrdUpdate control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.Web.UI.WebControls.WizardNavigationEventArgs"/> instance containing the event data.</param>
    protected void wzrdUpdate_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        try
        {
            Customer myCust = new Customer();
            myCust.CustomerID = Convert.ToInt32(Session["CustomerID"]);
            myCust.Username = txtUsername.Text;
            myCust.FirstName = txtFirstName.Text;
            myCust.LastName = txtLastName.Text;
            myCust.Email = txtEmail.Text;
            myCust.Age = Convert.ToInt32(txtAge.Text);
            myCust.Address1 = txtAddress1.Text;
            myCust.City = txtCity.Text;
            myCust.MailCode = txtPostal.Text;
            myCust.Region = txtRegion.Text;
            myCust.Password = txtPassword.Text;
            myCust.CreditCardType = drpDwnCredit.Text;
            myCust.Country = drpDwnCountry.Text;

            if (myCust.UpdateCurrentProfile() > 0)
            {
                lblStatus.ForeColor = System.Drawing.Color.Green;
                lblStatus.Text = "User " + txtUsername.Text + " updated!";
                wzrdUpdate.ActiveStepIndex = 0;
            }
            else
            {
                lblStatus.ForeColor = System.Drawing.Color.Red;
                lblStatus.Text = "Update Failed - Check Data";
            }
        }
        catch (Exception ex)
        {
            lblStatus.ForeColor = System.Drawing.Color.Red;
            lblStatus.Text = "Problem Updating - " + ex.Message;
        }
    }
    protected void OrderWizard_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        string user_id = Global.GetUserID();

            MySqlConnection con = DB.getNewConnection();
            string sql = "SELECT * FROM carts WHERE user_id = " + user_id;

            con.Open();
            MySqlCommand cmd = new MySqlCommand(sql, con);
            MySqlDataReader reader = cmd.ExecuteReader();

            bool okToOrder = true;

            lock(Global.dbMutex) {

                while (reader.Read())
                {
                    int mobile_device_id = (int)reader["mobile_device_id"];
                    int amount = (int)reader["amount"];

                    if (amount > DB.FetchAvailable(mobile_device_id))
                    {
                        okToOrder = false;
                    }
                }

                if (okToOrder) PlaceOrder(user_id);
            }

            if (!okToOrder) { /* TODO error msg */ }

            reader.Close();
            con.Close();

            if (okToOrder) Response.Redirect(Request.Url.ToString());
    }
Beispiel #27
0
 /// <summary>
 /// The create user wizard 1_ previous button click.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 protected void CreateUserWizard1_PreviousButtonClick(
     [NotNull] object sender,
     [NotNull] WizardNavigationEventArgs e)
 {
 }
Beispiel #28
0
        /// <summary>
        /// The wizard_ next button click.
        /// </summary>
        /// <param name="sender">
        /// The source of the event.
        /// </param>
        /// <param name="e">
        /// The <see cref="System.Web.UI.WebControls.WizardNavigationEventArgs"/> instance containing the event data.
        /// </param>
        protected void Wizard_NextButtonClick([NotNull] object sender, [NotNull] WizardNavigationEventArgs e)
        {
            e.Cancel = true;

            switch (this.CurrentWizardStepID)
            {
            case "WizValidatePermission":
                e.Cancel = false;
                break;

            case "WizDatabaseConnection":

                // save the database settings...
                UpdateDBFailureType type = this.UpdateDatabaseConnection();
                e.Cancel = false;

                switch (type)
                {
                case UpdateDBFailureType.None:
                    this.CurrentWizardStepID = "WizTestSettings";
                    break;

                case UpdateDBFailureType.AppSettingsWrite:
                    this.NoWriteAppSettingsHolder.Visible = true;
                    break;

                case UpdateDBFailureType.ConnectionStringWrite:
                    this.NoWriteDBSettingsHolder.Visible = true;
                    this.lblDBConnStringName.Text        = Config.ConnectionStringName;
                    this.lblDBConnStringValue.Text       = this.CurrentConnString;
                    break;
                }

                break;

            case "WizManualDatabaseConnection":
                e.Cancel = false;
                break;

            case "WizCreatePassword":
                if (this.txtCreatePassword1.Text.Trim() == string.Empty)
                {
                    this.AddLoadMessage("Please enter a configuration password.");
                    break;
                }

                if (this.txtCreatePassword2.Text != this.txtCreatePassword1.Text)
                {
                    this.AddLoadMessage("Verification is not the same as your password.");
                    break;
                }

                e.Cancel = false;

                if (this._config.TrustLevel >= AspNetHostingPermissionLevel.High &&
                    this._config.WriteAppSetting(_AppPasswordKey, this.txtCreatePassword1.Text))
                {
                    // advance to the testing section since the password is now set...
                    this.CurrentWizardStepID = "WizDatabaseConnection";
                }
                else
                {
                    this.CurrentWizardStepID = "WizManuallySetPassword";
                }

                break;

            case "WizManuallySetPassword":
                if (this.IsInstalled)
                {
                    e.Cancel = false;
                }
                else
                {
                    this.AddLoadMessage(
                        "You must update your appSettings with the YAF.ConfigPassword Key to continue. NOTE: The key name is case sensitive.");
                }

                break;

            case "WizTestSettings":
                e.Cancel = false;
                break;

            case "WizEnterPassword":
                if (this._config.GetConfigValueAsString(_AppPasswordKey)
                    == FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtEnteredPassword.Text, "md5") ||
                    this._config.GetConfigValueAsString(_AppPasswordKey) == this.txtEnteredPassword.Text.Trim())
                {
                    e.Cancel = false;

                    // move to test settings...
                    this.CurrentWizardStepID = "WizTestSettings";
                }
                else
                {
                    this.AddLoadMessage("Wrong password!");
                }

                break;

            case "WizCreateForum":
                if (this.CreateForum())
                {
                    e.Cancel = false;
                }

                break;

            case "WizInitDatabase":
                if (this.InstallUpgradeService.UpgradeDatabase(this.FullTextSupport.Checked, this.UpgradeExtensions.Checked))
                {
                    e.Cancel = false;
                }

                // Check if BaskeUrlMask is set and if not automatically write it
                if (this._config.GetConfigValueAsString(_AppBaseUrlMaskKey).IsNotSet() && this._config.TrustLevel >= AspNetHostingPermissionLevel.High)
                {
#if DEBUG
                    var urlKey =
                        "http://{0}{1}/".FormatWith(
                            HttpContext.Current.Request.ServerVariables["SERVER_NAME"],
                            HttpContext.Current.Request.ServerVariables["SERVER_PORT"].Equals("80")
                                    ? string.Empty
                                    : ":{0}".FormatWith(HttpContext.Current.Request.ServerVariables["SERVER_PORT"]));
#else
                    var urlKey =
                        "http://{0}/".FormatWith(
                            HttpContext.Current.Request.ServerVariables["SERVER_NAME"]);
#endif

                    this._config.WriteAppSetting(_AppBaseUrlMaskKey, urlKey);
                }

                var messages = this.InstallUpgradeService.Messages;

                if (messages.Any())
                {
                    this._loadMessage += messages.ToDelimitedString("\r\n");
                }

                break;

            case "WizMigrateUsers":

                // migrate users/roles only if user does not want to skip
                if (!this.skipMigration.Checked)
                {
                    RoleMembershipHelper.SyncRoles(this.PageBoardID);

                    // start the background migration task...
                    this.Get <ITaskModuleManager>().Start <MigrateUsersTask>(this.PageBoardID);
                }

                e.Cancel = false;
                break;

            case "WizFinished":
                break;

            default:
                throw new ApplicationException(
                          "Installation Wizard step not handled: {0}".FormatWith(
                              this.InstallWizard.WizardSteps[e.CurrentStepIndex].ID));
            }
        }
Beispiel #29
0
    /// <summary>
    /// Next step button click.
    /// </summary>
    protected void wzdInstaller_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        bool validationResult = true;

        switch (wzdInstaller.ActiveStepIndex)
        {
        case 0:
            validationResult = CheckSqlSettings();
            break;

        case 1:
        case COLLATION_DIALOG_INDEX:
            validationResult = databaseDialog.ValidateForSeparation();

            if (validationResult && databaseDialog.UseExistingChecked)
            {
                var connectionString = databaseDialog.ConnectionString;
                var databaseName     = databaseDialog.ExistingDatabaseName;

                string collation = DatabaseHelper.GetDatabaseCollation(connectionString);
                DatabaseHelper.DatabaseCollation = collation;

                if (wzdInstaller.ActiveStepIndex != COLLATION_DIALOG_INDEX)
                {
                    // Check target database collation and inform the user if it is not fully supported
                    if (!DatabaseHelper.IsSupportedDatabaseCollation(collation))
                    {
                        ucCollationDialog.IsSqlAzure = AzureHelper.IsSQLAzureServer(userServer.ServerName);
                        ucCollationDialog.Collation  = collation;
                        ucCollationDialog.InitControls();

                        // Move to "collation dialog" step
                        wzdInstaller.ActiveStepIndex = COLLATION_DIALOG_INDEX;
                        return;
                    }
                }
                else
                {
                    // Change database collation for regular database
                    if (ucCollationDialog.ChangeCollationRequested)
                    {
                        DatabaseHelper.ChangeDatabaseCollation(connectionString, databaseName, DatabaseHelper.DEFAULT_DB_COLLATION);
                    }
                }
            }

            // Move to "progress" step
            wzdInstaller.ActiveStepIndex = 2;
            break;
        }

        if (!validationResult)
        {
            e.Cancel = true;
        }
        else
        {
            databaseDialog.TasksManuallyStopped = false;
            RunAction();
        }
    }
Beispiel #30
0
 protected void Wizard1_SideBarButtonClick(object sender, WizardNavigationEventArgs e)
 {
 }
Beispiel #31
0
 protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
 }
Beispiel #32
0
 private void wzdExport_PreviousButtonClick(object sender, WizardNavigationEventArgs e)
 {
     wzdExport.ActiveStepIndex = e.NextStepIndex;
 }
Beispiel #33
0
    /*protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
     * {
     *  string str = args.Value;
     *  DateTime t;
     *  try
     *  {
     *
     *      t = Convert.ToDateTime(str);
     *      if (t > new DateTime(2009, 1, 1))
     *      {
     *          args.IsValid = false;
     *      }
     *      else
     *      {
     *          args.IsValid = true;
     *      }
     *  }
     *  catch (Exception ex)
     *  {
     *      args.IsValid = false;
     *      return;
     *  }
     *
     *
     * }*/
    //注册
    protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        //创建一个学生对象
        Student s = new Student();

        //添加学生登录信息
        s.StuNo  = txtStuNo.Text;
        s.StuPwd = txtPwd.Text;
        //添加学生基本信息
        s.StuName = txtStuName.Text;
        if (rbMan.Checked)
        {
            s.StuSex = true;
        }
        else if (rbWoman.Checked)
        {
            s.StuSex = false;
        }
        s.StuBirthday = Convert.ToDateTime(txtBirthday.Text);
        s.StuAddress  = txtAddress.Text;
        s.StuPost     = txtPost.Text;
        s.StuEmail    = txtEmail.Text;
        s.StuTel      = txtTel.Text;
        s.StuMobile   = txtMobile.Text;
        if (cbPhisical.Checked)
        {
            s.StuHobbies += cbPhisical.Text + ";";
        }
        if (cbTories.Checked)
        {
            s.StuHobbies += cbTories.Text + ";";
        }
        if (cbReading.Checked)
        {
            s.StuHobbies += cbReading.Text + ";";
        }
        if (cbNetwork.Checked)
        {
            s.StuHobbies += cbNetwork.Text + ";";
        }
        if (cbOther.Checked)
        {
            s.StuHobbies += cbOther.Text + ";";
        }
        s.StuTheme = rblSkin.SelectedValue;                  //rblSkin.SelectedItem.Text;
        for (int i = 0; i < cblExpenseArea.Items.Count; i++) //获取学生的消费领域,中间用;隔开
        {
            if (cblExpenseArea.Items[i].Selected)
            {
                s.StuExpenseArea += cblExpenseArea.Items[i].Text + ";";
            }
        }
        //添加学生班级信息
        s.ClassCode = lbClass.SelectedValue;
        //获取上传照片的照片
        string fileName = "";

        if (fuPhoto.FileName != "" && fuPhoto.FileName != null)
        {
            fileName = fuPhoto.FileName;
            string[] file_ext = fileName.Split('.');
            fileName = s.StuNo + "." + file_ext[file_ext.Length - 1];
            string filePath = Server.MapPath("Photos\\") + fileName;
            fuPhoto.SaveAs(filePath);
        }
        s.StuPhotoUrl = "Photos\\" + fileName;
        s.RegDate     = System.DateTime.Now.Date;
        s.Role        = false;
        int ret = s.Register();

        if (ret == 1)
        {
            labRegSuccess.Text = "注册成功";
        }
        else
        {
            labRegSuccess.Text = "注册失败";
        }
    }
        /// <summary>
        /// Process the order
        /// </summary>
        protected void wzdCheckOut_FinishButtonClick(object sender, WizardNavigationEventArgs e)
        {
            using (var context = new PetShopDataContext())
            {
                var profile = context.Profile.GetProfile(User.Identity.Name);
                if (profile.ShoppingCart.Count > 0)
                {
                    // display ordered items
                    CartListOrdered.Bind(profile.ShoppingCart);

                    // display total and credit card information
                    ltlTotalComplete.Text      = ltlTotal.Text;
                    ltlCreditCardComplete.Text = ltlCreditCard.Text;

                    #region Create Order

                    var order = new Order();

                    order.UserId              = profile.UniqueID.ToString();
                    order.OrderDate           = DateTime.Now;
                    order.CreditCard          = GetCreditCard();
                    order.Courier             = order.CreditCard.CardType;
                    order.TotalPrice          = CartHelper.GetTotal(profile.ShoppingCart);
                    order.AuthorizationNumber = 0;
                    order.Locale              = "en-us";

                    #region Shipping Information

                    order.ShipAddr1       = billingForm.Address.Address1;
                    order.ShipAddr2       = billingForm.Address.Address2;
                    order.ShipCity        = billingForm.Address.City;
                    order.ShipState       = billingForm.Address.State;
                    order.ShipZip         = billingForm.Address.Zip;
                    order.ShipCountry     = billingForm.Address.Country;
                    order.ShipToFirstName = billingForm.Address.FirstName;
                    order.ShipToLastName  = billingForm.Address.LastName;

                    #endregion

                    #region Billing Information

                    order.BillAddr1       = shippingForm.Address.Address1;
                    order.BillAddr2       = shippingForm.Address.Address2;
                    order.BillCity        = shippingForm.Address.City;
                    order.BillState       = shippingForm.Address.State;
                    order.BillZip         = shippingForm.Address.Zip;
                    order.BillCountry     = shippingForm.Address.Country;
                    order.BillToFirstName = shippingForm.Address.FirstName;
                    order.BillToLastName  = shippingForm.Address.LastName;

                    #endregion
                    context.Order.InsertOnSubmit(order);
                    context.SubmitChanges();

                    #endregion

                    int itemsOnBackOrder = 0;
                    //Decrement and check the Inventory.
                    foreach (Cart cart in profile.ShoppingCart)
                    {
                        var inventory = context.Inventory.GetByKey(cart.ItemId);

                        if (cart.Quantity > inventory.Qty)
                        {
                            itemsOnBackOrder += cart.Quantity - inventory.Qty;
                        }

                        inventory.Qty -= cart.Quantity;
                        context.SubmitChanges();
                    }

                    if (itemsOnBackOrder > 0)
                    {
                        ItemsOnBackOrder.Text = string.Format("<br /><p style=\"color:red;\"><b>Backorder ALERT:</b> {0} items are on backorder.</p>", itemsOnBackOrder);
                    }

                    CartHelper.SaveOrderLineItems(profile.ShoppingCart, order.OrderId);

                    // destroy cart
                    CartHelper.ClearCart(profile.ShoppingCart);
                }
                else
                {
                    lblMsg.Text =
                        "<p><br>Can not process the order. Your cart is empty.</p><p class=SignUpLabel><a class=linkNewUser href=Default.aspx>Continue shopping</a></p>";
                    wzdCheckOut.Visible = false;
                }
            }
        }
 protected void wizStartingTotals_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     CommitFlights();
 }
    private void wzdExport_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        switch (e.CurrentStepIndex)
        {
        case 0:
            // Apply settings
            if (!configExport.ApplySettings())
            {
                e.Cancel = true;
                return;
            }

            // Update settings
            ExportSettings = configExport.Settings;

            if (!configExport.ExportHistory)
            {
                ltlScriptAfter.Text = ScriptHelper.GetScript(
                    @"var actDiv = document.getElementById('actDiv');
if (actDiv != null) { actDiv.style.display='block'; }
var buttonsDiv = document.getElementById('buttonsDiv');
if (buttonsDiv != null) { buttonsDiv.disabled=true; }
BTN_Disable('" + NextButton.ClientID + @"');
StartSelectionTimer();");

                // Select objects asynchronously
                ctrlAsyncSelection.RunAsync(SelectObjects, WindowsIdentity.GetCurrent());
                e.Cancel = true;
            }
            else
            {
                pnlExport.Settings = ExportSettings;
                pnlExport.ReloadData();

                wzdExport.ActiveStepIndex = e.NextStepIndex;
            }
            break;

        case 1:
            // Apply settings
            if (!pnlExport.ApplySettings())
            {
                e.Cancel = true;
                return;
            }
            ExportSettings = pnlExport.Settings;

            // Delete temporary files
            try
            {
                ExportProvider.DeleteTemporaryFiles(ExportSettings, true);
            }
            catch (Exception ex)
            {
                SetErrorLabel(ex.Message);
                e.Cancel = true;
                return;
            }

            try
            {
                // Save export history
                ExportHistoryInfo history = new ExportHistoryInfo
                {
                    ExportDateTime = DateTime.Now,
                    ExportFileName = ExportSettings.TargetFileName,
                    ExportSettings = ExportSettings.GetXML(),
                    ExportSiteID   = ExportSettings.SiteId,
                    ExportUserID   = MembershipContext.AuthenticatedUser.UserID
                };

                ExportHistoryInfoProvider.SetExportHistoryInfo(history);
            }
            catch (Exception ex)
            {
                SetErrorLabel(ex.Message);
                pnlError.ToolTip = EventLogProvider.GetExceptionLogMessage(ex);
                e.Cancel         = true;
                return;
            }

            if (ExportSettings.SiteId > 0)
            {
                ExportSettings.EventLogSource = String.Format(ExportSettings.GetAPIString("ExportSite.EventLogSiteSource", "Export '{0}' site"), ResHelper.LocalizeString(ExportSettings.SiteInfo.DisplayName));
            }

            // Start asynchronous export
            var manager = ExportManager;

            ExportSettings.LogContext = ctlAsyncExport.CurrentLog;
            manager.Settings          = ExportSettings;

            ctlAsyncExport.RunAsync(manager.Export, WindowsIdentity.GetCurrent());

            wzdExport.ActiveStepIndex = e.NextStepIndex;

            break;
        }
    }
Beispiel #37
0
        protected void wzdInstaller_OnNextButtonClick(object sender, WizardNavigationEventArgs e)
        {
            if (this.wzdInstaller.ActiveStepIndex == this.wzdInstaller.WizardSteps.IndexOf(this.stpWelcome))
            {
                this.Install = this.rbInstall.Checked;
            }
            else if (this.wzdInstaller.ActiveStepIndex == this.wzdInstaller.WizardSteps.IndexOf(this.stpUserServer))
            {
                ViewState["install.password"]    = this.txtPassword.Text;
                ViewState["install.hisPassword"] = this.txtHisPassword.Text;
                this.TrustedConnection           = this.rbWindowsAuthentication.Checked;
                this.HisTrustedConnection        = this.rbHisWindowsAuthentication.Checked;
                if (String.IsNullOrEmpty(this.txtServerName.Text.Trim()))
                {
                    handleError("请输入配置库服务器的IP地址");
                    e.Cancel = true;
                    return;
                }
                if (String.IsNullOrEmpty(this.txtHisServerName.Text.Trim()))
                {
                    handleError("请输入历史库服务器的IP地址");
                    e.Cancel = true;
                    return;
                }

                var error = InstallerHelper.TestConnection(this.TrustedConnection, this.txtServerName.Text.Trim(), Int32.Parse(this.txtServerPort.Text.Trim()), String.Empty, this.txtUsername.Text.Trim(), ViewState["install.password"].ToString());
                if (!String.IsNullOrEmpty(error))
                {
                    handleError(error);
                    e.Cancel = true;
                    return;
                }
                error = InstallerHelper.TestConnection(this.HisTrustedConnection, this.txtHisServerName.Text.Trim(), Int32.Parse(this.txtHisServerPort.Text.Trim()), String.Empty, this.txtHisUsername.Text.Trim(), ViewState["install.hisPassword"].ToString());
                if (!String.IsNullOrEmpty(error))
                {
                    handleError(error);
                    e.Cancel = true;
                    return;
                }
            }
            else if (this.wzdInstaller.ActiveStepIndex == this.wzdInstaller.WizardSteps.IndexOf(this.stpDatabase))
            {
                var database = String.Empty;
                if (rbCreateNew.Checked)
                {
                    database = txtNewDatabaseName.Text.Trim();
                }
                else
                {
                    database = txtExistingDatabaseName.Text.Trim();
                }
                this.ConnectionString = InstallerHelper.CreateConnectionString(this.TrustedConnection, this.txtServerName.Text.Trim(), Int32.Parse(this.txtServerPort.Text.Trim()), database, this.txtUsername.Text.Trim(), ViewState["install.password"].ToString(), 120);

                var hisDatabase = String.Empty;
                if (rbHisCreateNew.Checked)
                {
                    hisDatabase = txtHisNewDatabaseName.Text.Trim();
                }
                else
                {
                    hisDatabase = txtHisExistingDatabaseName.Text.Trim();
                }
                this.HisConnectionString = InstallerHelper.CreateConnectionString(this.HisTrustedConnection, this.txtHisServerName.Text.Trim(), Int32.Parse(this.txtHisServerPort.Text.Trim()), hisDatabase, this.txtHisUsername.Text.Trim(), ViewState["install.hisPassword"].ToString(), 120);

                if (this.rbUseExisting.Checked)
                {
                    if (String.IsNullOrEmpty(database))
                    {
                        handleError("请输入配置库名称");
                        e.Cancel = true;
                        return;
                    }
                    else
                    {
                        if (!chkDontCheckDatabase.Checked)
                        {
                            if (!InstallerHelper.DatabaseExists(this.TrustedConnection, this.txtServerName.Text.Trim(), Int32.Parse(this.txtServerPort.Text.Trim()), database, this.txtUsername.Text.Trim(), ViewState["install.password"].ToString()))
                            {
                                handleError(String.Format("配置库 '{0}' 不存在!", database));
                                e.Cancel = true;
                                return;
                            }
                        }
                    }
                }
                else
                {
                    if (!createDatabase())
                    {
                        handleError(String.Format("创建配置库错误: {0}", this.txtNewDatabaseName.Text));
                        e.Cancel = true;
                        return;
                    }
                    else
                    {
                        this.txtExistingDatabaseName.Text = this.txtNewDatabaseName.Text;
                        this.rbCreateNew.Checked          = false;
                        this.rbUseExisting.Checked        = true;
                    }
                }

                if (this.rbHisUseExisting.Checked)
                {
                    if (String.IsNullOrEmpty(hisDatabase))
                    {
                        handleError("请输入历史库名称");
                        e.Cancel = true;
                        return;
                    }
                    else
                    {
                        if (!chkHisDontCheckDatabase.Checked)
                        {
                            if (!InstallerHelper.DatabaseExists(this.HisTrustedConnection, this.txtHisServerName.Text.Trim(), Int32.Parse(this.txtHisServerPort.Text.Trim()), hisDatabase, this.txtHisUsername.Text.Trim(), ViewState["install.hisPassword"].ToString()))
                            {
                                handleError(String.Format("历史库 '{0}' 不存在!", database));
                                e.Cancel = true;
                                return;
                            }
                        }
                    }
                }
                else
                {
                    if (!createHisDatabase())
                    {
                        handleError(String.Format("创建历史库错误: {0}", this.txtHisNewDatabaseName.Text));
                        e.Cancel = true;
                        return;
                    }
                    else
                    {
                        this.txtHisExistingDatabaseName.Text = this.txtHisNewDatabaseName.Text;
                        this.rbHisCreateNew.Checked          = false;
                        this.rbHisUseExisting.Checked        = true;
                    }
                }

                if (this.Install)
                {
                    if (!installDatabase(ConnectionString))
                    {
                        handleError("在配置库安装过程中捕获异常");
                        e.Cancel = true;
                        return;
                    }

                    if (!installHisDatabase(HisConnectionString))
                    {
                        handleError("在历史库安装过程中捕获异常");
                        e.Cancel = true;
                        return;
                    }
                }
                else
                {
                    if (String.IsNullOrEmpty(currentVersion))
                    {
                        handleError("无法找到当前版本,升级失败");
                        e.Cancel = true;
                        return;
                    }

                    if (currentVersion == newVersion)
                    {
                        handleError(String.Format("已经是最新版本 '{0}'", currentVersion));
                        e.Cancel = true;
                        return;
                    }

                    if (!upgradeableVersions.Contains(currentVersion))
                    {
                        handleError(String.Format("从版本 '{0}' 升级到版本 '{1}' 无效", currentVersion, newVersion));
                        e.Cancel = true;
                        return;
                    }

                    bool flag1 = false;
                    foreach (var version in upgradeableVersions)
                    {
                        if (currentVersion == version)
                        {
                            flag1 = true;
                            continue;
                        }

                        if (flag1)
                        {
                            if (!upgradeDatabase(version, ConnectionString))
                            {
                                handleError("更新配置库脚本时捕获异常");
                                e.Cancel = true;
                                return;
                            }

                            if (!upgradeHisDatabase(version, ConnectionString))
                            {
                                handleError("更新历史库脚本时捕获异常");
                                e.Cancel = true;
                                return;
                            }
                        }
                    }
                }

                var setCurrentVersionError = InstallerHelper.SetCurrentVersion(newVersion);
                if (!String.IsNullOrEmpty(setCurrentVersionError))
                {
                    this.pnlLog.Visible = true;
                    addResult(String.Format("设置新版本时捕获异常: {0}", setCurrentVersionError));
                    return;
                }

                this.pnlLog.Visible = false;
                if (InstallerHelper.SaveConnectionString(SqlHelper.ConnectionStringLocalName, ConnectionString) && InstallerHelper.SaveConnectionString(SqlHelper.HisConnectionStringLocalName, HisConnectionString))
                {
                    this.gvLsc_DataBind();
                    wzdInstaller.ActiveStepIndex = this.wzdInstaller.WizardSteps.IndexOf(this.stpLscSetting);
                }
                else
                {
                    wzdInstaller.ActiveStepIndex = this.wzdInstaller.WizardSteps.IndexOf(this.stpConnectionString);
                    lblErrorConnMessage.Text     = String.Format("此安装无法更新服务器上的ConnectionStrings.config配置文件,这可能由于修改此文件的系统权限被限制。请用记事本打开服务器上的ConnectionStrings.config配置文件,手动添加以下信息到 &lt;connectionStrings&gt;&lt;/connectionStrings&gt;节点之内: <br/><b>&lt;clear /&gt;<br/>&lt;add name=\"{0}\" connectionString=\"{1}\" /&gt;<br/>&lt;add name=\"{2}\" connectionString=\"{3}\" /&gt;</b><br/>", SqlHelper.ConnectionStringLocalName, ConnectionString, SqlHelper.HisConnectionStringLocalName, HisConnectionString);
                    lblErrorConnMessage.Visible  = true;
                }
            }
            else if (this.wzdInstaller.ActiveStepIndex == this.wzdInstaller.WizardSteps.IndexOf(this.stpConnectionString))
            {
                if (InstallerHelper.ConnectionString != ConnectionString || InstallerHelper.HisConnectionString != HisConnectionString)
                {
                    handleError("已存在的连接字符串与生成的连接字符串不匹配,请确认连接字符串是否正确。");
                    e.Cancel = true;
                    return;
                }
                else
                {
                    this.gvLsc_DataBind();
                    wzdInstaller.ActiveStepIndex = this.wzdInstaller.WizardSteps.IndexOf(this.stpLscSetting);
                }
            }
            else if (this.wzdInstaller.ActiveStepIndex == this.wzdInstaller.WizardSteps.IndexOf(this.stpLscSetting))
            {
                if (!InstallerHelper.LscDataExists())
                {
                    handleError("必须配置LSC信息,否则系统无法正常使用。");
                    e.Cancel = true;
                    return;
                }
            }
            else if (this.wzdInstaller.ActiveStepIndex == this.wzdInstaller.WizardSteps.IndexOf(this.stpStartService))
            {
            }
        }
Beispiel #38
0
        protected void wzdPasswordRecover_NextButtonClick(object sender, WizardNavigationEventArgs e)
        {
            try
            {
                MessageTemplateDataContext dbMessageTemplate = new MessageTemplateDataContext(SystemSetting.SageFrameConnectionString);
                if (txtPassword.Text != null && txtRetypePassword.Text != "" && txtRetypePassword.Text == txtPassword.Text)
                {
                    if (txtPassword.Text.Length < 4)
                    {
                        ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("PasswordRecovery", "PasswordLength"), "", SageMessageType.Alert);
                        e.Cancel = true;
                    }
                    else
                    {
                        if (hdnRecoveryCode.Value != "")
                        {
                            UserManagementDataContext dbUser = new UserManagementDataContext(SystemSetting.SageFrameConnectionString);
                            var sageframeuser = dbUser.sp_GetUsernameByActivationOrRecoveryCode(hdnRecoveryCode.Value, GetPortalID).SingleOrDefault();
                            if (sageframeuser.CodeForUsername != null)
                            {
                                MembershipController m        = new MembershipController();
                                UserInfo             sageUser = m.GetUserDetails(GetPortalID, sageframeuser.CodeForUsername);
                                //MembershipUser user = Membership.GetUser(sageframeuser.CodeForUsername);
                                string Password, PasswordSalt;
                                PasswordHelper.EnforcePasswordSecurity(m.PasswordFormat, txtPassword.Text, out Password, out PasswordSalt);
                                UserInfo user1 = new UserInfo(sageUser.UserID, Password, PasswordSalt, m.PasswordFormat);
                                m.ChangePassword(user1);
                                //string oldPassword = user.ResetPassword();

                                //user.ChangePassword(oldPassword, txtPassword.Text);


                                var messageTemplates = dbMessageTemplate.sp_MessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_RECOVERED_SUCCESSFUL_EMAIL, GetPortalID);
                                foreach (var messageTemplate in messageTemplates)
                                {
                                    MessageTokenDataContext messageTokenDB = new MessageTokenDataContext(SystemSetting.SageFrameConnectionString);
                                    var            messageTokenValues      = messageTokenDB.sp_GetPasswordRecoverySuccessfulTokenValue(sageUser.UserName, GetPortalID);
                                    CommonFunction comm                    = new CommonFunction();
                                    DataTable      dtTokenValues           = comm.LINQToDataTable(messageTokenValues);
                                    string         replacedMessageSubject  = MessageToken.ReplaceAllMessageToken(messageTemplate.Subject, dtTokenValues);
                                    string         replacedMessageTemplate = MessageToken.ReplaceAllMessageToken(messageTemplate.Body, dtTokenValues);
                                    try
                                    {
                                        MailHelper.SendMailNoAttachment(messageTemplate.MailFrom, sageUser.Email, replacedMessageSubject, replacedMessageTemplate, string.Empty, string.Empty);
                                    }
                                    catch (Exception)
                                    {
                                        ShowMessage("", GetSageMessage("PasswordRecovery", "SecureConnectionFPRError"), "", SageMessageType.Alert);
                                        e.Cancel = true;
                                        divRecoverpwd.Visible = false;
                                    }
                                }
                                UserManagementController.DeactivateRecoveryCode(sageUser.UserName, GetPortalID);
                                var template = dbMessageTemplate.sp_MessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_RECOVERED_SUCESSFUL_INFORMATION, GetPortalID).SingleOrDefault();
                                if (template != null)
                                {
                                    ((Literal)WizardStep2.FindControl("litPasswordChangedSuccessful")).Text = template.Body;
                                }
                            }
                            else
                            {
                                //var template = dbMessageTemplate.sp_MessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_RECOVERED_SUCESSFUL_INFORMATION, GetPortalID).SingleOrDefault();
                                //if (template != null)
                                //{
                                //    ((Literal)WizardStep2.FindControl("litPasswordChangedSuccessful")).Text = template.Body;
                                //}
                                e.Cancel = true;
                                ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("PasswordRecovery", "UnknownErrorPleaseTryAgaing"), "", SageMessageType.Alert);
                            }
                        }
                        else
                        {
                            //var template = dbMessageTemplate.sp_MessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_RECOVERED_SUCESSFUL_INFORMATION, GetPortalID).SingleOrDefault();
                            //if (template != null)
                            //{
                            //    ((Literal)WizardStep2.FindControl("litPasswordChangedSuccessful")).Text = template.Body;
                            //}
                            e.Cancel = true;
                            ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("PasswordRecovery", "UnknownError"), "", SageMessageType.Alert);
                        }
                    }
                }
                else
                {
                    ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("PasswordRecovery", "PleaseEnterAllRequiredFields"), "", SageMessageType.Alert);
                    e.Cancel = true;
                }
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }
Beispiel #39
0
 protected void HandleError(string message, WizardNavigationEventArgs e)
 {
     if (StepIndex > 1)
     {
         --StepIndex;
     }
     lblError.Text = message;
     e.Cancel = true;
 }
Beispiel #40
0
    protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        RequiredFieldValidator1.Visible  = false;
        RequiredFieldValidator2.Visible  = false;
        RequiredFieldValidator3.Visible  = false;
        RequiredFieldValidator4.Visible  = false;
        RequiredFieldValidator5.Visible  = false;
        RequiredFieldValidator6.Visible  = false;
        RequiredFieldValidator7.Visible  = false;
        RequiredFieldValidator8.Visible  = false;
        RequiredFieldValidator9.Visible  = false;
        RequiredFieldValidator10.Visible = false;

        int dodato = 0;

        try
        {
            konekcija.Open();
            string     naredba = "Insert into Klijent (id_klijenta, Ime, Prezime, JMBG, pol, PIB, Adresa, Telefon, Sediste, Naziv_preduzeca) Values (@id_klijenta, @Ime, @Prezime, @JMBG, @pol, @PIB, @Adresa, @Telefon, @Sediste, @Naziv_preduzeca)";
            SqlCommand komanda = new SqlCommand(naredba, konekcija);
            //u novi se ubacuju podaci iz sesije
            Korisnik novi = (Korisnik)Session[KorisnikSessionKey];

            komanda.Parameters.AddWithValue("@id_klijenta", novi.id_klijenta);
            komanda.Parameters.AddWithValue("@Adresa", novi.Adresa);
            komanda.Parameters.AddWithValue("@Telefon", novi.Telefon);

            if (String.IsNullOrEmpty(txtJMBG.Text))
            {
                komanda.Parameters.AddWithValue("@JMBG", DBNull.Value);
            }
            else
            {
                komanda.Parameters.AddWithValue("@JMBG", txtJMBG.Text);
            }
            if (String.IsNullOrEmpty(txtIme.Text))
            {
                komanda.Parameters.AddWithValue("@Ime", DBNull.Value);
            }
            else
            {
                komanda.Parameters.AddWithValue("@Ime", txtIme.Text);
            }
            if (String.IsNullOrEmpty(txtPrezime.Text))
            {
                komanda.Parameters.AddWithValue("@Prezime", DBNull.Value);
            }
            else
            {
                komanda.Parameters.AddWithValue("@Prezime", txtPrezime.Text);
            }
            if (String.IsNullOrEmpty(txtPol.Text))
            {
                komanda.Parameters.AddWithValue("@pol", DBNull.Value);
            }
            else
            {
                komanda.Parameters.AddWithValue("@pol", txtPol.Text);
            }
            if (String.IsNullOrEmpty(txtPib.Text))
            {
                komanda.Parameters.AddWithValue("@PIB", DBNull.Value);
            }
            else
            {
                komanda.Parameters.AddWithValue("@PIB", txtPib.Text);
            }
            if (String.IsNullOrEmpty(txtSediste.Text))
            {
                komanda.Parameters.AddWithValue("@Sediste", DBNull.Value);
            }
            else
            {
                komanda.Parameters.AddWithValue("@Sediste", txtSediste.Text);
            }
            if (String.IsNullOrEmpty(txtNaziv.Text))
            {
                komanda.Parameters.AddWithValue("@Naziv_preduzeca", DBNull.Value);
            }
            else
            {
                komanda.Parameters.AddWithValue("@Naziv_preduzeca", txtNaziv.Text);
            }
            dodato       = komanda.ExecuteNonQuery();
            lblKraj.Text = dodato.ToString() + " korisnik je dodat u bazu";
        }
        catch (Exception ex)
        {
            lblKraj.Text = ex.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }
Beispiel #41
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// wizInstall_FinishButtonClick runs when the Finish Button on the Wizard is clicked.
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <history>
 ///     [cnurse]	08/13/2007	created
 /// </history>
 /// -----------------------------------------------------------------------------
 protected void wizInstall_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     Response.Redirect(ReturnURL, true);
 }
Beispiel #42
0
        protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
        {
            int    emplcamentagence = Int32.Parse(DropDownListAgenceEmplacement.SelectedValue.ToString());
            String statutrouteur    = DropDownListRouteurStatut.SelectedValue.ToString();
            String statutswitcheur  = DropDownListSwitcheurStatut.SelectedValue.ToString();
            String statutmodem      = DropDownListModemStatut.SelectedValue.ToString();
            String statutAdsl       = DropDownListAdslStatut.SelectedValue.ToString();
            String statutFramerelay = DropDownListFrarelayStatut.SelectedValue.ToString();
            int    agence_ID        = Int32.Parse(DropDownListAgenceID.SelectedValue);
            String CurrentUser      = null;

            using (Entities.Agences.AgenceEntities dba = new Entities.Agences.AgenceEntities())
            {
                if (System.Web.HttpContext.Current.Request.Cookies["userInfo"] != null)
                {
                    CurrentUser = System.Web.HttpContext.Current.Request.Cookies["userInfo"]["Username"];
                }
                var requete = from value in dba.Agences where (value.Agence_ID == agence_ID) select value;
                var result  = requete.FirstOrDefault();
                if (result != null)
                {
                    Entities.Agences.Historique_Modem mo = new Entities.Agences.Historique_Modem()
                    {
                        Historique_Modem_Personnel = CurrentUser, Historique_Modem_ID = result.Equipements.Modems.Modem_ID, Historique_Modem_Date = DateTime.Now
                    };
                    Entities.Agences.Historique_Routeur ro = new Entities.Agences.Historique_Routeur()
                    {
                        Historique_Routeur_Personnel = CurrentUser, Historique_Routeur_ID = result.Equipements.Routeurs.Routeur_ID, Historique_Routeur_Date = DateTime.Now
                    };
                    Entities.Agences.Historique_Switcheur sw = new Entities.Agences.Historique_Switcheur()
                    {
                        Historique_Switcheur_Personnel = CurrentUser, Historique_Switcheur_ID = result.Equipements.Switcheurs.Switcheur_ID, Historique_Switcheur_Date = DateTime.Now
                    };
                    Entities.Agences.Historique_Equipements eq = new Entities.Agences.Historique_Equipements()
                    {
                        Historique_Equipement_Date = DateTime.Now, Historique_Equipement_ID = result.Equipements.Equipement_ID, Historique_Equipement_Modem = mo.Historique_Modem1, Historique_Equipement_Routeur = ro.Historique_Routeur1, Historique_Equipement_Switcheur = sw.Historique_Switcheur1, Historique_Equipement_Personnel = CurrentUser,
                    };
                    Entities.Agences.Historique_Adsl ad = new Entities.Agences.Historique_Adsl()
                    {
                        Historique_Adsl_Date = DateTime.Now, Historique_Adsl_Personnel = CurrentUser, Historique_Adsl_ID = result.Liaisons.Adsl.Adsl_ID
                    };
                    Entities.Agences.Historique_FrameRelay fr = new Entities.Agences.Historique_FrameRelay()
                    {
                        Historique_Framerelay_Date = DateTime.Now, Historique_Framerelay_Personnel = CurrentUser, Historique_Framerelay_ID = result.Liaisons.Framerelay.Framerelay_ID
                    };

                    Entities.Agences.Historique_Liaison li = new Entities.Agences.Historique_Liaison()
                    {
                        Historique_Liaison_Date = DateTime.Now, Historique_Liaison_ID = result.Liaisons.Liaison_ID, Historique_Liaison_Personnel = CurrentUser, Historique_Liaison_Adsl = ad.Historique_Adsl1, Historique_Liaison_Framerelay = fr.Historique_Framerelay1
                    };
                    Entities.Agences.Historique_Responsable re = new Entities.Agences.Historique_Responsable()
                    {
                        Historique_ID_Responsable = result.Respnosable_Agence.ID
                    };
                    Entities.Agences.Historique_Agences ag = new Entities.Agences.Historique_Agences()
                    {
                        Historique_Coordonne_Responsable = re.Historique_Responsable1, Historique_Agence_Date = DateTime.Now, Historique_Agence_ID = agence_ID, Historique_Personnel = CurrentUser, Historique_Agence_Equipements = eq.Historique_Equipement, Historique_Agence_Liaisons = li.Historique_Liaison1
                    };

                    if (result.Agence_Descriptions != TextBoxAgenceDescription.Text)
                    {
                        ag.Historique_Agence_Description_Ancien  = result.Agence_Descriptions;
                        ag.Historique_Agence_Description_Nouveau = TextBoxAgenceDescription.Text;
                    }
                    if (result.Agence_Emplacement != emplcamentagence)
                    {
                        ag.Historique_Agence_Emplacement_ancien = result.Emplacement.Emplacement_Libelle;
                        using (Entities.Agences.AgenceEntities emp = new Entities.Agences.AgenceEntities())
                        {
                            var emreq = from val in emp.Emplacement where (val.Emplacement_ID == emplcamentagence) select val;
                            var emres = emreq.FirstOrDefault();
                            ag.Historique_Agence_Emplacement_nouveau = emres.Emplacement_Libelle;
                        }
                    }
                    if (result.Equipements.Equipement_Description != TextBoxEquipementDescription.Text)
                    {
                        eq.Historique_Equipement_Description_Ancien  = result.Equipements.Equipement_Description;
                        eq.Historique_Equipement_Description_Nouveau = TextBoxEquipementDescription.Text;
                    }
                    if (result.Liaisons.Liaison_Description != TextBoxLiaisonDescription.Text)
                    {
                        li.Historique_Liaison_Description_Ancien  = result.Liaisons.Liaison_Description;
                        li.Historique_Liaison_Description_Nouveau = TextBoxLiaisonDescription.Text;
                    }
                    if (result.Equipements.Modems.Modem_Description != TextBoxModemDescription.Text)
                    {
                        mo.Historique_Modem_Description_Ancien  = result.Equipements.Modems.Modem_Description;
                        mo.Historique_Modem_Description_Nouveau = TextBoxModemDescription.Text;
                    }
                    if (result.Equipements.Modems.Modem_IPadress != TextBoxModemIP.Text)
                    {
                        mo.Historique_Modem_Ip_Ancien  = result.Equipements.Modems.Modem_IPadress;
                        mo.Historique_Modem_Ip_Nouveau = TextBoxModemIP.Text;
                    }
                    if (result.Equipements.Modems.Modem_Macadress != TextBoxModemMac.Text)
                    {
                        mo.Historique_Modem_Mac_Ancien  = result.Equipements.Modems.Modem_Macadress;
                        mo.Historique_Modem_Mac_Nouveau = TextBoxModemMac.Text;
                    }
                    if (result.Equipements.Modems.Modem_Statut != statutmodem)
                    {
                        mo.Historique_Modem_Statut_ancien  = result.Equipements.Modems.Modem_Statut;
                        mo.Historique_Modem_Statut_Nouveau = statutmodem;
                    }
                    if (result.Equipements.Modems.Modem_Type != TextBoxModemType.Text)
                    {
                        mo.Historique_Modem_Type_Ancien  = result.Equipements.Modems.Modem_Type;
                        mo.Historique_Modem_Type_Nouveau = TextBoxModemType.Text;
                    }
                    if (result.Equipements.Routeurs.Routeur_Description != TextBoxRouteurDescription.Text)
                    {
                        ro.Historique_Routeur_Description_Ancien  = result.Equipements.Routeurs.Routeur_Description;
                        ro.Historique_Routeur_Description_Nouveau = TextBoxRouteurDescription.Text;
                    }
                    if (result.Equipements.Routeurs.Routeur_IPadress != TextBoxRouteurIP.Text)
                    {
                        ro.Historique_Routeur_Ip_Ancien  = result.Equipements.Routeurs.Routeur_IPadress;
                        ro.Historique_Routeur_Ip_Nouveau = TextBoxRouteurIP.Text;
                    }
                    if (result.Equipements.Routeurs.Routeur_Macadress != TextBoxRouteurMac.Text)
                    {
                        ro.Historique_Routeur_Mac_Ancien  = result.Equipements.Routeurs.Routeur_Macadress;
                        ro.Historique_Routeur_Mac_Nouveau = TextBoxRouteurMac.Text;
                    }
                    if (result.Equipements.Routeurs.Routeur_Statut != statutrouteur)
                    {
                        ro.Historique_Routeur_Statut_ancien  = result.Equipements.Routeurs.Routeur_Statut;
                        ro.Historique_Routeur_Statut_Nouveau = statutrouteur;
                    }
                    if (result.Equipements.Routeurs.Routeur_Type != TextBoxRouteurType.Text)
                    {
                        ro.Historique_Routeur_Type_Ancien  = result.Equipements.Routeurs.Routeur_Type;
                        ro.Historique_Routeur_Type_Nouveau = TextBoxRouteurType.Text;
                    }
                    if (result.Equipements.Switcheurs.Switcheur_Description != TextBoxSwitcheurDescription.Text)
                    {
                        sw.Historique_Switcheur_Description_Ancien  = result.Equipements.Switcheurs.Switcheur_Description;
                        sw.Historique_Switcheur_Description_Nouveau = TextBoxSwitcheurDescription.Text;
                    }
                    if (result.Equipements.Switcheurs.Switcheur_IPadress != TextBoxSwitcheurIP.Text)
                    {
                        sw.Historique_Switcheur_Ip_Ancien  = result.Equipements.Switcheurs.Switcheur_IPadress;
                        sw.Historique_Switcheur_Ip_Nouveau = TextBoxSwitcheurIP.Text;
                    }
                    if (result.Equipements.Switcheurs.Switcheur_Macadress != TextBoxSwitcheurMac.Text)
                    {
                        sw.Historique_Switcheur_Mac_Ancien  = result.Equipements.Switcheurs.Switcheur_Macadress;
                        sw.Historique_Switcheur_Mac_Nouveau = TextBoxSwitcheurMac.Text;
                    }
                    if (result.Equipements.Switcheurs.Switcheur_Statut != statutswitcheur)
                    {
                        sw.Historique_Switcheur_Statut_ancien  = result.Equipements.Switcheurs.Switcheur_Statut;
                        sw.Historique_Switcheur_Statut_Nouveau = statutswitcheur;
                    }
                    if (result.Equipements.Switcheurs.Switcheur_Type != TextBoxSwitcheurType.Text)
                    {
                        sw.Historique_Switcheur_Type_Ancien  = result.Equipements.Switcheurs.Switcheur_Type;
                        sw.Historique_Switcheur_Type_Nouveau = TextBoxSwitcheurType.Text;
                    }
                    if (result.Liaisons.Adsl.Adsl_Description != TextBoxAdslDescription.Text)
                    {
                        ad.Historique_Adsl_Description_Ancien  = result.Liaisons.Adsl.Adsl_Description;
                        ad.Historique_Adsl_Description_Nouveau = TextBoxAdslDescription.Text;
                    }
                    if (result.Liaisons.Adsl.Adsl_Identificateur != TextBoxAdslIdentificateur.Text)
                    {
                        ad.Historique_Adsl_Identificateur_Ancien  = result.Liaisons.Adsl.Adsl_Identificateur;
                        ad.Historique_Adsl_Identificateur_Nouveau = TextBoxAdslIdentificateur.Text;
                    }
                    if (result.Liaisons.Adsl.Adsl_Statut != statutAdsl)
                    {
                        ad.Historique_Adsl_Statut_Ancien  = result.Liaisons.Adsl.Adsl_Statut;
                        ad.Historique_Adsl_Statut_Nouveau = statutAdsl;
                    }
                    if (result.Liaisons.Framerelay.Framerelay_Description != TextBoxFramerelayDescription.Text)
                    {
                        fr.Historique_Framerelay_Description_Ancien  = result.Liaisons.Framerelay.Framerelay_Description;
                        fr.Historique_Framerelay_Description_Nouveau = TextBoxFramerelayDescription.Text;
                    }
                    if (result.Liaisons.Framerelay.Framerelay_Identificateur != TextBoxFrameRelayIdentificateur.Text)
                    {
                        fr.Historique_Framerelay_Identificateur_Ancien  = result.Liaisons.Framerelay.Framerelay_Identificateur;
                        fr.Historique_Framerelay_Identificateur_Nouveau = TextBoxFrameRelayIdentificateur.Text;
                    }
                    if (result.Liaisons.Framerelay.Framerelay_Statut != statutFramerelay)
                    {
                        fr.Historique_Framerelay_Statut_Ancien  = result.Liaisons.Framerelay.Framerelay_Statut;
                        fr.Historique_Framerelay_Statut_Nouveau = statutFramerelay;
                    }
                    if (result.Respnosable_Agence.Nom == TextBoxResponsableNom.Text)
                    {
                        re.Historique_Responsable_Nom_Ancien  = result.Respnosable_Agence.Nom;
                        re.Historique_Responsable_Nom_Nouveau = TextBoxResponsableNom.Text;
                    }
                    if (result.Respnosable_Agence.Prenom == TextBoxResponsablePrenom.Text)
                    {
                        re.Historique_Responsable_Prenom_Ancien  = result.Respnosable_Agence.Prenom;
                        re.Historique_Responsable_Prenom_Nouveau = TextBoxResponsablePrenom.Text;
                    }
                    if (result.Respnosable_Agence.Email == TextBoxResponsableEmail.Text)
                    {
                        re.Historique_Responsable_Email_ancien  = result.Respnosable_Agence.Email;
                        re.Historique_Responsable_Email_Nouveau = TextBoxResponsableEmail.Text;
                    }
                    if (result.Respnosable_Agence.Teléphone == TextBoxResponsableTelephone.Text)
                    {
                        re.Historique_Responsable_Telephone_Ancien  = result.Respnosable_Agence.Teléphone;
                        re.Historique_Responsable_Telephone_Nouveau = TextBoxResponsableTelephone.Text;
                    }
                    result.Agence_Descriptions = TextBoxAgenceDescription.Text;
                    result.Agence_Emplacement  = emplcamentagence;
                    result.Equipements.Equipement_Description           = TextBoxEquipementDescription.Text;
                    result.Liaisons.Liaison_Description                 = TextBoxLiaisonDescription.Text;
                    result.Equipements.Modems.Modem_Description         = TextBoxModemDescription.Text;
                    result.Equipements.Modems.Modem_IPadress            = TextBoxModemIP.Text;
                    result.Equipements.Modems.Modem_Macadress           = TextBoxModemMac.Text;
                    result.Equipements.Modems.Modem_Statut              = statutmodem;
                    result.Equipements.Modems.Modem_Type                = TextBoxModemType.Text;
                    result.Equipements.Routeurs.Routeur_Description     = TextBoxModemDescription.Text;
                    result.Equipements.Routeurs.Routeur_IPadress        = TextBoxRouteurIP.Text;
                    result.Equipements.Routeurs.Routeur_Macadress       = TextBoxRouteurMac.Text;
                    result.Equipements.Routeurs.Routeur_Statut          = statutrouteur;
                    result.Equipements.Routeurs.Routeur_Type            = TextBoxRouteurType.Text;
                    result.Equipements.Switcheurs.Switcheur_Description = TextBoxSwitcheurDescription.Text;
                    result.Equipements.Switcheurs.Switcheur_IPadress    = TextBoxSwitcheurIP.Text;
                    result.Equipements.Switcheurs.Switcheur_Macadress   = TextBoxSwitcheurMac.Text;
                    result.Equipements.Switcheurs.Switcheur_Statut      = statutswitcheur;
                    result.Equipements.Switcheurs.Switcheur_Type        = TextBoxSwitcheurType.Text;
                    result.Liaisons.Adsl.Adsl_Description               = TextBoxAdslDescription.Text;
                    result.Liaisons.Adsl.Adsl_Identificateur            = TextBoxAdslIdentificateur.Text;
                    result.Liaisons.Adsl.Adsl_Statut = statutAdsl;
                    result.Liaisons.Framerelay.Framerelay_Description    = TextBoxFramerelayDescription.Text;
                    result.Liaisons.Framerelay.Framerelay_Identificateur = TextBoxFrameRelayIdentificateur.Text;
                    result.Liaisons.Framerelay.Framerelay_Statut         = statutFramerelay;
                    result.Adress      = TextBoxAgenceAdress.Text;
                    result.Agence_Zone = TextBoxAgenceZone.Text;

                    result.Respnosable_Agence.Nom       = TextBoxResponsableNom.Text;
                    result.Respnosable_Agence.Prenom    = TextBoxResponsablePrenom.Text;
                    result.Respnosable_Agence.Email     = TextBoxResponsableEmail.Text;
                    result.Respnosable_Agence.Teléphone = TextBoxResponsableTelephone.Text;
                    dba.AddToHistorique_Responsable(re);
                    dba.AddToHistorique_Adsl(ad);
                    dba.AddToHistorique_FrameRelay(fr);
                    dba.AddToHistorique_Liaison(li);
                    dba.AddToHistorique_Modem(mo);
                    dba.AddToHistorique_Routeur(ro);
                    dba.AddToHistorique_Switcheur(sw);
                    dba.AddToHistorique_Equipements(eq);
                    dba.AddToHistorique_Agences(ag);
                    dba.SaveChanges();
                    Utilitaire.Utilites.MSG(msgboxpanel, "", "Mis Ajour Avec Succes");
                }
            }
        }
Beispiel #43
0
 protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     btnSaveProfile_Click(sender, e);
 }
 protected void RegistrationWizard_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     Response.Redirect("~/Accounts/login.aspx");
 }
Beispiel #45
0
    private void wzdExport_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        switch (e.CurrentStepIndex)
        {
        case 0:
            // Apply settings
            if (!configExport.ApplySettings())
            {
                e.Cancel = true;
                return;
            }

            // Update settings
            ExportSettings = configExport.Settings;

            if (!configExport.ExportHistory)
            {
                ltlScriptAfter.Text = ScriptHelper.GetScript(
                    "var actDiv = document.getElementById('actDiv'); \n" +
                    "if (actDiv != null) { actDiv.style.display='block'; } \n" +
                    "var buttonsDiv = document.getElementById('buttonsDiv'); if (buttonsDiv != null) { buttonsDiv.disabled=true; } \n" +
                    "BTN_Disable('" + NextButton.ClientID + "'); \n" +
                    "StartSelectionTimer();"
                    );

                // Select objects asynchronously
                ctrlAsync.RunAsync(SelectObjects, WindowsIdentity.GetCurrent());
                e.Cancel = true;
            }
            else
            {
                pnlExport.Settings = ExportSettings;
                pnlExport.ReloadData();
            }
            break;

        case 1:
            // Apply settings
            if (!pnlExport.ApplySettings())
            {
                e.Cancel = true;
                return;
            }
            ExportSettings = pnlExport.Settings;

            // Delete temporary files
            try
            {
                ExportProvider.DeleteTemporaryFiles(ExportSettings, true);
            }
            catch (Exception ex)
            {
                SetErrorLabel(ex.Message);
                e.Cancel = true;
                return;
            }

            try
            {
                // Save export history
                ExportHistoryInfo history = new ExportHistoryInfo();
                history.ExportDateTime = DateTime.Now;
                history.ExportFileName = ExportSettings.TargetFileName;
                history.ExportSettings = ExportSettings.GetXML();
                history.ExportSiteID   = ExportSettings.SiteId;
                history.ExportUserID   = MembershipContext.AuthenticatedUser.UserID;

                ExportHistoryInfoProvider.SetExportHistoryInfo(history);
            }
            catch (Exception ex)
            {
                SetErrorLabel(ex.Message);
                pnlError.ToolTip = EventLogProvider.GetExceptionLogMessage(ex);
                e.Cancel         = true;
                return;
            }


            // Init the Mimetype helper (required for the export)
            MimeTypeHelper.LoadMimeTypes();

            if (ExportSettings.SiteId > 0)
            {
                ExportSettings.EventLogSource = string.Format(ExportSettings.GetAPIString("ExportSite.EventLogSiteSource", "Export '{0}' site"), ResHelper.LocalizeString(ExportSettings.SiteInfo.DisplayName));
            }

            // Start asynchronnous export
            ExportManager.Settings = ExportSettings;

            AsyncWorker worker = new AsyncWorker();
            worker.OnFinished += worker_OnFinished;
            worker.OnError    += worker_OnError;
            worker.RunAsync(ExportManager.Export, WindowsIdentity.GetCurrent());

            lblProgress.Text = GetString("SiteExport.PreparingExport");
            break;
        }

        ReloadSteps();
        wzdExport.ActiveStepIndex = e.NextStepIndex;
    }
Beispiel #46
0
    protected void CreateUserWizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        if (CreateUserWizard1.ActiveStepIndex == 0)
        {
            if ((((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("WasteItem")).SelectedValue.Equals("U") && ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("WasteOther")).Text.Trim().Equals("")) || (((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("TechItem")).SelectedValue.Equals("V") && ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("TechOther")).Text.Trim().Equals("")))
            {
                Page.RegisterClientScriptBlock("checkinput", @"<script>alert('其他資料未填');</script>");
                e.Cancel = true;
            }
            else
            {
                //at = SpringUtil.at();
                String sql = "SELECT  *  From vw_aspnet_Users   WHERE  UserName=@param1   ";
                //IDbParameters parameters = at.CreateDbParameters();
                //parameters.Add("param1", OleDbType.VarChar).Value = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("UserName")).Text;

                //DataSet ds = new DataSet();
                //at.DataSetFillWithParameters(ds, CommandType.Text, sql, parameters);

                OleDbCommand cmd = new OleDbCommand(sql);
                cmd.Parameters.Add("@param1", OleDbType.VarChar).Value = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("UserName")).Text;
                cmd.CommandType = CommandType.Text;
                DataSet ds = SQLUtil.QueryDS(cmd);

                if (ds.Tables[0].Rows.Count == 0)
                {
                    ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("UserName")).Text        = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("UserName")).Text;
                    ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("UserNameView")).Text      = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("UserName")).Text;
                    ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Password")).Text        = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("Password")).Text;
                    ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("PasswordView")).Text      = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("Password")).Text;
                    ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ConfirmPassword")).Text = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("ConfirmPassword")).Text;
                    ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Owner")).Text             = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("Owner")).Text;
                    ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Corp")).Text    = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("Corp")).Text;
                    ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Address")).Text = ((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("zipList")).SelectedValue +
                                                                                                                     ((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("cityList")).SelectedItem.Text +
                                                                                                                     ((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("zipList")).SelectedItem.Text +
                                                                                                                     ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("Address")).Text;
                    ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Name")).Text = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("Name")).Text;
                    ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Tel")).Text  = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("Tel")).Text;
                    ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Fax")).Text  = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("Fax")).Text;

                    ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Email")).Text   = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("Email")).Text;
                    ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("EmailView")).Text = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("Email")).Text;

                    if (((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("Kind")).SelectedValue.Equals("A"))
                    {
                        ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Kind")).Text = "公民營處(清)理機構";
                    }
                    else if (((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("Kind")).SelectedValue.Equals("B"))
                    {
                        ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Kind")).Text = "許可再利用機構";
                    }
                    else if (((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("Kind")).SelectedValue.Equals("C"))
                    {
                        ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Kind")).Text = "公告再利用機構";
                    }
                    else if (((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("Kind")).SelectedValue.Equals("D"))
                    {
                        ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Kind")).Text = "應回收廢棄物處理機構";
                    }
                    else if (((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("Kind")).SelectedValue.Equals("E"))
                    {
                        ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Kind")).Text = "其他";
                    }

                    if (!((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("TechItem")).SelectedValue.Equals("V"))
                    {
                        ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("TechItem")).Text = ((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("TechItem")).SelectedItem.Text;
                    }
                    else
                    {
                        ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("TechItem")).Text = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("TechOther")).Text;
                    }

                    ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("TechName")).Text = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("TechName")).Text;

                    if (!((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("WasteItem")).SelectedValue.Equals("U"))
                    {
                        ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("WasteItem")).Text = ((DropDownList)UserTemplate.ContentTemplateContainer.FindControl("WasteItem")).SelectedItem.Text;
                    }
                    else
                    {
                        ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("WasteItem")).Text = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("WasteOther")).Text;
                    }

                    ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("WasteName")).Text = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("WasteName")).Text;
                    ((Label)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ReuseName")).Text = ((TextBox)UserTemplate.ContentTemplateContainer.FindControl("ReuseName")).Text;
                }
                else
                {
                    //((CustomValidator)UserTemplate.ContentTemplateContainer.FindControl("CustomValidator1")).IsValid = false;
                    //((CustomValidator)UserTemplate.ContentTemplateContainer.FindControl("CustomValidator1")).ErrorMessage = "帳號已經被註冊";
                    //Response.Write("<script>alert('帳號已經被註冊')</script>");
                    Page.RegisterClientScriptBlock("checkinput", @"<script>alert('帳號已經被註冊');</script>");
                    e.Cancel = true;
                }
            }
        }
    }
 protected void RegisterUser_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
 }
Beispiel #48
0
 protected void wzdImport_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     URLHelper.Redirect(FinishUrl);
 }
Beispiel #49
0
 protected void Wizard1_PreviousButtonClick(object sender, WizardNavigationEventArgs e)
 {
 }
Beispiel #50
0
 protected void wzdImport_PreviousButtonClick(object sender, WizardNavigationEventArgs e)
 {
     wzdImport.ActiveStepIndex = (wzdImport.ActiveStepIndex == 1) ? 0 : e.NextStepIndex;
 }
Beispiel #51
0
 protected void wzdPasswordRecover_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     hdnRecoveryCode.Value = "";
     GotoLoginPage();
 }
Beispiel #52
0
    protected void wzdImport_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        switch (e.CurrentStepIndex)
        {
        case 0:
            // Apply settings
            if (!stpConfigImport.ApplySettings())
            {
                e.Cancel = true;
                return;
            }

            // Update settings
            ImportSettings = stpConfigImport.Settings;

            ltlScriptAfter.Text = ScriptHelper.GetScript(
                "var actDiv = document.getElementById('actDiv'); \n" +
                "if (actDiv != null) { actDiv.style.display='block'; } \n" +
                "var buttonsDiv = document.getElementById('buttonsDiv'); if (buttonsDiv != null) { buttonsDiv.disabled=true; } \n" +
                "BTN_Disable('" + NextButton.ClientID + "'); \n" +
                "StartUnzipTimer();"
                );

            // Create temporary files asynchronously
            ctrlAsync.RunAsync(CreateTemporaryFiles, WindowsIdentity.GetCurrent());

            e.Cancel = true;
            break;

        case 1:
            // Apply settings
            if (!stpSiteDetails.ApplySettings())
            {
                e.Cancel = true;
                return;
            }

            // Update settings
            ImportSettings = stpSiteDetails.Settings;
            //stpImport.SelectedNodeValue = CMSObjectHelper.GROUP_OBJECTS;
            stpImport.ReloadData(true);

            wzdImport.ActiveStepIndex++;
            break;

        case 2:
            // Apply settings
            if (!stpImport.ApplySettings())
            {
                e.Cancel = true;
                return;
            }

            // Check licences
            string error = ImportExportControl.CheckLicenses(ImportSettings);
            if (!string.IsNullOrEmpty(error))
            {
                lblError.Text = error;

                e.Cancel = true;
                return;
            }

            ImportSettings = stpImport.Settings;

            // Init the Mimetype helper (required for the Import)
            MimeTypeHelper.LoadMimeTypes();

            // Start asynchronnous Import
            ImportSettings.DefaultProcessObjectType = ProcessObjectEnum.Selected;
            if (ImportSettings.SiteIsIncluded)
            {
                ImportSettings.EventLogSource = string.Format(ImportSettings.GetAPIString("ImportSite.EventLogSiteSource", "Import '{0}' site"), ResHelper.LocalizeString(ImportSettings.SiteDisplayName));
            }
            ImportManager.Settings = ImportSettings;

            AsyncWorker worker = new AsyncWorker();
            worker.OnFinished += worker_OnFinished;
            worker.OnError    += worker_OnError;
            worker.RunAsync(ImportManager.Import, WindowsIdentity.GetCurrent());

            wzdImport.ActiveStepIndex++;
            break;
        }

        ReloadSteps();
    }
Beispiel #53
0
        protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
        {
            HttpCookie cookie1 = new HttpCookie("extension");
            //   int f = 0;
            int slots = 0;

            if (f == 0)
            {
                SqlConnection conn;
                SqlDataReader sr;
                SqlCommand    cmd = new SqlCommand();
                String        str;
                str  = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
                conn = new SqlConnection(str);

                /*   Database1Entities22 db1 = new Database1Entities22();
                 * UserDb u1 = new UserDb();
                 * // String imgname;
                 * u1.user_id = TextBox1.Text;
                 * u1.name = TextBox2.Text + " " + TextBox3.Text;
                 * u1.dob = DropDownList8.SelectedItem.Text.ToString() + " " + DropDownList9.SelectedItem.Text.ToString() + " " + DropDownList10.SelectedItem.Text.ToString();
                 * u1.mobileno = Decimal.Parse(TextBox9.Text);
                 * u1.email = TextBox5.Text;
                 * u1.address = TextBox15.Text;
                 * u1.city = TextBox6.Text;
                 * u1.state = TextBox7.Text;
                 * u1.pcode = Decimal.Parse(TextBox8.Text);
                 * u1.sem = Int32.Parse(TextBox4.Text);
                 * u1.branch = TextBox17.Text;
                 *
                 *
                 *
                 * db1.UserDbs.Add(u1);
                 *
                 *
                 * db1.SaveChanges();
                 *
                 * Database1Entities22 db2 = new Database1Entities22();
                 * Allocated a = new Allocated();
                 * a.user_id = TextBox1.Text; //userid into Allocate table
                 *
                 *
                 * conn.Open();
                 * cmd.Connection = conn;
                 * cmd.CommandText = "select * from Room where room_no=@number;";
                 * //  String s = ListBox1.SelectedItem.Value;
                 * cmd.Parameters.AddWithValue("@number", Int32.Parse(ListBox1.SelectedItem.Text.Substring(6)));
                 * sr = cmd.ExecuteReader();
                 * while (sr.Read())
                 * {
                 *     a.room_no = (int)sr["room_no"];
                 * }//room no into Allocate table
                 * db2.Allocateds.Add(a);
                 * db2.SaveChanges();
                 *
                 * sr.Close();
                 * conn.Close();
                 *
                 * Database1Entities22 db3 = new Database1Entities22();
                 * LoginDb l = new LoginDb();
                 * l.user_id = TextBox1.Text;
                 * l.password = TextBox11.Text;
                 * int x = 1;
                 * l.roleid = x;
                 * // l.secque = TextBox13.Text;
                 *
                 * //l.secans = TextBox14.Text;
                 * db3.LoginDbs.Add(l);
                 * db3.SaveChanges();
                 *
                 *
                 * conn.Open();
                 * cmd.Connection = conn;
                 * cmd.CommandText = "select * from Room where room_no=@room;";
                 * cmd.Parameters.AddWithValue("@room", ListBox1.SelectedItem.Text.Substring(6));
                 *
                 * sr = cmd.ExecuteReader();
                 * sr.Read();
                 *
                 * slots = (int)sr["slots_available"];
                 * slots = slots - 1;
                 * sr.Close();
                 * cmd.CommandText = "update Room set slots_available=@slot where room_no=@room1";
                 *
                 * cmd.Parameters.AddWithValue("@room1", ListBox1.SelectedItem.Text.Substring(6));
                 * cmd.Parameters.AddWithValue("@slot", slots);
                 * cmd.ExecuteNonQuery();
                 * conn.Close();*/

                if (FileUpload1.HasFile)

                {
                    string ext = System.IO.Path.GetExtension(FileUpload1.FileName);
                    cookie1["exte"] = ext;
                    Response.Cookies.Add(cookie1);

                    if (ext == ".jpg")
                    {
                        if (FileUpload1.PostedFile.ContentLength > 2000000)
                        {
                            Label39.Text      = "Image size is greater than 2 MB......";
                            Label39.ForeColor = System.Drawing.Color.Firebrick;
                        }
                        else
                        {
                            FileUpload1.PostedFile.SaveAs(Server.MapPath("Upload\\" + TextBox1.Text + ext));

                            Database1Entities22 db1 = new Database1Entities22();
                            UserDb u1 = new UserDb();
                            // String imgname;
                            u1.user_id  = TextBox1.Text;
                            u1.name     = TextBox2.Text + " " + TextBox3.Text;
                            u1.dob      = DropDownList8.SelectedItem.Text.ToString() + " " + DropDownList9.SelectedItem.Text.ToString() + " " + DropDownList10.SelectedItem.Text.ToString();
                            u1.mobileno = Decimal.Parse(TextBox9.Text);
                            u1.email    = TextBox5.Text;
                            u1.address  = TextBox15.Text;
                            u1.city     = TextBox6.Text;
                            u1.state    = TextBox7.Text;
                            u1.pcode    = Decimal.Parse(TextBox8.Text);
                            u1.sem      = Int32.Parse(TextBox4.Text);
                            u1.branch   = TextBox17.Text;



                            db1.UserDbs.Add(u1);


                            db1.SaveChanges();

                            Database1Entities22 db2 = new Database1Entities22();
                            Allocated           a   = new Allocated();
                            a.user_id = TextBox1.Text; //userid into Allocate table


                            conn.Open();
                            cmd.Connection  = conn;
                            cmd.CommandText = "select * from Room where room_no=@number;";
                            //  String s = ListBox1.SelectedItem.Value;
                            cmd.Parameters.AddWithValue("@number", Int32.Parse(ListBox1.SelectedItem.Text.Substring(6)));
                            sr = cmd.ExecuteReader();
                            while (sr.Read())
                            {
                                a.room_no = (int)sr["room_no"];
                            }//room no into Allocate table
                            db2.Allocateds.Add(a);
                            db2.SaveChanges();

                            sr.Close();
                            conn.Close();

                            Database1Entities22 db3 = new Database1Entities22();
                            LoginDb             l   = new LoginDb();
                            l.user_id  = TextBox1.Text;
                            l.password = TextBox11.Text;
                            int x = 1;
                            l.roleid = x;
                            // l.secque = TextBox13.Text;

                            //l.secans = TextBox14.Text;
                            db3.LoginDbs.Add(l);
                            db3.SaveChanges();


                            conn.Open();
                            cmd.Connection  = conn;
                            cmd.CommandText = "select * from Room where room_no=@room;";
                            cmd.Parameters.AddWithValue("@room", ListBox1.SelectedItem.Text.Substring(6));

                            sr = cmd.ExecuteReader();
                            sr.Read();

                            slots = (int)sr["slots_available"];
                            slots = slots - 1;
                            sr.Close();
                            cmd.CommandText = "update Room set slots_available=@slot where room_no=@room1";

                            cmd.Parameters.AddWithValue("@room1", ListBox1.SelectedItem.Text.Substring(6));
                            cmd.Parameters.AddWithValue("@slot", slots);
                            cmd.ExecuteNonQuery();
                            conn.Close();

                            Response.Redirect("Register2.aspx");
                        }
                    }

                    else
                    {
                        Label39.Text      = "Please Select JPG Image file";
                        Label39.ForeColor = System.Drawing.Color.Firebrick;
                    }
                }

                else
                {
                    Label39.Text      = "Select Image";
                    Label39.ForeColor = System.Drawing.Color.Firebrick;
                }
            }

            else
            {
                string message = "Already Registered.";
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append("<script type = 'text/javascript'>");
                sb.Append("window.onload=function(){");
                sb.Append("alert('");
                sb.Append(message);
                sb.Append("')};");
                sb.Append("</script>");
                ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
                //Label46.Text = "Already Registered";
                //Label46.ForeColor = System.Drawing.Color.ForestGreen;
            }
        }
Beispiel #54
0
    protected void wzdImport_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        var settings = ImportSettings;

        ClearErrorLabel();

        switch (e.CurrentStepIndex)
        {
        // Site details
        case 0:
        {
            if (!siteDetails.ApplySettings())
            {
                e.Cancel = true;
                return;
            }

            Culture = siteDetails.Culture;

            pnlImport.ReloadData(true);
            wzdImport.ActiveStepIndex++;
        }
        break;

        // Objects selection
        case 1:
            if (!pnlImport.ApplySettings())
            {
                e.Cancel = true;
                return;
            }

            // Check licenses
            var error = ImportExportControl.CheckLicenses(settings);
            if (!String.IsNullOrEmpty(error))
            {
                SetErrorLabel(error);

                e.Cancel = true;
                return;
            }

            ImportSettings = pnlImport.Settings;

            PreviousButton.Enabled = false;
            NextButton.Enabled     = false;

            SiteName = settings.SiteName;
            Domain   = settings.SiteDomain;

            // Start asynchronous Import
            settings.SetSettings(ImportExportHelper.SETTINGS_DELETE_TEMPORARY_FILES, false);
            settings.DefaultProcessObjectType = ProcessObjectEnum.Selected;

            var manager = ImportManager;

            settings.LogContext = ctlAsyncImport.CurrentLog;
            manager.Settings    = settings;

            // Import site asynchronously
            ctlAsyncImport.RunAsync(ImportManager.Import, WindowsIdentity.GetCurrent());

            wzdImport.ActiveStepIndex++;
            break;

        // Import progress
        case 2:
            PreviousButton.Visible = false;

            CultureHelper.SetPreferredCulture(Culture);

            if (ImportManager.Settings.IsWarning())
            {
                try
                {
                    // Convert default culture and change root's GUID
                    ImportPostProcess();
                }
                catch (Exception ex)
                {
                    Service.Resolve <IEventLogService>().LogException("NewSiteWizard", "FINISH", ex);
                    SetErrorLabel(ex.Message);
                    e.Cancel = true;

                    NextButton.Enabled   = false;
                    CancelButton.Enabled = false;
                    mImportCanceled      = true;
                    return;
                }
            }
            break;

        case 3:
            break;

        // Other steps
        default:
            wzdImport.ActiveStepIndex = e.NextStepIndex;
            break;
        }
    }
 protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
 }
Beispiel #56
0
 protected void CreateUserWizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     UserProfile1.SaveProfile();
 }
 protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     Result.Text = "Your name is " + YourName.Text;
     Result.Text += "<br />Your favorite language is " +
     FavoriteLanguage.SelectedValue;
 }
 /// <summary>
 /// Handles the FinishButtonClick event of the wzdImportLeads control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Web.UI.WebControls.WizardNavigationEventArgs"/> instance containing the event data.</param>
 protected void wzdDeDup_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     frmManageDuplicates.SetMatchOptions();
 }
Beispiel #59
0
 protected void wzdInstaller_PreviousButtonClick(object sender, WizardNavigationEventArgs e)
 {
     --StepIndex;
     wzdInstaller.ActiveStepIndex -= 1;
 }
Beispiel #60
0
 protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     Result.Text  = "Your name is " + YourName.Text;
     Result.Text += "<br />Your favorite language is " + FavoriteLanguage.SelectedValue;
 }