示例#1
0
 protected void gvShippingClasss_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         if (e.CommandName == "EditShippingClass")
         {
             hfCurrentID.Value = e.CommandArgument.ToString();
             ucEditShippingClass.Popup(e.CommandArgument.ToString());
         }
         else if (e.CommandName == "ToggleShippingClass")
         {
             hfCurrentID.Value = e.CommandArgument.ToString();
             SettingsDAL settingsDAL = new SettingsDAL();
             if (((LinkButton)e.CommandSource).Text == "Inactive")
             {
                 settingsDAL.ToggleShippingClass(int.Parse(e.CommandArgument.ToString()), true);
             }
             else
             {
                 settingsDAL.ToggleShippingClass(int.Parse(e.CommandArgument.ToString()), false);
             }
             BindShippingClasses();
         }
     }
     catch (Exception ex)
     {
         string strErrCode = ERROR_DISPLAY_MESSAGE + "," + (new Error_Log()).LogErrorIntoDB(ex, "gvShippingClasss_RowCommand");
         lblErr.Text = strErrCode;
     }
 }