Пример #1
0
 protected void gvPackagings_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         if (e.CommandName == "EditPackaging")
         {
             hfCurrentID.Value = e.CommandArgument.ToString();
             ucEditPackaging.Popup(e.CommandArgument.ToString());
         }
         else if (e.CommandName == "TogglePackaging")
         {
             hfCurrentID.Value = e.CommandArgument.ToString();
             SettingsDAL settingsDAL = new SettingsDAL();
             if (((LinkButton)e.CommandSource).Text == "Inactive")
             {
                 settingsDAL.TogglePackaging(int.Parse(e.CommandArgument.ToString()), true);
             }
             else
             {
                 settingsDAL.TogglePackaging(int.Parse(e.CommandArgument.ToString()), false);
             }
             BindPackagings();
         }
     }
     catch (Exception ex)
     {
         string strErrCode = ERROR_DISPLAY_MESSAGE + "," + (new Error_Log()).LogErrorIntoDB(ex, "gvPackagings_RowCommand");
         lblErr.Text = strErrCode;
     }
 }