Exemple #1
0
 public void BindContinents()
 {
     try
     {
         int          ContinentId     = 0;
         BAContinents objBAContinents = new BAContinents();
         DataSet      ds = objBAContinents.GetContinents(ContinentId);
         if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
             ddlContinent.DataSource     = ds.Tables[0];
             ddlContinent.DataTextField  = "ContinentDesc";
             ddlContinent.DataValueField = "ContinentId";
             ddlContinent.DataBind();
         }
         else
         {
             ddlContinent.DataSource = null;
             ddlContinent.DataBind();
         }
     }
     catch (Exception ex)
     {
         lblMsg.Text = _objBOUtiltiy.ShowMessage("danger", "Danger", ex.Message);
         ExceptionLogging.SendExcepToDB(ex);
     }
 }
Exemple #2
0
 private void GetContinents(int ContinentId)
 {
     try
     {
         objContinents.ContinentId = ContinentId;
         DataSet ds = objBAContinents.GetContinents(ContinentId);
         if (ds.Tables[0].Rows.Count > 0)
         {
             hf_ContinentId.Value = ds.Tables[0].Rows[0]["ContinentId"].ToString();
             txtKey.Text          = ds.Tables[0].Rows[0]["ContinentKey"].ToString();
             txtKey.Enabled       = false;
             txtDescription.Text  = ds.Tables[0].Rows[0]["ContinentDesc"].ToString();
         }
     }
     catch (Exception ex)
     {
         lblMsg.Text = _objBOUtiltiy.ShowMessage("danger", "danger", ex.Message);
         ExceptionLogging.SendExcepToDB(ex);
     }
 }
 private void BindContinentDetails()
 {
     try
     {
         gvContinentsList.PageSize = int.Parse(ViewState["ps"].ToString());
         int     ContinentId = 0;
         DataSet ds          = objBAContinents.GetContinents(ContinentId);
         Session["dt"] = ds.Tables[0];
         if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
             gvContinentsList.DataSource = ds.Tables[0];
             string sortDirection = "ASC", sortExpression;
             if (ViewState["so"] != null)
             {
                 sortDirection = ViewState["so"].ToString();
             }
             if (ViewState["se"] != null)
             {
                 sortExpression = ViewState["se"].ToString();
                 ds.Tables[0].DefaultView.Sort = sortExpression + " " + sortDirection;
             }
             gvContinentsList.DataBind();
         }
         else
         {
             gvContinentsList.DataSource = null;
             gvContinentsList.DataBind();
             Label lblEmptyMessage = gvContinentsList.Controls[0].Controls[0].FindControl("lblEmptyMessage") as Label;
             lblEmptyMessage.Text = "Currently there are no records in System";
         }
     }
     catch (Exception ex)
     {
         lblMsg.Text = _objBOUtiltiy.ShowMessage("danger", "Danger", ex.Message);
         ExceptionLogging.SendExcepToDB(ex);
     }
 }