Ejemplo n.º 1
0
    protected void btnsubmit_Click(object sender, EventArgs e)
    {
        if (Request.Form["chkPassPort"] != null)
        {
            if (Request.Form["chkPassPort"] == "delivered")
            {
                ddlreason.SelectedIndex           = -1;
                txtreturned.Value                 = null;
                txtdescription.Value              = null;
                P.AdminInsertdelivereddeliveredon = Convert.ToDateTime(txtdelivered.Value);
                P.AdminInsertdeliveredshipment    = Convert.ToInt32(ddlshipment.SelectedValue);
                P.AdminInsertdeliveredcreatedby   = Convert.ToInt32(Session["username"]);
                P.AdminFetchID = Convert.ToInt32(ddlshipment.SelectedValue);
                dt2            = F.AdminFetchcheckongoingstep(P);
                dt3            = F.AdminFetchcheckdeliveredstep(P);
                if (dt2.Rows[0][0] != null)
                {
                    P.AdminInsertdeliveredRider = Convert.ToInt32(dt2.Rows[0][0]);

                    if (dt3.Rows[0][0] != null)
                    {
                        insert.AdminInsertdeliveredstep(P);
                    }

                    else
                    {
                    }
                }

                else
                {
                }
            }

            else if (Request.Form["chkPassPort"] == "returned")
            {
                txtdelivered.Value              = null;
                P.AdminInsertreturnerturnon     = Convert.ToDateTime(txtreturned.Value);
                P.AdminInsertreturncreatedby    = Convert.ToInt32(Session["username"]);
                P.AdminInsertreturnshipment     = Convert.ToInt32(ddlshipment.SelectedValue);
                P.AdminInsertreturnreason       = Convert.ToInt32(ddlreason.SelectedValue);
                P.AdminInsertreturndisccription = txtdescription.InnerText;
                P.AdminFetchID = Convert.ToInt32(ddlshipment.SelectedValue);
                dt             = F.AdminFetchcheckreturnstep(P);

                if (dt2.Rows[0][0] != null)
                {
                    P.AdminInsertreturnrider = Convert.ToInt32(dt2.Rows[0][0]);

                    if (dt.Rows[0][0] != null)
                    {
                        insert.AdminInsertReturnstep(P);
                    }

                    else
                    {
                    }
                }

                else
                {
                }
            }
        }
    }