Example #1
0
        public string InsertUpdateFollowUp(CustomerExpeditingListViewModel customerObj)
        {
            try
            {
                AppUA _appUA = Session["AppUA"] as AppUA;
                customerObj.followUpObj.commonObj = new CommonViewModel();
                SPAccounts.DataAccessObject.DTO.Common _comonObj = new SPAccounts.DataAccessObject.DTO.Common();
                customerObj.followUpObj.commonObj.CreatedBy   = _appUA.UserName;
                customerObj.followUpObj.commonObj.CreatedDate = _comonObj.GetCurrentDateTime();
                customerObj.followUpObj.commonObj.UpdatedDate = _comonObj.GetCurrentDateTime();
                customerObj.followUpObj.commonObj.UpdatedBy   = _appUA.UserName;
                FollowUpViewModel followupObj = Mapper.Map <FollowUp, FollowUpViewModel>(_paymentFollowupBusiness.InsertUpdateFollowUp(Mapper.Map <FollowUpViewModel, FollowUp>(customerObj.followUpObj)));

                if (customerObj.followUpObj.ID == Guid.Empty)
                {
                    return(JsonConvert.SerializeObject(new { Result = "OK", Records = followupObj, Message = "Insertion successfull" }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new { Result = "OK", Records = followupObj, Message = "Updation successfull" }));
                }
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
Example #2
0
        public IActionResult GetQuoteFollowUp(string QRFID)
        {
            try
            {
                FollowUpViewModel model    = new FollowUpViewModel();
                FollowUpGetRes    response = new FollowUpGetRes();
                FollowUpGetReq    request  = new FollowUpGetReq();
                request.QRFID  = QRFID;
                response       = salesProviders.GetFollowUpForQRF(request, token).Result;
                model.FollowUp = response.FollowUp;

                FollowUpMasterGetRes masterResponse = new FollowUpMasterGetRes();
                request.CompanyId = ckUserCompanyId;
                masterResponse    = salesProviders.GetFollowUpMasterData(request, token).Result;

                model.FollowUpTaskList = masterResponse.FollowUpTaskList;
                model.InternalUserList = masterResponse.InternalUserList;
                model.ExternalUserList = masterResponse.ExternalUserList;

                model.InternalUserList.ForEach(a => { a.FIRSTNAME = a.CommonTitle + " " + a.FIRSTNAME + " " + a.LastNAME; a.Contact_Id = a.Contact_Id + "|" + a.MAIL; });
                model.ExternalUserList.ForEach(a => { a.FIRSTNAME = a.CommonTitle + " " + a.FIRSTNAME + " " + a.LastNAME; a.Contact_Id = a.Contact_Id + "|" + a.MAIL; });

                model.FollowUpDate = DateTime.Now;
                model.QRFID        = QRFID;

                return(PartialView("_FollowUp", model));
            }
            catch (Exception ex)
            {
                throw;
                return(View());
            }
        }
        // GET: FollowUp/Edit/{id}
        public ActionResult Edit(int?id)
        {
            TempData["FollowUpId"] = id;
            var organisationId = UserOrganisationId;

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var followUp = NidanBusinessService.RetrieveFollowUp(organisationId, id.Value);

            if (followUp == null)
            {
                return(HttpNotFound());
            }
            var interestedCourses   = followUp.Enquiry?.EnquiryCourses.Select(e => e.CourseId).ToList();
            var interestedCourseIds = followUp.FollowUpType == "Enquiry" ? interestedCourses : followUp.IntrestedCourseId.ToIEnumarable();

            var courses = NidanBusinessService.RetrieveCourses(organisationId, p => true)
                          .Where(e => interestedCourseIds?.Contains(e.CourseId) ?? true);

            var viewModel = new FollowUpViewModel
            {
                FollowUp = followUp,
                Courses  = new SelectList(courses, "CourseId", "Name")
            };

            viewModel.TitleList = new SelectList(viewModel.TitleType, "Value", "Name");
            return(View(viewModel));
        }
Example #4
0
        public JsonResult SetQuoteFollowUp(FollowUpViewModel model)
        {
            FollowUpSetRes response = new FollowUpSetRes();
            FollowUpSetReq request  = new FollowUpSetReq();

            request.QRFID = model.QRFID;

            if (!string.IsNullOrEmpty(model.FollowUpTime))
            {
                var time = model.FollowUpTime.Split(":");
                model.FollowUpDate = model.FollowUpDate.AddHours(Convert.ToDouble(time[0])).AddMinutes(Convert.ToDouble(time[1]));
            }

            FollowUpTask task = new FollowUpTask();

            task.Task             = model.FollowUpTask;
            task.FollowUpType     = model.FollowUpType;
            task.FollowUpDateTime = model.FollowUpDate;

            task.FromName       = ckUserName;
            task.FromContact_Id = ckUserContactId;
            task.FromEmail      = ckUserEmailId;

            if (model.FollowUpType == "Internal")
            {
                task.ToName       = model.InternalUserName;
                task.ToContact_Id = model.InternalUser.Split("|")[0];
                task.ToEmail      = model.InternalUser.Split("|")[1];
            }
            else
            {
                task.ToName       = model.ExternalUserName;
                task.ToContact_Id = model.ExternalUser.Split("|")[0];
                task.ToEmail      = model.ExternalUser.Split("|")[1];
            }

            task.Status = "Requested";
            task.Notes  = model.Notes;

            var FollowUpTaskList = new List <FollowUpTask>();

            FollowUpTaskList.Add(task);

            request.FollowUp.Add(new FollowUp
            {
                FollowUp_Id  = Guid.NewGuid().ToString(),
                FollowUpTask = FollowUpTaskList,
                CreateUser   = ckUserEmailId,
                CreateDate   = DateTime.Now
            });

            response = salesProviders.SetFollowUpForQRF(request, token).Result;

            if (response != null)
            {
                return(Json(response.ResponseStatus));
            }
            return(Json("failure"));
        }
Example #5
0
        public ActionResult Followup(FollowUpViewModel followObj)
        {
            List <FollowUpViewModel> followUpObj = Mapper.Map <List <FollowUp>, List <FollowUpViewModel> >(_paymentFollowupBusiness.GetFollowUpDetails(followObj.CustomerID != null && followObj.CustomerID.ToString() != "" ? Guid.Parse(followObj.CustomerID.ToString()) : Guid.Empty));
            int openCount = followUpObj == null ? 0 : followUpObj.Where(Q => Q.Status == "Open").Select(T => T.ID).Count();
            FollowUpListViewModel Result = new FollowUpListViewModel();

            Result.FollowUpList = followUpObj;
            Result.FlwID        = followObj.ID;
            ViewBag.Count       = openCount;
            return(PartialView("_FollowUpList", Result));
        }
Example #6
0
 public FollowUpDetailPage()
 {
     try
     {
         NavigationPage.SetBackButtonTitle(this, "");
         InitializeComponent();
         BindingContext = viewModel = new FollowUpViewModel(Navigation);
         //_list.ItemsSource = viewModel.list;
     }
     catch (Exception ex)
     {
     }
 }
Example #7
0
        public ActionResult Index(FollowUpViewModel model)
        {
            if (ModelState.IsValid)
            {
                System.Globalization.PersianCalendar pc = new System.Globalization.PersianCalendar();

                var db  = new DataLayer.RegistrationDbContext();
                var reg = db.RegisterForms.Where(o => o.NatinalCode == model.NatinalCode && o.Mobile == model.Mobile).FirstOrDefault();
                if (reg == null)
                {
                    ModelState.AddModelError("NatinalCode", "اطلاعات درخواستی در سیستم ثبت نام وجود ندارد!");
                    return(View(model));
                }
                else
                {
                    if (reg.IsPaied)
                    {
                        //return View("Cart", new CartViewModel() {
                        //    Family = reg.Family,
                        //    Name = reg.Name,
                        //    NatinalCode = reg.NatinalCode,
                        //    PhotoFilename = reg.PhotoFilename,
                        //    RegisterOn = pc.GetYear(reg.RegisterOn) + "/" + pc.GetMonth(reg.RegisterOn) + "/" + pc.GetDayOfMonth(reg.RegisterOn),
                        //    SeatNumber = reg.SeatNumber
                        //});
                        ViewBag.Id      = reg.Id;
                        ViewBag.IsPaied = true;
                        //ModelState.AddModelError("Id", "پرداخت شما با موفقیت انجام شده است، شما می توانید در بازه زمانی تعیین شده برای دریافت کارت ورود به جلسه اقدام کنید.");
                    }
                    else

                    {
                        model.CaptchaInputText = "";
                        ViewBag.Id             = reg.Id;
                        ViewBag.IsPaied        = false;
                        ModelState.AddModelError("Id", "اطلاعات ثبت شده است، ولی پرداخت به درستی انجام نشده است!");
                    }
                }
            }
            model.CaptchaInputText = "";
            return(View(model));
        }
Example #8
0
        //public ActionResult ColdLeadsdev()
        //{
        //    var result = _service.GetAllColdLeads();
        //    return View(result);

        //}
        public ActionResult FollowUp()
        {
            FollowUpViewModel fuvm  = new FollowUpViewModel();
            IList <Lead>      leads = new List <Lead>();

            var username = HttpContext.User.Identity.Name;

            fuvm.user = _UserRepository.GetUserByUsername(username);
            var results = _service.GetAllFollowUpLeads(fuvm.user.UserId);

            foreach (var result in results)
            {
                if (!leads.Any().Equals(result))
                {
                    leads.Add(result);
                }
            }
            fuvm.FollowUP = leads;
            return(View(fuvm));
        }
        public ActionResult Edit(FollowUpViewModel followUpViewModel)
        {
            var organisationId = UserOrganisationId;
            var centreId       = UserCentreId;
            var personnelId    = UserPersonnelId;

            if (ModelState.IsValid)
            {
                followUpViewModel.FollowUp.OrganisationId = organisationId;
                followUpViewModel.FollowUp.CentreId       = centreId;
                followUpViewModel.FollowUp.CreatedBy      = UserPersonnelId;
                followUpViewModel.FollowUp = NidanBusinessService.UpdateFollowUp(organisationId, followUpViewModel.FollowUp);
                return(RedirectToAction("Index"));
            }
            var viewModel = new FollowUpViewModel
            {
                FollowUp = followUpViewModel.FollowUp,
                Courses  = new SelectList(NidanBusinessService.RetrieveCourses(organisationId, e => true).ToList(), "CourseId", "Name")
            };

            return(View(viewModel));
        }
Example #10
0
        private void FollowUp_Click(object sender, EventArgs e)
        {
            FollowUpDialog dialog = new FollowUpDialog();

            if (_FollowUpValue != null)
            {
                dialog.Value = _FollowUpValue;
            }

            else
            {
                dialog.AmountValue = Value.Amount;
            }

            if (dialog.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            _FollowUpValue = dialog.Value;

            this.FollowUp.ImageIndex = 0;
        }
 public FollowUpPage()
 {
     NavigationPage.SetBackButtonTitle(this, "");
     InitializeComponent();
     BindingContext = _followUpViewModel = new FollowUpViewModel(Navigation);
 }
Example #12
0
        public string GetFollowUpDetailByFollowUpId(Guid ID)
        {
            FollowUpViewModel followupObj = Mapper.Map <FollowUp, FollowUpViewModel>(_paymentFollowupBusiness.GetFollowupDetailsByFollowUpID(ID != null && ID.ToString() != "" ? Guid.Parse(ID.ToString()) : Guid.Empty));

            return(JsonConvert.SerializeObject(new { Result = "OK", Records = followupObj }));
        }
Example #13
0
        private void Save_Click(object sender, EventArgs e)
        {
            if (!IsValid())
            {
                MessageBox.Show("اطلاعات فرم بدرستی وارد نشده است. لطفا پس از بررسی نسبت به ذخیره سازی اقدام نمایید.",
                                "بررسی اطلاعات",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                return;
            }
            if (Value.StatusType == Model.Status.Type.Delivery && FollowUp.ImageIndex == 1)
            {
                MessageBox.Show(
                    string.Format("امکان ثبت چک در وضعیت {0} وجود ندارد.\n مشخصات تحویل گیرنده را در قسمت پیگیری وارد نکرده اید. ",
                                  Model.Status.GetString(Value.StatusType)), "بررسی اطلاعات چک",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            if (Value.StatusType != Model.Status.Type.Delivery && _FollowUpValue != null)
            {
                DialogResult result = MessageBox.Show(
                    string.Format("به دلیل تغییر وضعیت چک از {0} به {1} اطلاعات پیگیری حذف خواهد شد. آیا با این موضوع موافق هستید؟",
                                  Model.Status.GetString(Model.Status.Type.Delivery), Model.Status.GetString(Value.StatusType)),
                    "بررسی اطلاعات چک",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Warning);

                if (result != System.Windows.Forms.DialogResult.Yes)
                {
                    Status.SelectedIndex = Status.Items.IndexOf(Model.Status.GetString(Model.Status.Type.Delivery));
                    return;
                }

                CheckRepository.ClearFollowUp(Value.CheckID);

                _FollowUpValue = null;

                FollowUp.ImageIndex = 1;
            }

            CheckRepository repository = new CheckRepository();

            this.Tag = repository.SaveCheck(Value);

            if (_FollowUpValue != null && Value.StatusType == Model.Status.Type.Delivery)
            {
                repository.SaveFollowUp(Value.CheckID, _FollowUpValue);
            }

            MessageBox.Show("اطلاعات چک با موفقیت ذخیره شد.", "ذخیره سازی اطلاعات...", MessageBoxButtons.OK,
                            MessageBoxIcon.Information);

            if (_FollowUpValue != null && Value.StatusType == Model.Status.Type.Delivery)
            {
                if (MessageBox.Show("آیا تمایل به چاپ رسید چک برگشتی دارید؟", "چاپ رسید چک برگشتی",
                                    MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) != System.Windows.Forms.DialogResult.Yes)
                {
                    return;
                }

                ReportUI report = new ReportUI();

                report.CheckID = (int)this.Tag;

                report.ShowDialog();
            }
        }