コード例 #1
0
        public HttpResponseMessage DeleteCustomerNote(int id)
        {
            SuccessResponse response = new SuccessResponse();

            CustomerNotesService.DeleteCustomerNote(id);
            return(Request.CreateResponse(response));
        }
コード例 #2
0
        public HttpResponseMessage GetCustomerNote(int id)
        {
            ItemResponse <CustomerNotes> response = new ItemResponse <CustomerNotes>();

            response.Item = CustomerNotesService.GetCustomerNote(id);
            return(Request.CreateResponse(response));
        }
コード例 #3
0
        public HttpResponseMessage GetListOfCustomerNotes()
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            ItemsResponse <CustomerNotes> response = new ItemsResponse <CustomerNotes>();

            response.Items = CustomerNotesService.GetListOfCustomerNotes();
            return(Request.CreateResponse(response));
        }
コード例 #4
0
        public HttpResponseMessage UpdateCustomerNote(UpdateCustomerNoteRequest model)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            SuccessResponse response = new SuccessResponse();

            CustomerNotesService.UpdateCustomerNote(model);
            return(Request.CreateResponse(response));
        }
コード例 #5
0
        public HttpResponseMessage AddCustomerNote(AddCustomerNoteRequest model)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            ItemResponse <int> response = new ItemResponse <int>();

            response.Item = CustomerNotesService.UpdateCustomerNote(model);
            return(Request.CreateResponse(response));
        }
コード例 #6
0
        protected void gvwMaster_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string custBarcode = e.Row.Cells[1].Text;

                var notes = CustomerNotesService.GetTopNotes(custBarcode);
                var txt   = new StringBuilder();
                txt.AppendLine("Notes for " + custBarcode + ": ").AppendLine();
                foreach (var note in notes)
                {
                    txt.AppendLine("* " + note.ChangedWhen.ToLongDateString() + " *").AppendLine(note.Notes).AppendLine();
                }
                e.Row.ToolTip = txt.ToString();

                var hypNotes = e.Row.FindControl("hypNotes") as HyperLink;
                if (hypNotes != null)
                {
                    hypNotes.Attributes.Add("onclick", String.Format("showPromptPopUp('InputCustomerNotes.aspx?barcode={0}&candelete=1', null, 600, 900)", custBarcode));
                }


                var hypCheckInHistory = e.Row.FindControl("hypCheckInHistory") as HyperLink;
                if (hypCheckInHistory != null)
                {
                    hypCheckInHistory.Attributes.Add("onclick", String.Format("showPromptPopUp('CheckInHistory.aspx?barcode={0}', null, 600, 900)", custBarcode));
                }

                var hypInvoiceHistory = e.Row.FindControl("hypInvoiceHistory") as HyperLink;
                if (hypInvoiceHistory != null)
                {
                    hypInvoiceHistory.Attributes.Add("onclick", String.Format("showPromptPopUp('InvoiceHistory.aspx?barcode={0}', null, 600, 1200)", custBarcode));
                }

                var hypChangeCC = e.Row.FindControl("hypChangeCC") as HyperLink;
                if (hypChangeCC != null)
                {
                    hypChangeCC.Enabled = CustomerService.IsBillingTypeAutoPayment(custBarcode);
                    if (!hypChangeCC.Enabled)
                    {
                        hypChangeCC.Attributes.Add("onclick", String.Format("alert('Billing type for this customer is manual payment');"));
                        hypChangeCC.ToolTip = "Billing type for this customer is manual payment";
                    }
                    else
                    {
                        hypChangeCC.Attributes.Add("onclick", String.Format("showPromptPopUp('ChangeCreditCard.aspx?barcode={0}', null, 600, 1200)", custBarcode));
                    }
                }
            }
        }