Beispiel #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Consignment consignment = (Consignment)Session["listconsign"];


            int id = consignBal.CreateConsignment(consignment);
        }
Beispiel #2
0
        protected void BtnConsignmentSave_Click(object sender, EventArgs e)
        {
            ConsignmentBusinessAccess consignBal = new ConsignmentBusinessAccess();
            Consignment consignment = new Consignment();
            string      othrCountry = null;

            consignment.FkAgentId     = Convert.ToInt32(Request.QueryString["AgentID"]);
            consignment.CgVisaCountry = Convert.ToInt32(DrpdnVisaCountry.SelectedItem.Value);
            Session["CountryId"]      = Convert.ToInt32(DrpdnVisaCountry.SelectedItem.Value);
            foreach (ListItem item in LstSelectedCountry.Items)
            {
                othrCountry += item.Text + ",";
            }
            consignment.CgOtherCountries   = othrCountry;
            consignment.CgSubmissionDate   = (txtSubmDate.Text);
            consignment.CgCheckOnDate      = (txtChkDate.Text);
            consignment.CgTravelDates      = (txtTravlDate.Text);
            consignment.CG_COLLECTION_DATE = (txtTravlDate.Text);
            consignment.CgGroupRep         = txtGroup.Text;
            consignment.CgInstruction      = TxtInstruction.Text;
            consignment.CgRemarks          = txtRemark.Text;

            consignment.CG_COLLECTED             = ChckbxCollctd.Text = "";
            consignment.CG_BLANK_COLLECTION_DATE = ChckbxBlnkColDate.Text = "";
            if (ChckbxDisabl.Checked == true)
            {
                consignment.CG_DISABLE = ChckbxDisabl.Text = "Y";
            }
            else
            {
                consignment.CG_DISABLE = ChckbxDisabl.Text = "N";
            }
            consignment.CG_BLANK_SUBMISSION_DATE = ChckbxBlankSubDate.Text = "";
            consignment.CgAreaCode  = txtAreaCod.Text;
            consignment.CgNoOfPass  = Convert.ToInt32(txtNoPassport.Text);
            consignment.CgNoOfDD    = Convert.ToInt32(txtNoDD.Text);
            consignment.CgEnteredBy = txtEnterdBy.Text;
            consignment.CgSentBy    = txtSntName.Text;
            consignment.CgCorporate = txtCorporate.Text;
            consignment.CgMobNo     = txtmob.Text;

            consignment.CG_EMAIL = txtEmail.Text;
            //Session["ObjConsinment"] = consignment;

            int consgnmentId = consignBal.CreateConsignment(consignment);

            Session["ConsignmentId"] = consgnmentId;
            List <Consignment> lstConsign = new List <Consignment>();

            foreach (ListItem item in LstSelectedCountry.Items)
            {
                int         consignmentId = Convert.ToInt32(Session["ConsignmentId"]);
                Consignment consign       = new Consignment();
                consign.ConsignmentId      = consignmentId;
                consign.CountryName        = item.Text;
                consign.Country_Id         = Convert.ToInt32(item.Value);
                consign.CgSubmissionDate   = DateTime.Now.ToString("dd/MM/yyyy");
                consign.CG_COLLECTION_DATE = DateTime.Now.ToString("dd/MM/yyyy");
                consign.CgCheckOnDate      = DateTime.Now.ToString("dd/MM/yyyy");
                lstConsign.Add(consign);
            }
            Session["listconsign"] = lstConsign;

            ScriptManager.RegisterClientScriptBlock(BtnConsignmentSave, GetType(), "test", "alert('Consignment Add   successfully!!!')", true);
            Response.Redirect("AddConsignment.aspx");
        }