예제 #1
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Dispatch dispatch = new Dispatch();

            int id = 0;

            id = Convert.ToInt32(txtDispatchId.Text);

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

            DS = dispatchData.GetDispatchByID(id, "Edit");

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


                uprouteList.Update();
            }
            else
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "1", "alert('No record found');", true);
            }
        }
예제 #2
0
        protected void btnClick_btnSearch(object sender, EventArgs e)
        {
            Dispatch dispatch = new Dispatch();

            int id = 0;

            id = Convert.ToInt32(txtDispatchId.Text);

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



            DS = dispatchData.GetDispatchByID(id);

            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();

                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = false;

                pnlError.Update();
            }
            else
            {
                DataTable dt = new DataTable();
                this.BindRepeater(dt);
                rpRouteList.Visible = true;
                uprouteList.Update();
            }
        }
예제 #3
0
        protected void btnClick_btnSearch(object sender, EventArgs e)
        {
            Dispatch dispatch = new Dispatch();

            int id = 0;

            id = Convert.ToInt32(txtDispatchId.Text);

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



            DS = dispatchData.GetDispatchByID(id);

            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();
            }
        }
예제 #4
0
        public void GetRouteDetailsbyID(int id)
        {
            Dispatch dispatch = new Dispatch();


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



            DS = dispatchData.GetDispatchByID(id);

            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                txtTraysReturn.Text   = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["TraysReturned"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["TraysReturned"].ToString();
                txtIceBoxReturn.Text  = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["IceBoxReturned"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["IceBoxReturned"].ToString();
                txtCartonsReturn.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["CartonsReturned"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["CartonsReturned"].ToString();
                txtOtherReturn.Text   = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["OtherReturned"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["OtherReturned"].ToString();
                txtHidden.Text        = id.ToString();
            }
        }
예제 #5
0
        protected void btnClick_btnUpdate(object sender, EventArgs e)
        {
            Dispatch     disp         = new Dispatch();
            DispatchData dispatchData = new DispatchData();


            disp.DispatchId = string.IsNullOrEmpty(txtHidden.Text) ? 0: Convert.ToInt32(txtHidden.Text);
            disp.Trays      = string.IsNullOrEmpty(txtTraysReturn.Text) ? 0 : Convert.ToInt32(txtTraysReturn.Text);
            disp.Cartons    = string.IsNullOrEmpty(txtCartonsReturn.Text) ? 0 : Convert.ToInt32(txtCartonsReturn.Text);
            disp.IceBox     = string.IsNullOrEmpty(txtIceBoxReturn.Text) ? 0 : Convert.ToInt32(txtIceBoxReturn.Text);
            disp.OtherDisp  = string.IsNullOrEmpty(txtOtherReturn.Text) ? 0 : Convert.ToInt32(txtOtherReturn.Text);

            //disp.Quantity = Convert.ToInt32(txtQuantity.Text);

            DS = dispatchData.GetDispatchByID(disp.DispatchId);
            int trays   = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["TraysDispached"].ToString()) ? 0 : Convert.ToInt32(DS.Tables[0].Rows[0]["TraysDispached"]);
            int icebox  = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["IceBoxDispached"].ToString()) ? 0 : Convert.ToInt32(DS.Tables[0].Rows[0]["IceBoxDispached"]);
            int cartons = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["CartonsDispached"].ToString()) ? 0 : Convert.ToInt32(DS.Tables[0].Rows[0]["CartonsDispached"]);
            int other   = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["OtherDispached"].ToString()) ? 0 : Convert.ToInt32(DS.Tables[0].Rows[0]["OtherDispached"]);

            int result = 0;

            if (disp.IceBox >= 0 && disp.Trays >= 0 && disp.Cartons >= 0 && disp.OtherDisp >= 0)
            {
                if (disp.IceBox <= icebox && disp.Trays <= trays && disp.Cartons <= cartons && disp.OtherDisp <= other)
                {
                    DataSet ds = new DataSet();
                    result = dispatchData.updateReturnTrays(disp);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Please Enter Valid Quantity')", true);
                }
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Please Enter Valid Quantity')", true);
            }


            if (result > 0)
            {
                ClearTextBox();

                //rpRouteList.DataSource = ds;
                //rpRouteList.DataBind();
                rpRouteList.Visible = false;

                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                lblSuccess.Text     = "Information Updated  Successfully";


                pnlError.Update();

                upMain.Update();
                uprouteList.Update();
            }

            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblwarning.Text     = "Please Contact to Site Admin";
                pnlError.Update();
            }
        }