コード例 #1
0
        public ActionResult NewViewTransaction(string Comment, string UserAction, string CommentHold, string ID, string SolvedBy, string EjID, string feedbackid, string SubmitEnable, string back, string Submit)
        {
            if (Session["User"] == null)
            {
                return(RedirectToAction("LogIn", "LogIn"));
            }
            if (((tbl_UserDetail)Session["User"]).GroupPages.Contains("Report"))
            {
                try
                {
                    ViewModelClass.ViewTransactionModel transactionData = new ViewModelClass.ViewTransactionModel();
                    var searchobj = (ViewModelClass.ViewReportSeachDataModel)TempData["SearchDetail"];
                    if (!string.IsNullOrEmpty(SolvedBy))
                    {
                        TempData["Sovedby"] = SolvedBy.Trim();
                    }


                    List <string>  T24ImageUrls    = new List <string>();
                    List <string>  WeCareImageUrls = new List <string>();
                    tbl_UserDetail user            = (tbl_UserDetail)Session["User"];
                    if (!string.IsNullOrEmpty(back))            //Back Button Clicked...............................
                    {
                        if (user.UserGroup != Constants.UserGroups.Admin)
                        {
                            string solvedby = Convert.ToString(TempData["Sovedby"]);
                            if (SubmitEnable.ToLower() == "y")
                            {
                                solvedby = TempData["Sovedby"].ToString();

                                UserTransactionData userTransactionData1 = new UserTransactionData();
                                if (solvedby.Trim().ToLower() == "reactive")
                                {
                                    userTransactionData1.MakerOrCheckerBack(feedbackid, solvedby, user.UserGroup);
                                }
                                else if (!string.IsNullOrEmpty(EjID) && EjID != "0")
                                {
                                    userTransactionData1.MakerOrCheckerBack(EjID, solvedby, user.UserGroup);
                                }
                            }
                        }

                        return(RedirectToAction("NewReportUserWise", new
                        {
                            startDate = searchobj.startDate,
                            endDate = searchobj.endDate,
                            ddlUserList = searchobj.ddlUserList,
                            terminaldId = searchobj.terminaldId,
                            status = searchobj.status,
                            reportType = searchobj.reportType,
                            searchobj
                        }));
                    }
                    else if (!string.IsNullOrEmpty(Submit) && (!user.UserGroup.Equals(Constants.UserGroups.Admin)))         //Save user input....................................
                    {
                        string solvedby = Convert.ToString(TempData["Sovedby"]);

                        if (!string.IsNullOrEmpty(solvedby))
                        {
                            if (solvedby.ToLower() == "reactive")
                            {
                                MvcHelper.SaveUserInput(long.Parse(feedbackid), solvedby, Comment, UserAction, CommentHold, user.UserGroup);
                            }
                            else
                            {
                                MvcHelper.SaveUserInput(long.Parse(EjID), solvedby, Comment, UserAction, CommentHold, user.UserGroup);
                            }
                        }
                        return(RedirectToAction("NewReportUserWise", new
                        {
                            startDate = searchobj.startDate,
                            endDate = searchobj.endDate,
                            ddlUserList = searchobj.ddlUserList,
                            terminaldId = searchobj.terminaldId,
                            status = searchobj.status,
                            reportType = searchobj.reportType,
                            searchobj
                        }));
                    }
                    else
                    {
                        UserTransactionData userTransactionData = new UserTransactionData();
                        transactionData = MvcHelper.GetTransactionData(ID, SolvedBy, user.AccountName, user.UserGroup);
                        transactionData.T24ImageUrls    = userTransactionData.GetT24ImageUrls(transactionData.EJID.ToString());
                        transactionData.WeCareImageUrls = userTransactionData.GetWCImageUrls(transactionData.FeedBackId);
                        ViewBag.obj = transactionData;
                        return(View());
                    }
                }
                catch (Exception ex)
                {
                    return(View());
                }
            }
            else
            {
                Session.Abandon();
                return(RedirectToAction("Error", "ErrorPage"));
            }
        }