コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int         id = Int32.Parse(Request.QueryString["id"]);
            ProductType p  = ProductTypeHandler.get(id);

            oldNameType.Text        = p.Name;
            oldDescriptionType.Text = p.Description;
        }
コード例 #2
0
        protected void updateCurrentProductType_Click(object sender, EventArgs e)
        {
            int         id = Int32.Parse(Request.QueryString["id"]);
            ProductType p = ProductTypeHandler.get(id);
            String      Name = tbNameType.Text, Description = tbDescriptionType.Text, messageError = "";
            int         ID = p.ID;

            messageError = ProductTypeController.update(Name, Description);

            if (messageError != "")
            {
                lblErrorUpdateProductType.Text = messageError;
            }
            else
            {
                ProductTypeHandler.updateProductType(ID, Name, Description);
                lblErrorUpdateProductType.Text = "Your product type has been updated";
            }
        }