Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DrugsEntity selected = (DrugsEntity)drugsCB.SelectedItem;

            if (selected != null)
            {
                ApplicationLogic.FilterDrugs(ApplicationLogic.FilterDrugsCategory.DrugQuantity, selected.ID);
            }
        }
Exemplo n.º 2
0
        public Task <int> SubmitForm <TDto>(DrugsEntity entity, TDto dto) where TDto : class
        {
            var claimsIdentity = _httpContext.HttpContext.User.Identity as ClaimsIdentity;

            claimsIdentity.CheckArgumentIsNull(nameof(claimsIdentity));
            var claim = claimsIdentity?.FindFirst(t => t.Type == ClaimTypes.NameIdentifier);

            if (!string.IsNullOrEmpty(entity.F_Id))
            {
                entity.Modify(entity.F_Id);
                entity.F_LastModifyUserId = claim?.Value;
                return(_service.UpdateAsync(entity, dto));
            }
            else
            {
                entity.Create();
                entity.F_CreatorUserId = claim?.Value;
                return(_service.InsertAsync(entity));
            }
        }
Exemplo n.º 3
0
 public Task <int> UpdateForm(DrugsEntity entity)
 {
     return(_service.UpdatePartialAsync(entity));
 }