protected void save_Click(object sender, EventArgs e)
        {
            var j = new JobEnityManual
            {
                Description = this.description.Text,
                Maximum = Convert.ToByte(this.maximum.Text),
                Minimum = Convert.ToByte(this.minimum.Text)
            };

            var ctx = new PubsManualContext();

            ctx.Jobs.InsertOnSubmit(j);

            ctx.SubmitChanges();

            this.msg.Text = "Data inserted";
            this.BindGridView();
        }
        protected void gv_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            var jobId = (Int16)e.Keys["ID"];

            var ctx = new PubsManualContext();

            if (jobId % 2 == 0)
            {
                var job = ctx.Jobs.First(x => x.ID == jobId);

                if (e.NewValues["Description"] != null)
                {
                    job.Description = (string)e.NewValues["Description"];
                }
                if (e.NewValues["Maximum"] != null)
                {
                    job.Maximum = Convert.ToByte(e.NewValues["Maximum"]);
                }
                if (e.NewValues["Minimum"] != null)
                {
                    job.Minimum = Convert.ToByte(e.NewValues["Minimum"]);
                }

                ctx.SubmitChanges();
            }
            else
            {
                var f = new JobEnityManual
                {
                    ID = jobId,
                    Description = (e.NewValues["Description"] ?? e.OldValues["Description"]).ToString(),
                    Maximum = Convert.ToByte(e.NewValues["Maximum"] ?? e.OldValues["Maximum"]),
                    Minimum = Convert.ToByte(e.NewValues["Minimum"] ?? e.OldValues["Minimum"])
                };

                ctx.Jobs.Attach(f);
                ctx.Refresh(System.Data.Linq.RefreshMode.KeepCurrentValues, f);
                ctx.SubmitChanges();
            }

            this.gv.EditIndex = -1;
            this.BindGridView();
        }