Ejemplo n.º 1
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Dispatch dispatch = new Dispatch();

            dispatch.flag       = "Edit";
            dispatch.DispatchId = Convert.ToInt32(txtDispatchId.Text);
            DispatchData dispatchData = new DispatchData();
            DataSet      DS           = new DataSet();

            DS = dispatchData.GetDispatchByAgentID(dispatch);

            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                rpRouteList.DataSource = DS;
                rpRouteList.DataBind();
                rpRouteList.Visible = true;

                uprouteList.Update();
            }
            else
            {
                DataTable dt = new DataTable();
                this.BindRepeater(dt);
                rpRouteList.Visible = true;
                uprouteList.Update();
            }
        }
Ejemplo n.º 2
0
        //[WebMethod]
        //public static string[] GetCustomers(string prefix)
        //{
        //    List<string> customers = new List<string>();
        //    using (SqlConnection conn = new SqlConnection())
        //    {
        //        conn.ConnectionString = ConfigurationManager.ConnectionStrings["projectConnection"].ConnectionString;
        //        using (SqlCommand cmd = new SqlCommand())
        //        {
        //            cmd.CommandText = "select AgentName, AgentID from AgentMaster where AgentName like @SearchText + '%'";
        //            cmd.Parameters.AddWithValue("@SearchText", prefix);
        //            cmd.Connection = conn;
        //            conn.Open();
        //            using (SqlDataReader sdr = cmd.ExecuteReader())
        //            {
        //                while (sdr.Read())
        //                {
        //                    customers.Add(string.Format("{0}-{1}", sdr["AgentName"], sdr["AgentID"]));
        //                }
        //            }
        //            conn.Close();
        //        }
        //    }
        //    return customers.ToArray();
        //}

        protected void btnClick_btnSearch(object sender, EventArgs e)
        {
            Dispatch dispatch = new Dispatch();

            //dispatch.DispatchDate = (Convert.ToDateTime(txtOrderDate.Text)).ToString("dd-MM-yyyy");
            //String.Format("{0:dd/MM/yyyy}", dispatch.OrderDate);
            //  dispatch.CategoryId = Convert.ToInt32(dpCategory.SelectedItem.Value);
            // dispatch.OrderDate = a.ToString();
            //dispatch.OrderDate = txtOrderDate.Text;
            // dispatch.AgentID = Convert.ToInt32(dpAgent.SelectedItem.Value);
            // dispatch.RouteID = Convert.ToInt32(dpagentRoute.SelectedItem.Value);
            dispatch.DispatchId = Convert.ToInt32(txtDispatchId.Text);
            DispatchData  dispatchData = new DispatchData();
            DataSet       DS           = new DataSet();
            StringBuilder sb           = new StringBuilder();

            dispatch.flag = "none";


            DS = dispatchData.GetDispatchByAgentID(dispatch);

            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                // int count = Convert.ToInt32(DS.Tables[1].Rows[0]["Id"]);
                //count = count + 1;
                //txtRouteCode.Text = string.Format("R{0:0000}", count);
                rpRouteList.DataSource = DS;
                rpRouteList.DataBind();
                rpRouteList.Visible = true;

                //btnSubmitModal.Visible = true;
                //btnPrintSummary.Visible = false;

                uprouteList.Update();

                // DS.WriteXml(Server.MapPath("~/Tabs/Dispatch/temp.xml"));

                //string str = DS.GetXml();
                //insertDispatchTemp(DS);
            }
            else
            {
                DataTable dt = new DataTable();
                this.BindRepeater(dt);
                rpRouteList.Visible = true;
                uprouteList.Update();
            }
        }
Ejemplo n.º 3
0
        private void updatelist()
        {
            DataSet  DS       = new DataSet();
            Dispatch dispatch = new Dispatch();

            dispatch.DispatchId = Convert.ToInt32(txtDispatchId.Text);
            DispatchData dispatchData = new DispatchData();

            dispatch.flag = "Edit";
            DS            = dispatchData.GetDispatchByAgentID(dispatch);

            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                rpRouteList.DataSource = DS;
                rpRouteList.DataBind();
                rpRouteList.Visible = true;


                uprouteList.Update();
            }
        }
Ejemplo n.º 4
0
        private void updatelist()
        {
            DataSet  DS       = new DataSet();
            Dispatch dispatch = new Dispatch();

            dispatch.DispatchDate = (Convert.ToDateTime(txtOrderDate.Text)).ToString("dd-MM-yyyy");
            dispatch.RouteID      = Convert.ToInt32(dpagentRoute.SelectedItem.Value);
            dispatch.CategoryId   = Convert.ToInt32(dpCategory.SelectedItem.Value);
            DispatchData dispatchData = new DispatchData();

            DS = dispatchData.GetDispatchByAgentID(dispatch);

            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                rpRouteList.DataSource = DS;
                rpRouteList.DataBind();
                rpRouteList.Visible = true;


                uprouteList.Update();
            }
        }