コード例 #1
0
 protected void imgbtnfrDelete_Click(object sender, ImageClickEventArgs e)
 {
     cmdMode        = CommandMode.D;
     objCountry     = new Store.Country.BusinessObject.Country();
     oblCountry     = new Store.Country.BusinessLogic.Country();
     objMessageInfo = new MessageInfo();
     try
     {
         ImageButton btndetails = sender as ImageButton;
         GridViewRow gvrow      = (GridViewRow)btndetails.NamingContainer;
         objCountry.CountryID   = Convert.ToInt32(dgvCountry.DataKeys[gvrow.RowIndex].Value.ToString());
         objCountry.CountryName = "";
         //objCountry.CreatedBy = Convert.ToInt32(Session["UserId"].ToString());
         objMessageInfo = oblCountry.ManageItemMaster(objCountry, cmdMode);
         BindCountry();
         updateCountryBdInfo.Update();
         ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alert", "alert('" + objMessageInfo.TranMessage + "')", true);
     }
     catch (Exception ex)
     {
         Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(Country).FullName, 1);
     }
     finally
     {
         objCountry     = null;
         oblCountry     = null;
         objMessageInfo = null;
     }
 }
コード例 #2
0
 void ManageCountry()
 {
     objCountry = new Store.Country.BusinessObject.Country();
     oblCountry = new Store.Country.BusinessLogic.Country();
     try
     {
         if (cmdMode == Store.Common.CommandMode.M)
         {
             objCountry.CountryID = Convert.ToInt32(txtCountryId.Text);
             //objCountry.ModifiedBy = Convert.ToInt32(Session["UserId"].ToString());
         }
         else
         {
             objCountry.CountryID = 0;
             //objCountry.CreatedBy = Convert.ToInt32(Session["UserId"].ToString());
         }
         objCountry.CountryName = Convert.ToString(txtCountry.Text);
         objMessageInfo         = oblCountry.ManageItemMaster(objCountry, cmdMode);
     }
     catch (Exception ex)
     {
         Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(Country).FullName, 1);
     }
     finally
     {
         objCountry = null;
         oblCountry = null;
     }
 }