Ejemplo n.º 1
0
        /// <summary>
        /// Created By: Ashwajit bansod
        /// Created Date : 19-Feb-2019
        /// Created For : To save PDF form
        /// </summary>
        /// <param name="Obj"></param>
        /// <returns></returns>
        public bool SavePDFForm(PDFFormModel Obj)
        {
            bool IsSaved = false;

            try
            {
                string action = "";
                if (Obj.FormId == 0)
                {
                    action = "I";
                    var saveVendorType = _workorderems.spSet_eForms(action, null, Obj.ModuleId, Obj.FormName,
                                                                    Obj.FormPath, "N");

                    //var saveVendorType = _workorderems.spSetFormMaster(action,null,Obj.FormType,Obj.FormName,
                    //                                                  Obj.FormPath,"Y");
                    IsSaved = true;
                }
                else
                {
                    action = "U";
                    var saveVendorType = _workorderems.spSet_eForms(action, null, Obj.ModuleId, Obj.FormName,
                                                                    Obj.FormPath, "Y");
                    //var saveVendorType = _workorderems.spSetFormMaster(action, null, Obj.FormType, Obj.FormName,
                    //                                                  Obj.FormPath, "Y");
                    IsSaved = true;
                }
            }
            catch (Exception ex)
            {
                Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public bool SavePDFForm(PDFFormModel Obj)", "Exception While Saving PDF Form.", Obj);
                throw;
            }
            return(IsSaved);
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            var obj = new PDFFormModel();

            ViewBag.AccountSection = true;
            ViewBag.ModuleList     = _IPDFFormManager.GetModuleList();
            return(View(obj));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Created By : Ashwajit Bansod
        /// Created Date : 08-April-2019
        /// Created For : To get all form data to download PDF forms
        /// </summary>
        /// <param name="formID"></param>
        /// <returns></returns>
        public PDFFormModel GetePDFFormDetailsById(long formID)
        {
            try
            {
                var db = new workorderEMSEntities();

                var editFormDetails = new PDFFormModel();
                var FormDetails     = db.eForms.Where(u => u.EFM_Id == formID).Select(
                    a => new PDFFormModel()
                {
                    FormPath = a.EFM_eFormLink
                }).FirstOrDefault();
                return(FormDetails);
            }
            catch (Exception ex)
            {
                Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public PDFFormModel GetePDFFormDetailsById(long formID)", "Exception While getting Form detail by id.", null);
                throw;
            }
        }
Ejemplo n.º 4
0
        public ActionResult SavePDFFormDetails(PDFFormModel objPDFFormModel)
        {
            eTracLoginModel ObjLoginModel = null;

            ViewBag.AccountSection = true;
            if (Session["eTrac"] != null)
            {
                ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
            }
            try
            {
                if (objPDFFormModel.FormPathFile != null)
                {
                    string FileName = ObjLoginModel.UserId + "_" + DateTime.Now.Ticks.ToString() + "_" + Convert.ToString(objPDFFormModel.FormPathFile.FileName);
                    CommonHelper.StaticUploadImage(objPDFFormModel.FormPathFile, Server.MapPath(ConfigurationManager.AppSettings["PDFForm"]), FileName);
                    objPDFFormModel.FormPath = FileName;
                }
                var savedStatus = _IPDFFormManager.SavePDFForm(objPDFFormModel);
                ViewBag.ModuleList = _IPDFFormManager.GetModuleList();
                if (savedStatus == true)
                {
                    ViewBag.Message           = CommonMessage.SaveSuccessMessage();
                    ViewBag.AlertMessageClass = ObjAlertMessageClass.Success;
                    ModelState.Clear();
                }
                else
                {
                    ViewBag.Message           = CommonMessage.FailureMessage();
                    ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;// store the failure message in tempdata to display in view.
                }
                var obj = new PDFFormModel();
                return(View("~/Areas/AdminSection/Views/PDFForm/Index.cshtml", obj));
                //return Json(new { Message = ViewBag.Message, AlertMessageClass = ViewBag.AlertMessageClass }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                ViewBag.Message           = ex.Message;
                ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
                throw ex;
            }
        }