Update() приватный Метод

private Update ( ) : void
Результат void
Пример #1
0
 public string JournalSaveChanges(string jsonString)
 {
     try
     {
         JsonSerializerSettings st = new JsonSerializerSettings();
         st.DateTimeZoneHandling = DateTimeZoneHandling.Local;
         JournalEntity  entity  = JsonConvert.DeserializeObject <JournalEntity>(jsonString, st);
         JournalManager service = new JournalManager();
         if (string.IsNullOrEmpty(entity.iGuid))
         {
             entity.iCreatedBy = SessionHelper.CurrentUser.UserName;
             entity.iUpdatedBy = SessionHelper.CurrentUser.UserName;
             service.Insert(entity);
         }
         else
         {
             entity.iUpdatedBy = SessionHelper.CurrentUser.UserName;
             service.Update(entity);
         }
         return("success");
     }
     catch (Exception e)
     {
         return(e.ToString());
     }
 }
 private void btnModify_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         if (txtJournalName.Text == "")
         {
             MessageBox.Show("You Must Enter Journal Name");
             return;
         }
         JournalNames jr = journal.Get(int.Parse(txtJournalCode.Text));
         jr.JournalName = txtJournalName.Text;
         journal.Update(jr);
         int ModifiedRowIndex = RowFocusedIndex;
         MessageBox.Show("Selected Journal Successfully Modified");
         FRM_Journal_Load(null, null);
         GetFocusedRowData(ModifiedRowIndex);
         JournalView.FocusedRowHandle = ModifiedRowIndex;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }