Exemple #1
0
        public ActionResult Save(tblCatalog oCatalog)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    bool Add_Flg = new CommonBL().isNewEntry(oCatalog.Id);
                    if (Add_Flg)
                        new CatalogBL().Create(oCatalog);
                    else
                        new CatalogBL().Update(oCatalog);

                    //TempData["successmsg"] = CommonMsg.Success_Update(EntityNames.Company);
                    return RedirectToAction("ManageCatalog", new { id = oCatalog.Id });
                }
                catch (Exception ex)
                {
                    //TempData["errormsg"] = CommonMsg.Error();
                    return RedirectToAction("Index");
                }
            }
            else
            {
                //TempData["errormsg"] = CommonMsg.Error();
                return RedirectToAction("Index");
            }
        }
Exemple #2
0
        public ActionResult Save(tblStudent oStudent)
        {
            try
            {
                bool Add_Flg = new CommonBL().isNewEntry(oStudent.StudentId);
                if (Add_Flg)
                    new StudentBL().Create(oStudent);
                else
                    new StudentBL().Update(oStudent);

                TempData["successmsg"] = CommonMsg.Success_Update(EntityNames.Student);
                return RedirectToAction("ManageStudent", new { id = oStudent.StudentId });
            }
            catch (Exception ex)
            {
                TempData["errormsg"] = CommonMsg.Error();
                return RedirectToAction("Index");
            }
        }