Пример #1
0
        protected void btnAddBug_Click(object sender, EventArgs e)
        {
            int User = (int)Session["User"];

              if (txtDescription.Text == "" || ddlProducts.SelectedValue == "")
              {
            Response.Write(@"<script language='javascript'>alert('Both Fields are required');</script>");
              }
              else
              {
            // add bug to db
            using (DataClasses1DataContext db = new DataClasses1DataContext())
            {
              Bug newBug = new Bug();
              newBug.Description = txtDescription.Text;
              newBug.ProductName = ddlProducts.SelectedValue;
              newBug.ReporterID = User;

              db.Bugs.InsertOnSubmit(newBug);
              db.SubmitChanges();

              var id = (from a in db.Bugs
                    select a.BugID).Max();

              BugHistory newHistory = new BugHistory();
              newHistory.BugID = id;
              newHistory.OwnerID = -1;
              newHistory.Status = "Open";
              newHistory.DateStamp = DateTime.Now;

              db.BugHistories.InsertOnSubmit(newHistory);
              db.SubmitChanges();
            }
            Response.Redirect("BugsGalore.aspx");
              }
        }
Пример #2
0
 partial void DeleteBug(Bug instance);
Пример #3
0
 partial void UpdateBug(Bug instance);
Пример #4
0
 partial void InsertBug(Bug instance);