コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tbl_Certification tbl_Certification = db.tbl_Certification.Find(id);

            db.tbl_Certification.Remove(tbl_Certification);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        protected void btndel_click(object sender, EventArgs e)
        {
            string            value = hfdselid.Value;
            tbl_Certification obj   = new tbl_Certification();

            obj.Cert_id = Convert.ToInt32(value);
            Person_Details.Licensing_Details.Delete_Certifications(obj);
            altbox("Record deleted successfully.");
        }
コード例 #3
0
 public ActionResult Edit(tbl_Certification tbl_Certification)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_Certification).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbl_Certification));
 }
コード例 #4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(View("Notfound"));
            }
            tbl_Certification tbl_Certification = db.tbl_Certification.Find(id);

            if (tbl_Certification == null)
            {
                return(View("Notfound"));
            }
            return(View(tbl_Certification));
        }
コード例 #5
0
        protected void btn_submit_Click(object sender, EventArgs e)
        {
            if (hfdcerti_id.Value == "0")
            {
                tbl_Certification ctf = new tbl_Certification();
                ctf.Cert_id      = Convert.ToInt32(hfdcerti_id.Value);
                ctf.Cert_Type    = ddl_certification_type.SelectedValue;
                ctf.Person_id    = Convert.ToInt32(hfdperid.Value);
                ctf.status       = ddl_status.SelectedValue;
                ctf.Certno       = "";
                ctf.Effective_dt = Convert.ToDateTime(effective_date.Text.ToString());
                ctf.Expiry_dt    = Convert.ToDateTime(exp_date.Text.ToString());
                ctf.Orginal_Date = Convert.ToDateTime(txt_orginaldate.Text);
                ctf.Comments     = txt_comments.Text;
                ctf.modifiedby   = Session["UID"].ToString();
                ctf.modifieddt   = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                ctf.createdby    = Session["UID"].ToString();
                ctf.createddt    = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                Person_Details.Licensing_Details.Insert_Certifications(ctf);
                altbox("Record inserted successfully.");

                Clear();
            }
            else
            {
                tbl_Certification ctf = new tbl_Certification();
                ctf.Cert_id      = Convert.ToInt32(hfdcerti_id.Value);
                ctf.Cert_Type    = ddl_certification_type.SelectedValue;
                ctf.Person_id    = Convert.ToInt32(hfdperid.Value);
                ctf.status       = ddl_status.SelectedValue;
                ctf.Certno       = "";
                ctf.Effective_dt = Convert.ToDateTime(effective_date.Text.ToString());
                ctf.Expiry_dt    = Convert.ToDateTime(exp_date.Text.ToString());
                ctf.Orginal_Date = Convert.ToDateTime(txt_orginaldate.Text);
                ctf.Comments     = txt_comments.Text;
                ctf.modifiedby   = Session["UID"].ToString();
                ctf.modifieddt   = Convert.ToDateTime(DateTime.Now.ToShortDateString());

                Person_Details.Licensing_Details.Update_Certifications(ctf);
                altbox("Record updated successfully.");

                Clear();
            }
        }
コード例 #6
0
        public ActionResult Create(tbl_Certification tbl_Certification)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    db.tbl_Certification.Add(tbl_Certification);
                    db.SaveChanges();
                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception)
            {
                TempData["Message"] = "These details are already existed";
            }



            return(View(tbl_Certification));
        }