Esempio n. 1
0
    protected void btnEditMatrialAmount_Click(object sender, EventArgs e)
    {
        long                materialID     = Convert.ToInt64(hidMaterialID.Value);
        decimal             length         = Convert.ToDecimal(hidLength.Value);
        decimal             width          = Convert.ToDecimal(hidWidth.Value);
        WaiveMaterialAmount materialAmount = new WaiveMaterialAmount(waiveID, materialID, length, width);

        materialAmount.Amount = Convert.ToDecimal(txtEditMaterialAmount.Text);
        materialAmount.Save();
        Response.Redirect(Request.RawUrl);
    }
Esempio n. 2
0
    protected void btnAddMaterialAmount_Click(object sender, EventArgs e)
    {
        WaiveMaterialAmount materialAmount = new WaiveMaterialAmount();

        materialAmount.Amount = Convert.ToDecimal(txtMaterialAmount.Text);

        string lenght = txtLength.Text;
        string width  = txtWidth.Text;

        if (!String.IsNullOrEmpty(lenght))
        {
            materialAmount.Length = Convert.ToDecimal(lenght);
        }

        if (!String.IsNullOrEmpty(width))
        {
            materialAmount.Width = Convert.ToDecimal(width);
        }

        materialAmount.WaiveID    = waiveID;
        materialAmount.MaterialID = Convert.ToInt64(hidMaterialID.Value);
        materialAmount.Add();
        Response.Redirect(Request.RawUrl);
    }