コード例 #1
0
 private void AssignRecord(Boolean IsSave)
 {
     try
     {
         if (IsSave)
         {
             usrgrp.UserGroupCode = mtxtGroupCode.Text;
             usrgrp.UserGroupDesc = mtxtGroupDesc.Text;
             usrgrp.Remarks = mtxtRemarks.Text;
             usrgrp.IsActive = mcbActive.Checked;   
          
         }
         else
         {
             usrgrp = usrgrpbal.GetByID(groupid);
             RefreshList();
             if (usrgrp != null)
             {
                 mtxtGroupCode.Text = usrgrp.UserGroupCode;
                 mtxtGroupDesc.Text = usrgrp.UserGroupDesc;
                 mtxtRemarks.Text = usrgrp.Remarks;
                 mcbActive.Checked = usrgrp.IsActive;    
             }
             else
             {
                 throw new Exception("Record doesn't exist!");
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }