コード例 #1
0
ファイル: View.aspx.cs プロジェクト: maheshbailwal2/Projects
        private void LoadTicketConversation()
        {
            Guid ticketId = new Guid(Request["ticketId"]);
            //  Ticket tic = new Ticket();
            var dt = GetTicketData(ticketId);

            TicketNumber = FormatTicketNumber(dt.Rows[0]["TicketNumber"].ToString());
            Subject      = dt.Rows[0]["Subject"].ToString();

            ddlStatus.SelectedValue   = dt.Rows[0]["Status"].ToString();
            ddlPriority.SelectedValue = dt.Rows[0]["Priority"].ToString();
            CreatedOn  = ((DateTime)dt.Rows[0]["InsertDate"]).ToString("dd MMMM yyyy HH:mm:ss tt");
            UpdatedOn  = ((DateTime)dt.Rows[0]["LastUpdate"]).ToString("dd MMMM yyyy HH:mm:ss tt");
            TicketType = GetTicketType(dt.Rows[0]["Type"].ToString());
            Department = GetDepartment(dt.Rows[0]["Department"]);

            Customer cus = new Customer();
            //if(cus.GetCustomerDetailByUserName(dt.Rows[0]["UserEmail"].ToString()))
            //{
            //userName = cus.CusInfo.Name;
            //}
            //else{
            //userName = dt.Rows[0]["UserName"].ToString();
            //if (userName.Trim().Length  < 1)
            //{
            //    userName = dt.Rows[0]["UserEmail"].ToString();
            //}
            //}

            TicketConversation ticConv = new TicketConversation();
            var dt1 = ticConv.GetConversion(dt.Rows[0]["UserEmail"].ToString(), ticketId);

            Repeater1.DataSource = dt1;
            Repeater1.DataBind();
        }
コード例 #2
0
        public ActionResult ViewTicket(Guid ticketId)
        {
            var ticket = ticketService.GetTicket(ticketId);
            var vtVM   = Mapper.Map <Entities.Ticket, ViewModels.ViewTicketViewModel>(ticket);

            foreach (var conv in ticket.TicketConversations)
            {
                ViewModels.TicketConversation tconv = new TicketConversation();
                tconv.Message = conv.Message;

                tconv.CreateDate     = conv.CreateDate.Value;
                tconv.LastUpdateDate = conv.LastUpdateDate.Value;

                if (!string.IsNullOrEmpty(conv.Attachment))
                {
                    tconv.AttachmentFileName = ticketService.GetUploadedFileName(conv.Attachment);
                    tconv.AttachmentFileRaw  = "/" + GetUploadFolderName() + "/" + Path.GetFileName(conv.Attachment);
                }

                tconv.User  = conv.LastUpdatedUser.UserName;
                tconv.Staff = conv.Staff ? "STAFF" : "USER";
                vtVM.Conversation.Add(tconv);
            }

            // return  View(vtVM);
            return(PartialView(vtVM));
        }
コード例 #3
0
        private void LoadTicket()
        {
            //TO DO: Validate User aganist ticket number to disaalow user to view other people ticket
            // TO DO: SP for insert ticket

            Guid   ticketId = new Guid(Request["ticketId"]);
            Ticket tic      = new Ticket();
            var    dt       = tic.GetUserTicket(ticketId);

            TicketNumber = FormatTicketNumber(dt.Rows[0]["TicketNumber"].ToString());
            Subject      = dt.Rows[0]["Subject"].ToString();
            UserEmail    = dt.Rows[0]["UserEmail"].ToString();

            //ddlStatus.SelectedValue = dt.Rows[0]["Status"].ToString();
            //ddlPriority.SelectedValue = dt.Rows[0]["Priority"].ToString();
            //CreatedOn = ((DateTime)dt.Rows[0]["InsertDate"]).ToString("dd MMMM yyyy HH:mm:ss tt");
            //UpdatedOn = ((DateTime)dt.Rows[0]["LastUpdate"]).ToString("dd MMMM yyyy HH:mm:ss tt");
            //TicketType = GetTicketType(dt.Rows[0]["Type"].ToString());


            TicketConversation ticConv = new TicketConversation();
            var dt1 = ticConv.GetConversion(ticketId);

            Message = dt1.Rows[0]["Message"].ToString();

            SendEmail();
        }
コード例 #4
0
ファイル: View.aspx.cs プロジェクト: maheshbailwal2/Projects
        private void SubmitTicket()
        {
            TicketConversation tic = new TicketConversation();
            Guid ticketId          = new Guid(Request["ticketId"]);
            Guid userId            = Helper.GetEmptyGuid();

            tic.InsertConversation(ticketId, txtMessage.Text, GetAttachmentPath(FileUpload1), userId, Session["admin"] == null ? false : true, this.GetUserEmailId());

            if (Session["admin"] != null)
            {
                ddlStatus.SelectedValue = "OH";
                var dt = GetTicketData(new Guid(Request["ticketId"]));
                Email.SendMail(dt.Rows[0]["UserEmail"].ToString(), dt.Rows[0]["Subject"].ToString(),
                               txtMessage.Text, "", "*****@*****.**", "Infowebservices Support");
                //TO DO: Send Email
            }


            UpdateTicket();
            LoadTicketConversation();
        }