Esempio n. 1
0
    protected void submitEditQualityLevel(object sender, EventArgs e)
    {
        QualityLevelBusiness business = new QualityLevelBusiness();

        string previousQualityLevel = (string)Session["EditQuality"];
        string newQualityLevel      = qualitylevel.Text;
        bool   activated            = CheckBox1.Checked;
        int    valueCheckBox;

        if (activated)
        {
            valueCheckBox = 1;
        }
        else
        {
            valueCheckBox = 0;
        }

        string error = business.editQualityLevel(previousQualityLevel, newQualityLevel, valueCheckBox);

        if (error != null)
        {
            Errors.Text = error;
        }
        else
        {
            Response.Redirect("QualityLevel.aspx");
        }
    }
Esempio n. 2
0
    protected void deleteQualityLevel(object sender, EventArgs e)
    {
        QualityLevelBusiness business = new QualityLevelBusiness();
        string qualityLevelToDelete   = (string)Session["EditQuality"];;

        business.deleteQualityLevel(qualityLevelToDelete);
        Response.Redirect("QualityLevel.aspx");
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            QualityLevelBusiness business = new QualityLevelBusiness();

            List <string> qualityLevelList = business.getQualityLevels();
            showQualityLevels(qualityLevelList);
            Session["QualityLeveslList"] = qualityLevelList;
        }
        else
        {
            List <string> qualityLevelList = (List <string>)Session["QualityLeveslList"];
            showQualityLevels(qualityLevelList);
        }
    }
Esempio n. 4
0
    protected void CreateQualityLevel(object sender, EventArgs e)
    {
        QualityLevelBusiness business = new QualityLevelBusiness();

        string newQualityLevel = quality.Text;
        int    state           = 1;

        string error = business.insertQualityLevel(newQualityLevel, state);

        if (error != null)
        {
            Errors.Text = error;
        }
        else
        {
            Response.Redirect("QualityLevel.aspx");
        }
    }