예제 #1
0
 protected void gvwMaster_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         if (e.CommandName == "EditRow")
         {
             int id = Convert.ToInt32(e.CommandArgument);
             RowID = id;
             mvwForm.SetActiveView(viwAddEdit);
             PackageHeader package = packageProvider.Get(id);
             ddlDuesInMonth.SelectedValue = package.PackageDuesInMonth.ToString();
             txtName.Text        = package.Name;
             chkIsActive.Checked = package.IsActive;
             Detail             = packageProvider.GetDetail(id).ToList();
             chkOpenEnd.Checked = package.OpenEnd;
             txtFreezeFee.Text  = Convert.ToString(package.FreezeFee);
             RefreshDetail();
             txtName.Focus();
         }
         else if (e.CommandName == "DefineClass")
         {
             int id = Convert.ToInt32(e.CommandArgument);
             RowID = id;
             mvwForm.SetActiveView(viwAddEdit2);
             RefreshActiveClassInPackages();
         }
     }
     catch (Exception ex)
     {
         mvwForm.SetActiveView(viwRead);
         WebFormHelper.SetLabelTextWithCssClass(lblMessage, ex.Message, LabelStyleNames.ErrorMessage);
     }
 }