Пример #1
0
        protected void FetchGCInvoice(string OrderNo, string EmpID, DateTime sdate, DateTime edate)
        {
            GiftCardsDAL giftCardsDAL = new GiftCardsDAL {
                ConnectionString = ConfigurationManager.ConnectionStrings["MySQLTest"].ToString()
            };

            List <GiftCardInvoice> giftCardsList = giftCardsDAL.GetGiftCardsInvoice(OrderNo, EmpID, sdate, edate);

            GVGiftCardOrders.DataSource = giftCardsList;
            GVGiftCardOrders.DataBind();
        }
Пример #2
0
        protected void GVGiftCardOrders_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            GiftCardsDAL giftCardsDAL = new GiftCardsDAL {
                ConnectionString = ConfigurationManager.ConnectionStrings["MySQLTest"].ToString()
            };

            string OrderNo = GVGiftCardOrders.DataKeys[e.RowIndex].Values["OrderNo"].ToString();

            giftCardsDAL.DeleteGiftCardsInvoice(OrderNo);

            FetchGCInvoice(searchOrder, searchEmp, sdate, edate);
        }
Пример #3
0
        protected void GVGiftCardOrders_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GiftCardsDAL giftCardsDAL = new GiftCardsDAL {
                ConnectionString = ConfigurationManager.ConnectionStrings["MySQLTest"].ToString()
            };

            GiftCardInvoice invoice = new GiftCardInvoice {
                OrderID        = (GVGiftCardOrders.Rows[e.RowIndex].FindControl("LblGCinvoiceOrderNo") as Label).Text,
                EmployeeID     = (GVGiftCardOrders.Rows[e.RowIndex].FindControl("LblGCinvoiceEmployeeID") as Label).Text,
                LineNumber     = (GVGiftCardOrders.Rows[e.RowIndex].FindControl("LblGCinvoiceLineNumber") as Label).Text,
                RewardName     = (GVGiftCardOrders.Rows[e.RowIndex].FindControl("LblGCinvoiceRewardName") as Label).Text,
                OrderDate      = Convert.ToDateTime((GVGiftCardOrders.Rows[e.RowIndex].FindControl("LblGCinvoiceOrderDate") as Label).Text),
                LocalCost      = (GVGiftCardOrders.Rows[e.RowIndex].FindControl("LblGCinvoiceLocalCost") as Label).Text,
                Quantity       = Convert.ToInt32((GVGiftCardOrders.Rows[e.RowIndex].FindControl("LblGCinvoiceQuantity") as Label).Text),
                ReasonofReturn = (GVGiftCardOrders.Rows[e.RowIndex].FindControl("DDLGCInvoiceReason") as DropDownList).Text
            };

            giftCardsDAL.InsertGiftCardsInvoice(invoice);
            GVGiftCardOrders.EditIndex = -1;
            FetchGCInvoice(searchOrder, searchEmp, sdate, edate);
        }