コード例 #1
0
        protected void Insert(object sender, EventArgs e)
        {
            lblMensaje.Text = "";
            if (txtBrand.Text != "" && txtCostUSD.Text != "" && txtModel.Text != "")
            {
                using (DroidikaContextDataContext ctx = new DroidikaContextDataContext())
                {
                    dCatCamera cam = new dCatCamera
                    {
                        brand = txtBrand.Text,
                        model = txtModel.Text,
                        costUsd = decimal.Parse(txtCostUSD.Text),
                    };
                    ctx.dCatCameras.InsertOnSubmit(cam);
                    ctx.SubmitChanges();
                }

                txtBrand.Text = "";
                txtCostUSD.Text = "";
                txtModel.Text = "";

                this.BindGrid();
            }
            else
            {
                lblMensaje.Text = "Favor de introducir los campos requeridos.";
            }
        }
コード例 #2
0
        protected void Insert(object sender, EventArgs e)
        {
            using (DroidikaContextDataContext ctx = new DroidikaContextDataContext())
            {
                dCatCamera cam = new dCatCamera
                {
                    brand = txtBrand.Text,
                    model = txtModel.Text,
                    costUsd = decimal.Parse(txtCostUSD.Text),
                };
                ctx.dCatCameras.InsertOnSubmit(cam);
                ctx.SubmitChanges();
            }

            this.BindGrid();
        }
コード例 #3
0
 partial void DeletedCatCamera(dCatCamera instance);
コード例 #4
0
 partial void UpdatedCatCamera(dCatCamera instance);
コード例 #5
0
 partial void InsertdCatCamera(dCatCamera instance);