Exemplo n.º 1
0
        public void GetRouteDetailsbyID(int id)
        {
            Dispatch dispatch = new Dispatch();

            dispatch.OrderDate = (Convert.ToDateTime(txtOrderDate.Text)).ToString("dd-MM-yyyy");
            // dispatch.RouteID = Convert.ToInt32(dpagentRoute.SelectedItem.Value);

            DispatchData dispatchData = new DispatchData();
            DataSet      DS           = new DataSet();

            DS = dispatchData.getDetailsbyDDid(id);

            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                txtOrderID.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["OrderID"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["OrderID"].ToString();
                txtHidden.Text  = id.ToString();
                //txtOrderDate.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["OrderDate"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["OrderDate"].ToString();
                txtDispQuantity.Text  = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["DD_NewQuantity"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["DD_NewQuantity"].ToString();
                txtSampleReturn.Text  = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["DD_ReturnSample"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["DD_ReturnSample"].ToString();
                txtGoodQuality.Text   = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["DD_ReturnGoodQuality"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["DD_ReturnGoodQuality"].ToString();
                txtSpotDamaged.Text   = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["DD_ReturnSpotDamaged"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["DD_ReturnSpotDamaged"].ToString();
                txtCommodityName.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["ProductName"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["ProductName"].ToString();
                txtAgentName.Text     = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["AgentName"].ToString()) ? DS.Tables[0].Rows[0]["EmployeeName"].ToString() : DS.Tables[0].Rows[0]["AgentName"].ToString();
            }
        }