Beispiel #1
0
        public ActionResult InsufficiencyCheckClearByCSSpoc(int id = 0, short ClientRowId = 0, short ChFamilRowId = 0, short subCheckId = 0, int PersonalRowID = 0, string CompanyRefNo = "", string InfRemarks = "")
        {
            InsuffCheckClearViewModel model = new InsuffCheckClearViewModel();

            if (model != null)
            {
                model.CheckRowID    = id;
                model.ClientRowID   = ClientRowId;
                model.ChFamilRowId  = ChFamilRowId;
                model.PersonalRowID = PersonalRowID;
                model.SubCheckRowID = subCheckId;
                model.SecuritasID   = CompanyRefNo;
                model.INFReason     = InfRemarks;
                model.SubCheckName  = repoSubCheck.GetSubCheckFamilyForUpdateById(subCheckId).SubCheckName;
            }
            return(View(model));
        }
Beispiel #2
0
        public ActionResult InsufficiencyCheckClearByCSSpoc(InsuffCheckClearViewModel model, string UploadHid, IEnumerable <HttpPostedFileBase> UploadDoc)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    if (model.PersonalRowID > 0 && ((!string.IsNullOrEmpty(UploadHid) && UploadDoc != null && UploadDoc.FirstOrDefault() != null) || (!string.IsNullOrEmpty(model.Remarks))))
                    {
                        if (!string.IsNullOrEmpty(UploadHid) && UploadDoc != null && UploadDoc.FirstOrDefault() != null)
                        {
                            int      count         = 0;
                            string[] DocumentTypes = UploadHid.Split(',');
                            foreach (var item in UploadDoc)
                            {
                                model.FileName     = item.FileName.ToString();
                                model.DocumentType = DocumentTypes[count];
                                if (model.DocumentType != null && model.FileName != null && item.ContentLength > 0)
                                {
                                    SavePQVerifiedUploadDoc(model.PersonalRowID, model.SubCheckRowID, "Provided", model.DocumentType, "provideddocuments", item, model.Remarks, 0, model.SecuritasID);
                                }
                                else
                                {
                                    ViewBag.ErrorMsg = "Invalid Document!";
                                    break;
                                }
                                count++;
                            }

                            if (string.IsNullOrEmpty(model.Remarks))
                            {
                                model.Remarks = "Insuff Document Uploaded By Spoc";
                            }
                        }
                        repoPQPersonal.UpdateInsuffCheckByPeraonalIdAndSubCheckID(model.ChFamilRowId, model.CheckRowID, model.Remarks);

                        #region Save LogTransaction Details
                        clsCommonMethods.AddPQLogTrasaction(model.PersonalRowID, "InsufficiencyCheckClearByClient", "Insuff Clear By Client Spoc", model.DocumentType, "Insert");
                        #endregion

                        #region Case/Check Action History Save
                        clsCommonMethods.AddCheckActionHistory(model.PersonalRowID, model.SubCheckRowID, "Insuff Clear By Client Spoc", model.Remarks);
                        #endregion

                        int PID = model.PersonalRowID;
                        TempData["SuccessMsg"] = "Record Added Successfully!";
                        ModelState.Clear();
                        return(RedirectToAction("Index"));
                    }
                    else
                    {
                        ViewBag.ErrorMsg = "Please select at least one document or mention remarks!";
                    }
                }
                else
                {
                    var query = from state in ModelState.Values
                                from error in state.Errors
                                select error.ErrorMessage;

                    var    errorList = query.ToList();
                    string strError  = string.Empty;
                    foreach (string str in errorList)
                    {
                        strError += str + "\n";
                    }
                    ModelState.AddModelError("", strError);
                }
            }
            catch (Exception Ex)
            {
                ViewBag.ErrorMsg = Ex.Message;
                clsCommonMethods.ErrorLog(Server.MapPath("~\\ErrorLogs\\Logfiles"), Ex.Message, Ex.StackTrace);
            }
            return(View(model));
        }