Ejemplo n.º 1
0
        protected void saveButton_Click(object sender, EventArgs e)
        {
            CenterCreate aCenterCreate = new CenterCreate();
            ShowCenterUI aShowCenterUi = new ShowCenterUI();

            aCenterCreate.Name = centerNameTextBox.Text;
            string thana = thanaDropDownList.SelectedItem.ToString();

            aCenterCreate.ThanaID    = aCenterCreateManager.GetIDByThanaName(thana);
            aCenterCreate.DistrictID = aCenterCreateManager.GetDistrictIDByThanaName(thana);
            aCenterCreate.Code       = GenerateCode(thana);
            aCenterCreate.Password   = CreateRandomPassword();

            if (aCenterCreate.Name != "")
            {
                showLabel.Text      = aCenterCreateManager.Save(aCenterCreate);
                Session["Name"]     = centerNameTextBox.Text;
                Session["Code"]     = aCenterCreate.Code;
                Session["Password"] = aCenterCreate.Password;
                Response.Redirect("ShowCenterUI.aspx");
            }
            else
            {
                showLabel.Text = "Not saved. Please enter information correctly.";
            }
        }
        protected void saveButton_Click(object sender, EventArgs e)
        {
            CenterCreate aCenterCreate = new CenterCreate();
            ShowCenterUI aShowCenterUi = new ShowCenterUI();

            aCenterCreate.Name = centerNameTextBox.Text;
            string thana = thanaDropDownList.SelectedItem.ToString();
            aCenterCreate.ThanaID = aCenterCreateManager.GetIDByThanaName(thana);
            aCenterCreate.DistrictID = aCenterCreateManager.GetDistrictIDByThanaName(thana);
            aCenterCreate.Code = GenerateCode(thana);
            aCenterCreate.Password = CreateRandomPassword();

            if (aCenterCreate.Name != "")
            {
                showLabel.Text = aCenterCreateManager.Save(aCenterCreate);
                Session["Name"] = centerNameTextBox.Text;
                Session["Code"] = aCenterCreate.Code;
                Session["Password"] = aCenterCreate.Password;
                Response.Redirect("ShowCenterUI.aspx");
            }
            else
            {
                showLabel.Text = "Not saved. Please enter information correctly.";
            }
        }