Ejemplo n.º 1
0
 /// <summary>
 /// Function to Update the items
 /// </summary>
 public void EditFunction()
 {
     try
     {
         RoleInfo infoRole = new RoleInfo();
         RoleSP   spRole   = new RoleSP();
         infoRole.RoleId    = Convert.ToDecimal(dgvRole.CurrentRow.Cells["dgvtxtRoleId"].Value);
         infoRole.Role      = txtRole.Text.Trim();
         infoRole.Narration = txtNarration.Text.Trim();
         infoRole.Extra1    = string.Empty;
         infoRole.Extra2    = string.Empty;
         string strRole = txtRole.Text.Trim();
         if (spRole.RoleCheckExistence(decRoleId, strRole) == false)
         {
             spRole.RoleEdit(infoRole);
             Messages.UpdatedMessage();
             ClearFunction();
         }
         else
         {
             Messages.InformationMessage("Role already exists");
             txtRole.Focus();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "RL:4" + ex.Message;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Save function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         RoleInfo infoRole = new RoleInfo();
         RoleSP   spRole   = new RoleSP();
         infoRole.Role      = txtRole.Text.Trim();
         infoRole.Narration = txtNarration.Text.Trim();
         infoRole.Extra1    = string.Empty;
         infoRole.Extra2    = string.Empty;
         string strRole = txtRole.Text.Trim();
         if (spRole.RoleCheckExistence(decRoleId, strRole) == false)
         {
             decRoleId = spRole.RoleAdd(infoRole);
             Messages.SavedMessage();
             ClearFunction();
         }
         else
         {
             Messages.InformationMessage("Role already exists");
             txtRole.Focus();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "RL:3" + ex.Message;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Save function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         RoleInfo infoRole = new RoleInfo();
         RoleSP   spRole   = new RoleSP();
         infoRole.Role      = txtRole.Text.Trim();
         infoRole.Narration = txtNarration.Text.Trim();
         infoRole.Extra1    = string.Empty;
         infoRole.Extra2    = string.Empty;
         string strRole = txtRole.Text.Trim();
         if (spRole.RoleCheckExistence(decRoleId, strRole) == false)
         {
             decRoleId = spRole.RoleAdd(infoRole);
             Messages.SavedMessage();
             ClearFunction();
         }
         else
         {
             Messages.InformationMessage("Role already exists");
             txtRole.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("RL:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Save function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         RoleInfo infoRole = new RoleInfo();
         RoleSP spRole = new RoleSP();
         infoRole.Role = txtRole.Text.Trim();
         infoRole.Narration = txtNarration.Text.Trim();
         infoRole.Extra1 = string.Empty;
         infoRole.Extra2 = string.Empty;
         string strRole = txtRole.Text.Trim();
         if (spRole.RoleCheckExistence(decRoleId, strRole) == false)
         {
             decRoleId = spRole.RoleAdd(infoRole);
             Messages.SavedMessage();
             ClearFunction();
         }
         else
         {
             Messages.InformationMessage("Role already exists");
             txtRole.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("RL:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Function to Update the items
 /// </summary>
 public void EditFunction()
 {
     try
     {
         RoleInfo infoRole = new RoleInfo();
         RoleSP spRole = new RoleSP();
         infoRole.RoleId = Convert.ToDecimal(dgvRole.CurrentRow.Cells["dgvtxtRoleId"].Value);
         infoRole.Role = txtRole.Text.Trim();
         infoRole.Narration = txtNarration.Text.Trim();
         infoRole.Extra1 = string.Empty;
         infoRole.Extra2 = string.Empty;
         string strRole = txtRole.Text.Trim();
         if (spRole.RoleCheckExistence(decRoleId, strRole) == false)
         {
             spRole.RoleEdit(infoRole);
             Messages.UpdatedMessage();
             ClearFunction();
         }
         else
         {
             Messages.InformationMessage("Role already exists");
             txtRole.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("RL:4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }