Exemplo n.º 1
0
    protected void btnConsSubmit_Click(object sender, EventArgs e)
    {
        deliveryEntity deliveryEntityObj = new deliveryEntity();

        deliveryEntityObj.delTrackId_ = txtTrckId.Text.Trim().ToUpper();
        //deliveryEntityObj.delSourceBranchId_ = txtDelSrcBrId.Text.Trim().ToUpper();
        //deliveryEntityObj.delSourceBranchName_ = txtDelSrcBrName.Text.Trim().ToUpper();
        deliveryEntityObj.delDateOfDel_       = Convert.ToDateTime(txtDelDateOfDel.Text.Trim());
        deliveryEntityObj.delCurrentBranchId_ = txtCrBrId.Text.Trim().ToUpper();
        deliveryEntityObj.delNextBranchId_    = txtNxtBrId.Text.Trim().ToUpper();
        deliveryEntityObj.delDateOfRec_       = Convert.ToDateTime(txtDelDateOfRec.Text.Trim());
        //deliveryEntityObj.delDestnBranchId_ = txtDelDestBrId.Text.Trim().ToUpper();
        //deliveryEntityObj.delDestnBranchName_ = txtDelDestBrName.Text.Trim().ToUpper();
        deliveryEntityObj.delExpDateOfDel_    = Convert.ToDateTime(txtExpDelDateOfDel.Text.Trim());
        deliveryEntityObj.delCurrentLocation_ = txtDelCrLoc.Text.Trim();
        deliveryEntityObj.delEmpMail_         = empEmail;

        if (String.Equals(currentBranch, destBranch))
        {
            deliveryEntityObj.delStatus_ = Convert.ToBoolean(true);
            consignmentEntity consignmentEntityObj = new consignmentEntity();
            consignmentEntityObj.consDelStatus_ = deliveryEntityObj.delStatus_;
            string           trackId             = txtTrckId.Text.Trim().ToUpper();
            consDelStatusBAL consDelStatusBALObj = new consDelStatusBAL();
            consDelStatusBALObj.consDelStatusBALF(consignmentEntityObj, trackId);
        }

        empEditDeliveryBAL empEditDeliveryBALObj = new empEditDeliveryBAL();

        empEditDeliveryBALObj.empEditDeliveryBALF(deliveryEntityObj);

        Response.Redirect("viewDelivery.aspx");
    }
        public void consDisStatusDALF(consignmentEntity consignmentEntityObj, string trackId)
        {
            using (SqlConnection conObj = new SqlConnection(CS))
            {
                SqlCommand cmdObj = new SqlCommand("consDisStatus", conObj);
                cmdObj.CommandType = CommandType.StoredProcedure;
                cmdObj.Parameters.AddWithValue("@consTrackId", trackId);
                cmdObj.Parameters.AddWithValue("@consDisStatus", consignmentEntityObj.consDisStatus_);

                conObj.Open();
                cmdObj.ExecuteNonQuery();
            }
        }
Exemplo n.º 3
0
        public void addConsignmentDALF(consignmentEntity consignmentEntityObj)
        {
            using (SqlConnection conObj = new SqlConnection(CS))
            {
                SqlCommand cmdObj = new SqlCommand("addConsignments", conObj);
                cmdObj.CommandType = CommandType.StoredProcedure;

                cmdObj.Parameters.AddWithValue("@consId", consignmentEntityObj.consId_);
                cmdObj.Parameters.AddWithValue("@consTrackId", consignmentEntityObj.consTrackId_);
                cmdObj.Parameters.AddWithValue("@consShipperName", consignmentEntityObj.consShipperName_);
                cmdObj.Parameters.AddWithValue("@consShipperMobile", consignmentEntityObj.consShipperMobile_);
                cmdObj.Parameters.AddWithValue("@consShipperMail", consignmentEntityObj.consShipperMail_);
                cmdObj.Parameters.AddWithValue("@consShipperAddress", consignmentEntityObj.consShipperAddress_);
                cmdObj.Parameters.AddWithValue("@consMaterialDescription", consignmentEntityObj.consMaterialDescription_);
                cmdObj.Parameters.AddWithValue("@consTotalItems", consignmentEntityObj.consTotalItems_);
                cmdObj.Parameters.AddWithValue("@consTotalWeight", consignmentEntityObj.consTotalWeight_);
                cmdObj.Parameters.AddWithValue("@consTotalDistance", consignmentEntityObj.consTotalDistance_);
                cmdObj.Parameters.AddWithValue("@consServiceType", consignmentEntityObj.consServiceType_);
                cmdObj.Parameters.AddWithValue("@consShippingCharge", consignmentEntityObj.consShippingCharge_);
                cmdObj.Parameters.AddWithValue("@consDateOfBooking", consignmentEntityObj.consDateOfBooking_);
                cmdObj.Parameters.AddWithValue("@consSrcBranchId", consignmentEntityObj.consSrcBranchId_);
                cmdObj.Parameters.AddWithValue("@consSrcBranchName", consignmentEntityObj.consSrcBranchName_);
                cmdObj.Parameters.AddWithValue("@consSrcBranchCity", consignmentEntityObj.consSrcBranchCity_);
                cmdObj.Parameters.AddWithValue("@consDestBranchId", consignmentEntityObj.consDestBranchId_);
                cmdObj.Parameters.AddWithValue("@consDestBranchName", consignmentEntityObj.consDestBranchName_);
                cmdObj.Parameters.AddWithValue("@consDestBranchCity", consignmentEntityObj.consDestBranchCity_);
                cmdObj.Parameters.AddWithValue("@consReceiverName", consignmentEntityObj.consReceiverName_);
                cmdObj.Parameters.AddWithValue("@consReceiverMobile", consignmentEntityObj.consReceiverMobile_);
                cmdObj.Parameters.AddWithValue("@consReceiverMail", consignmentEntityObj.consReceiverMail_);
                cmdObj.Parameters.AddWithValue("@consReceiverAddress", consignmentEntityObj.consReceiverAddress_);
                cmdObj.Parameters.AddWithValue("@consBookedBy", consignmentEntityObj.consBookedBy_);

                conObj.Open();
                cmdObj.ExecuteNonQuery();
            }
        }
Exemplo n.º 4
0
        public string consShrMailDALF(consignmentEntity consignmentEntityObj, out string trckId)
        {
            string shrMail = string.Empty;
            string trckkId = string.Empty;

            using (SqlConnection conObj = new SqlConnection(CS))
            {
                conObj.Open();
                SqlCommand cmdObj = new SqlCommand("consShrMail", conObj);
                cmdObj.CommandType = CommandType.StoredProcedure;
                cmdObj.Parameters.AddWithValue("@consId", consignmentEntityObj.consId_);
                using (SqlDataReader reader = cmdObj.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        shrMail = reader[0].ToString();
                        trckkId = reader[1].ToString();
                    }
                }
            }

            trckId = trckkId;
            return(shrMail);
        }
Exemplo n.º 5
0
 public void consRecStatusBALF(consignmentEntity consignmentEntityObj, string trackId)
 {
     consRecStatusDALObj.consRecStatusDALF(consignmentEntityObj, trackId);
 }
Exemplo n.º 6
0
 public string consShrMailBALF(consignmentEntity consignmentEntityObj,out string trckId)
 {
     string shrMail = addConsignmentDALObj.consShrMailDALF(consignmentEntityObj,out trckId);
     return shrMail;
 }
Exemplo n.º 7
0
 public void addConsignmentBALF(consignmentEntity consignmentEntityObj)
 {
     addConsignmentDALObj.addConsignmentDALF(consignmentEntityObj);
   
 }
Exemplo n.º 8
0
    protected void btnConsSubmit_Click(object sender, EventArgs e)
    {
        consignmentEntity consignmentEntityObj = new consignmentEntity();

        consignmentEntityObj.consShipperName_         = txtShrName.Text.Trim().ToUpper();
        consignmentEntityObj.consShipperMobile_       = Convert.ToDecimal(txtShrMobile.Text.Trim());
        consignmentEntityObj.consShipperMail_         = txtShrEmail.Text.Trim().ToUpper();
        consignmentEntityObj.consShipperAddress_      = txtShrAddress.Text.Trim().ToUpper();
        consignmentEntityObj.consMaterialDescription_ = txtMtrDesc.Text.Trim().ToUpper();
        consignmentEntityObj.consTotalItems_          = Convert.ToDecimal(txtTotItems.Text.Trim());
        consignmentEntityObj.consTotalWeight_         = Convert.ToDecimal(txtTotWeight.Text.Trim());
        consignmentEntityObj.consTotalDistance_       = Convert.ToDecimal(txtTotDist.Text.Trim());
        consignmentEntityObj.consServiceType_         = drpSrType.Text.ToUpper();
        consignmentEntityObj.consShippingCharge_      = Convert.ToDecimal(txtShpCharge.Text.Trim());
        consignmentEntityObj.consDateOfBooking_       = Convert.ToDateTime(txtDobook.Text.Trim());
        consignmentEntityObj.consSrcBranchId_         = drpSrcBrId.Text.Trim().ToUpper();
        consignmentEntityObj.consSrcBranchName_       = txtSrcBrName.Text.Trim().ToUpper();
        consignmentEntityObj.consSrcBranchCity_       = txtSrcBrCity.Text.Trim().ToUpper();
        consignmentEntityObj.consDestBranchId_        = drpDestBrId.Text.Trim().ToUpper();
        consignmentEntityObj.consDestBranchName_      = txtDestBrName.Text.Trim().ToUpper();
        consignmentEntityObj.consDestBranchCity_      = txtDestBrCity.Text.Trim().ToUpper();
        consignmentEntityObj.consReceiverName_        = txtRecName.Text.Trim().ToUpper();
        consignmentEntityObj.consReceiverMobile_      = Convert.ToDecimal(txtRecMobile.Text.Trim());
        consignmentEntityObj.consReceiverMail_        = txtRecEmail.Text.Trim().ToUpper();
        consignmentEntityObj.consReceiverAddress_     = txtRecAddress.Text.Trim().ToUpper();
        if (String.Equals(consBookUsr, "Employee"))
        {
            consignmentEntityObj.consBookedBy_ = consBookEmail;
        }
        else
        {
            consignmentEntityObj.consBookedBy_ = "User" + consBookEmail;
        }

        idIncrementCons++;
        idIncrementTrck++;
        consignmentEntityObj.consId_      = "CONSEMPID" + Convert.ToString(idIncrementCons);
        consignmentEntityObj.consTrackId_ = "TRCKEMPID" + Convert.ToString(idIncrementTrck);

        addConsignmentBAL addConsignmentBALObj = new addConsignmentBAL();

        addConsignmentBALObj.addConsignmentBALF(consignmentEntityObj);

        string trckId;
        string shrMailUI = addConsignmentBALObj.consShrMailBALF(consignmentEntityObj, out trckId);
        string message   = "Your Consignment has been booked Successfully.Your tracking id is :" + trckId + "Thankyou for using our service.";


        MailMessage mail   = new MailMessage("*****@*****.**", shrMailUI, "Consignment Booked Successfully", message);
        SmtpClient  client = new SmtpClient();

        client.Port = 587;
        client.Host = "smtp.gmail.com";

        client.Timeout               = 10000;
        client.DeliveryMethod        = SmtpDeliveryMethod.Network;
        client.UseDefaultCredentials = false;
        client.Credentials           = new System.Net.NetworkCredential("*****@*****.**", "Parcel@12345");
        client.EnableSsl             = true;

        mail.BodyEncoding = UTF8Encoding.UTF8;
        mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
        client.Send(mail);

        txtDestBrCity.Text = "";
        drpDestBrId.Text   = "";
        txtDestBrName.Text = "";
        txtDobook.Text     = "";
        txtMtrDesc.Text    = "";
        txtRecAddress.Text = "";
        txtRecEmail.Text   = "";
        txtRecMobile.Text  = "";
        txtRecName.Text    = "";
        txtShpCharge.Text  = "";
        txtShrAddress.Text = "";
        txtShrEmail.Text   = "";
        txtShrMobile.Text  = "";
        txtShrName.Text    = "";
        txtSrcBrCity.Text  = "";
        drpSrcBrId.Text    = "";
        txtSrcBrName.Text  = "";
        txtTotDist.Text    = "";
        txtTotItems.Text   = "";
        txtTotWeight.Text  = "";
    }