protected void btnSubmit_Click(object sender, EventArgs e) { wh = new WarehouseType(); string warehouseName = Request.Form[txtWarehouseName.ID].Trim(); if (string.IsNullOrEmpty(warehouseName)) { return; } wh.WarehouseName = warehouseName; wh.WarehouseCode = txtCode.Value; wh.Address = txtAddress.Value; wh.Description = txtDesc.Value; if (id != 0) { wh.Id = id; wh.update(); } else { wh.insert(); } }