Esempio n. 1
0
        private void BindRates()
        {
            int collectionPoint = 0;

            if (cboCollectionPoint.SelectedValue != "")
            {
                collectionPoint = Convert.ToInt32(cboCollectionPoint.SelectedValue);
            }
            int deliveryPoint = 0;

            if (cboDeliveryPoint.SelectedValue != "")
            {
                deliveryPoint = Convert.ToInt32(cboDeliveryPoint.SelectedValue);
            }
            int client = 0;

            if (cboJobClient.SelectedValue != "")
            {
                client = Convert.ToInt32(cboJobClient.SelectedValue);
            }

            using (Facade.IJobRate facJobRate = new Facade.Job())
            {
                DataView dv             = new DataView(facJobRate.GetRates(collectionPoint, deliveryPoint, client, chkShowEnded.Checked).Tables[0]);
                string   sortExpression = String.Empty;
                sortExpression     = SortCriteria + " " + SortDirection;
                dv.Sort            = sortExpression.Trim();
                dgRates.DataSource = dv;
            }
            dgRates.DataBind();
        }