Beispiel #1
0
        protected void grid_RowDeleted(Object sender, RowDeletedEventArgs e)
        {
            try
            {
                var id = e.DataCellsList.GetCell(0).GetPropertyValue("Value");

                using (var cmd = new SqlCommand())
                    using (var conn = new SqlConnection(ConfigurationManager.ConnectionStrings["projectDBConnectionString"].ToString()))
                    {
                        conn.Open();
                        cmd.Connection  = conn;
                        cmd.CommandType = CommandType.Text;
                        cmd.CommandText = "delete from fly_Subscribers_With_Email where id=" + id;
                        cmd.ExecuteNonQuery();
                        message.MessageText  = "Specified email deleted successfully!";
                        message.MessageClass = MessageClassesEnum.Ok;
                    }
            }
            catch (Exception ex)
            {
                message.MessageText  = ex.Message;
                message.MessageClass = MessageClassesEnum.Error;
            }

            message.RedirectToShowMessage();
        }
Beispiel #2
0
        protected void grid_RowDeleted(Object sender, RowDeletedEventArgs e)
        {
            try
            {
                var   id = e.DataCellsList.GetCell(0).GetPropertyValue("Value");
                Int32 @int32;

                if (!Int32.TryParse(id, out @int32))
                {
                    message.MessageText  = "Discount Code ID should be a number.";
                    message.MessageClass = MessageClassesEnum.System;
                }

                if (message.MessageText.HasNoText())
                {
                    var sds = grid.GridDataSource.GetDataSource() as SqlDataSource;

                    sds.DeleteParameters["DiscountCodeID"].DefaultValue = id;
                    sds.Delete();

                    message.MessageText  = "Promo code has been deleted successfully.";
                    message.MessageClass = MessageClassesEnum.Ok;
                }
            }
            catch (Exception ex)
            {
                message.MessageText  = ex.Message;
                message.MessageClass = MessageClassesEnum.Error;
            }

            message.RedirectToShowMessage();
        }
Beispiel #3
0
        protected void grid_RowDeleted(Object sender, RowDeletedEventArgs e)
        {
            try
            {
                var   id = e.DataCellsList.GetCell(0).GetPropertyValue("Value");
                Int32 @int32;

                if (!Int32.TryParse(id, out @int32))
                {
                    message.MessageText  = "pkOfferDiscountID should be a number.";
                    message.MessageClass = MessageClassesEnum.System;
                }

                if (message.MessageText.HasNoText())
                {
                    var objData = new clsData();

                    objData.strSql = "delete from fly_tblOfferDiscount where pkOfferDiscountID=" + id;
                    objData.ExecuteSql();

                    message.MessageText  = "Specified discount has been deleted successfully!";
                    message.MessageClass = MessageClassesEnum.Ok;
                }
            }
            catch (Exception ex)
            {
                message.MessageText  = ex.Message;
                message.MessageClass = MessageClassesEnum.Error;
            }

            message.RedirectToShowMessage();
        }
Beispiel #4
0
        public void OnRowDeleted(RowDeletedEventArgs args)
        {
            EventHandler <RowDeletedEventArgs> handler = RowDeleted;

            if (handler != null)
            {
                handler(this, args);
            }
        }
        private void grvOrder_RowDeleted(object sender, RowDeletedEventArgs e)
        {
            var item = e.Row as Logic.Entities.Order;

            if (_cartServiceClient.DeleteOrder(item.Id))
            {
                MessageBox.Show("Order deleted sucessfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void grvDetails_RowDeleted(object sender, RowDeletedEventArgs e)
        {
            var item = e.Row as Logic.Entities.OrderDetailModel;

            if (_cartServiceClient.DeleteOrderDetails(item.Id))
            {
                MessageBox.Show("Order Detail deleted sucessfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            var detailsView  = sender as GridView;
            var i            = detailsView.SourceRowHandle;
            var order        = grvOrder.GetRow(i) as Order;
            var updatedOrder = _cartServiceClient.GetOrder(order.Id);

            order.Total = updatedOrder.Total;
            grvOrder.RefreshRow(i);
        }
 public static void DeleteEmployeeInformation(RowDeletedEventArgs e)
 {
     try
     {
         var employeeRecord = (Employee)e.Row;
         if (!string.IsNullOrEmpty(employeeRecord.FirstName) && !string.IsNullOrEmpty(employeeRecord.LastName))
         {
             var message  = CreateMessage(employeeRecord, HttpMethod.Delete);
             var response = Client.SendAsync(message).Result;
             if (!response.IsSuccessStatusCode)
             {
                 Console.WriteLine("Something went wrong with processing data!");
             }
         }
         GetEmployeeInformation();
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
         throw;
     }
 }
Beispiel #8
0
        protected void lbAction_Command(Object sender, CommandEventArgs e)
        {
            var linkButton    = (sender as LinkButton);
            var bodyRowIndex  = Int32.Parse(linkButton.CommandArgument);
            var actionType    = GridExtensions.Parse(linkButton.CommandName);
            var dataCellsList = CellsList.Body.GetDataCellsList(bodyRowIndex) as DataCellsList;

            if (actionType == ActionTypes.Edit)
            {
                HandleEditCommand(linkButton, bodyRowIndex);
            }
            else if (actionType == ActionTypes.Delete)
            {
                var args = new RowDeletedEventArgs(bodyRowIndex, dataCellsList);

                CellsList.Body.GridControl.OnRowDeleted(args);
            }
            else if (actionType == ActionTypes.Custom)
            {
                var args = new ActionCellCustomCommandEventArgs(bodyRowIndex, this);

                CellsList.Body.GridControl.OnActionCellCustomCommand(args);
            }
        }
 private void GridView_RowDeleted(object sender, RowDeletedEventArgs e)
 {
     this.Context.DeleteObject(e.Row);
 }
        private void Gv_BookInfos_RowDeleted(object sender, RowDeletedEventArgs e)
        {
            var data = (List <Borrow>)Gv_BookInfos.DataSource;

            Sb_Save.Enabled = data.Count > 1;
        }
Beispiel #11
0
 private void Artista_gridView_RowDeleted(object sender, RowDeletedEventArgs e)
 {
     _GlobalDataContext.SubmitChanges();
 }