示例#1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                using (SalesDBEntities1 objEntity = new SalesDBEntities1())
                {
                    followup objProNew = new followup();
                    objProNew.followupDate   = Convert.ToDateTime(txtFD.Text);
                    objProNew.isActive       = true;
                    objProNew.isDone         = false;
                    objProNew.inquiryID      = Convert.ToInt64(ddlStore.SelectedValue);
                    objProNew.followupDetail = txtDetail.Text;

                    objEntity.followups.Add(objProNew);
                    objEntity.SaveChanges();



                    Response.Redirect("~/followups.aspx", false);
                }
            }
            catch (Exception ex)
            {
                appOperations.LogException(ex, "User Save");
                liVal.Text = ex.Message;
            }
        }
 protected void lbtnClose_Click(object sender, EventArgs e)
 {
     try
     {
         LinkButton lbtn   = (LinkButton)sender;
         decimal    onjInq = Convert.ToDecimal(lbtn.CommandArgument);
         using (SalesDBEntities1 objEntity = new SalesDBEntities1())
         {
             followup objpro = objEntity.followups.FirstOrDefault(Pro => Pro.followupID == onjInq);
             if (objpro != null)
             {
                 objpro.isActive = false;
                 objpro.isDone   = true;
                 objEntity.SaveChanges();
             }
         }
         gvProduct.DataBind();
     }
     catch (Exception ex)
     {
         appOperations.LogException(ex, "");
         liVal.Text = ex.Message;
     }
 }