/// <summary> /// selects user record for updation and show user form /// </summary> private void BindUpdateBuildingData() { int selectedrowindex = Model_dgv.SelectedCells[0].RowIndex; ModelVo cavInVo = (ModelVo)Model_dgv.Rows[selectedrowindex].DataBoundItem; AddModelForm newAddForm = new AddModelForm(CommonConstants.MODE_UPDATE, cavInVo); newAddForm.ShowDialog(this); if (newAddForm.IntSuccess > 0) { messageData = new MessageData("mmci00002", Properties.Resources.mmci00002, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); GridBind(FormConditionVo()); } else if (newAddForm.IntSuccess == 0) { messageData = new MessageData("mmci00007", Properties.Resources.mmci00004, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); GridBind(FormConditionVo()); } }
/// <summary> /// add new record to DB /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Add_btn_Click(object sender, EventArgs e) { AddModelForm newAddForm = new AddModelForm(CommonConstants.MODE_ADD, null); newAddForm.ShowDialog(); if (newAddForm.IntSuccess > 0) { messageData = new MessageData("mmci00001", Properties.Resources.mmci00001, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); GridBind(FormConditionVo()); } }