Exemplo n.º 1
0
 protected void btnSave_Click(object sender, ImageClickEventArgs e)
 {
     using (clsSchool school = new clsSchool())
     {
         school.SchoolCode      = txtSchlCode.Text;
         school.SchoolName      = txtSchoolName.Text;
         school.SchoolNameAlt   = txtSchoolNameAlt.Text;
         school.SCatCode        = ddlSchoolType.SelectedValue;
         school.Address         = txtAddress.Text;
         school.TelNumber       = txtTelNumber.Text;
         school.FaxNumber       = txtFaxNumber.Text;
         school.CEO             = txtCEO.Text;
         school.COO             = txtCOO.Text;
         school.CM              = ddlCM.SelectedValue;
         school.HQOwned         = (chkHQOwned.Checked ? "1" : "0");
         school.LastUpdatedBy   = Request.Cookies["Speedo"]["UserName"].ToString();
         school.LastUpdatedDate = DateTime.Now;
         school.Update();
     }
 }
Exemplo n.º 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        using (clsSchool branches = new clsSchool()) {
            branches.branchName    = tbBranchnm.Text;
            branches.branchAddress = tbBranchaddress.Text;
            branches.branchEmail   = tbBranchEmail.Text;
            branches.branchContact = tbBranchcontact.Text;
            branches.branchManager = tbBranchmnger.Text;

            if (branches.insert() == 1)
            {
                tbBranchnm.Text      = "";
                tbBranchaddress.Text = "";
                tbBranchEmail.Text   = "";
                tbBranchcontact.Text = "";
                tbBranchmnger.Text   = "";
                //ScriptManager.RegisterStartupScript(this, GetType(), "Success!", "alert('You have successfully added new branch'); window.location='" + Request.ApplicationPath + "CMD/SIS/Branches.aspx';", true);
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "none", "<script>$('#myModalSuccessEntry').modal('show');</script>", false);
            }
        }
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        clsSpeedo.Authenticate();

        if (!Page.IsPostBack)
        {
            clsSIS.AuthenticateUser(clsSIS.SISUsers.Encoder, Request.Cookies["Speedo"]["UserName"]);

            ddlSchoolType.DataSource     = clsSchool.GetSchoolCategoryDDLDataSource().DefaultView;
            ddlSchoolType.DataValueField = "pvalue";
            ddlSchoolType.DataTextField  = "ptext";
            ddlSchoolType.DataBind();

            ddlCM.DataSource     = clsSchool.GetCMDDLDataSource().DefaultView;
            ddlCM.DataValueField = "pvalue";
            ddlCM.DataTextField  = "ptext";
            ddlCM.DataBind();

            using (clsSchool school = new clsSchool())
            {
                school.SchoolCode = Request.QueryString["schlcode"];
                school.Fill();
                txtSchlCode.Text            = school.SchoolCode;
                txtSchoolName.Text          = school.SchoolName;
                txtSchoolNameAlt.Text       = school.SchoolNameAlt;
                ddlSchoolType.SelectedValue = school.SCatCode;
                txtAddress.Text             = school.Address;
                txtTelNumber.Text           = school.TelNumber;
                txtFaxNumber.Text           = school.FaxNumber;
                txtCEO.Text         = school.CEO;
                txtCOO.Text         = school.COO;
                ddlCM.SelectedValue = school.CM;
                chkHQOwned.Checked  = (school.HQOwned == "1" ? true : false);
            }
        }
    }