Пример #1
0
        public async Task <(Result, Tag)> UpdateAsync(Guid catId, UpdateTag request, Guid userId)
        {
            _logger.LogInformation($"Trying to update tag {request.Name}");

            var category = await _tags
                           .Find(x => x.Id == catId)
                           .FirstOrDefaultAsync();

            if (category is null)
            {
                return(Result.NotFound, null);
            }

            if (category.Deleted > 0)
            {
                return(Result.Gone, null);
            }

            if (category.CorrelationId == request.CorrelationId)
            {
                return(Result.Conflict, null);
            }

            var categoryUpdated = category.On(request, userId);

            await _tags.ReplaceOneAsync(x => x.Id == catId, category);

            await _eventService.PublishAsync(categoryUpdated);

            _logger.LogInformation($"Tag {request.Name} updated");

            return(Result.Successful, category);
        }
Пример #2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string sttt = "";

        sttt = DateTime.Now.ToLongTimeString();
        if (sttt.Length == 10)
        {
            sttt = "0" + sttt;
        }
        string post = sttt.Substring(9, 2);

        if (post == "PM")
        {
            int h = Convert.ToInt32(sttt.Substring(0, 2)) + 12;
            TTime.Text = h.ToString() + sttt.Substring(2, 6);
        }
        else
        {
            TTime.Text = sttt.Substring(0, 8);
        }
        deduct.Update();
        UpdateTag.Update();
        UpdateDate.Insert();
        PaymentInsert.Insert();
        DataView dv = (DataView)AfftectedSelect.Select(DataSourceSelectArguments.Empty);
        int      x  = 0;

        foreach (DataRow dr in dv.Table.Rows)
        {
            Session["rr"] = (int)dv.Table.Rows[x][0];
            Session["gg"] = "Event Date Already Reserved";
            ccancel.Insert();
        }
        printhead.Visible = true;
        Button1.Enabled   = false;
        TextBox3.ReadOnly = true;
        Button2.Enabled   = false;
    }
Пример #3
0
 public async Task <IActionResult> Put(Guid id, UpdateTag command)
 => await SendAsync(command.Bind(c => c.Id, id),
                    resourceId : command.Id, resource : "tags");