public ActionResult GuideLines(GuideLineViewModel gvm, HttpPostedFileBase inputFile) {
            if (!string.IsNullOrEmpty(gvm.GuideLine.IssuingAuthority)) {
                if (!string.IsNullOrEmpty(gvm.GuideLine.Subject)) {
                    if (!string.IsNullOrEmpty(gvm.GuideLine.Year)) {
                        if (inputFile != null && inputFile.ContentLength > 0) {
                            if (inputFile.ContentType == "application/pdf") {
                                if (gvm.GuideLine.IssuingAuthority.Equals("OTHERS")) {
                                    string strIssuingAuthority = gvm.OIssuingAutherity.Trim().ToUpper();
                                    if (!string.IsNullOrEmpty(strIssuingAuthority)) {
                                        string keyName = "IssuingAuthority";
                                        if (keyName != string.Empty) {
                                            gvm.GuideLine.IssuingAuthority = gvm.OIssuingAutherity.Trim().ToUpper();
                                            string keyValue = gvm.GuideLine.IssuingAuthority;
                                            AddParam(keyName, keyValue);
                                        }
                                    }
                                    else {
                                        TempData["Error"] = "Please Enter Issuing Authority.";
                                    }
                                }

                                Guid FileName = Guid.NewGuid();
                                gvm.GuideLine.FilePath = "/Uploads/GuideLines/" + FileName + ".pdf";
                                string tPath = Path.Combine(Server.MapPath("~/Uploads/GuideLines/"), FileName + ".pdf");
                                inputFile.SaveAs(tPath);

                                gvm.GuideLine.CreatedBy = Request.Cookies["INDMS"]["UserID"];
                                gvm.GuideLine.CreatedDate = null;

                                db.GuideLines.Add(gvm.GuideLine);
                                db.SaveChanges();

                                TempData["RowId"] = gvm.GuideLine.ID;
                                TempData["MSG"] = "Save Successfully";

                                return RedirectToAction("GuideLines");
                            }
                        }
                    }
                    else {
                        TempData["Error"] = "Please Enter Year";
                    }
                }
                else {
                    TempData["Error"] = "Please Enter Subject.";
                }
            }
            else {
                TempData["Error"] = "Please select IssuingAuthority.";
            }
            gvm.GuideLines = db.GuideLines.OrderByDescending(x => x.ID);
            return View(gvm);
        }
 public ActionResult GuideLines() {
     GuideLineViewModel gvm = new GuideLineViewModel();
     gvm.GuideLines = db.GuideLines.OrderByDescending(x => x.ID);
     return View(gvm);
 }