Beispiel #1
0
        private void LoadData(string ServTaxId)
        {
            ClearText();

            BLL.DBInteraction dbinteract = new BLL.DBInteraction();



            int intServTaxId = 0;

            if (ServTaxId == "" || !Int32.TryParse(ServTaxId, out intServTaxId))
            {
                return;
            }

            System.Data.DataSet ds = dbinteract.GetSTax(Convert.ToInt32(ServTaxId), null);

            if (!ReferenceEquals(ds, null) && ds.Tables[0].Rows.Count > 0)
            {
                txtTax.Text             = ds.Tables[0].Rows[0]["TaxPer"].ToString();
                txtAddiCess.Text        = Convert.ToString(ds.Tables[0].Rows[0]["TaxAddCess"]);
                txtCess.Text            = Convert.ToString(ds.Tables[0].Rows[0]["TaxCess"]);
                ddlStatus.SelectedIndex = Convert.ToString(ds.Tables[0].Rows[0]["Status"]) == "Active" ? 0 : 1;
                txtStDate.Text          = Convert.ToString(ds.Tables[0].Rows[0]["StartDate"]).Split(' ')[0];
            }
        }
Beispiel #2
0
        private void LoadData(string SortExp, string direction)
        {
            lblErrorMsg.Text = "";
            if (!ReferenceEquals(Session[Constants.SESSION_SEARCH_CRITERIA], null))
            {
                SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA];

                if (!ReferenceEquals(searchCriteria, null))
                {
                    BuildSearchCriteria(searchCriteria);


                    gvwLoc.PageIndex = searchCriteria.PageIndex;
                    if (searchCriteria.PageSize > 0)
                    {
                        gvwLoc.PageSize = searchCriteria.PageSize;
                    }

                    BLL.DBInteraction dbinteract = new BLL.DBInteraction();

                    try
                    {
                        System.Data.DataSet  ds = dbinteract.GetSTax(-1, Convert.ToDateTime(ddlTaxDate.SelectedValue));
                        System.Data.DataView dv = new System.Data.DataView(ds.Tables[0]);
                        if (!string.IsNullOrEmpty(SortExp) && !string.IsNullOrEmpty(direction))
                        {
                            dv.Sort = SortExp + " " + direction;
                        }
                        gvwLoc.DataSource = dv;
                    }
                    catch (Exception ex)
                    {
                        gvwLoc.DataSource = null;
                        lblErrorMsg.Text  = "Error Occured.Please try again.";
                    }

                    gvwLoc.DataBind();
                }
            }
        }