protected void btnConsSubmit_Click(object sender, EventArgs e)
    {
        servicesEntity servicesEntityObj = new servicesEntity();

        servicesEntityObj.serviceType_  = txtSrType.Text.Trim().ToUpper();
        servicesEntityObj.costWeight_   = Convert.ToDecimal(txtSrCosWe.Text.Trim());
        servicesEntityObj.costDistance_ = Convert.ToDecimal(txtSrCosDist.Text.Trim());
        servicesEntityObj.serviceId_    = txtSrType.Text.Trim().ToUpper().Substring(0, 1) + txtSrType.Text.Trim().ToUpper();

        addServicesBAL addServicesBALObj = new addServicesBAL();

        addServicesBALObj.addServiceBALF(servicesEntityObj);
    }
        public void addservicesDALF(servicesEntity servicesEntityObj)
        {
            using (SqlConnection conObj = new SqlConnection(CS))
            {
                SqlCommand cmdObj = new SqlCommand("addServices", conObj);
                cmdObj.CommandType = CommandType.StoredProcedure;

                cmdObj.Parameters.Clear();
                cmdObj.Parameters.AddWithValue("@serviceId", servicesEntityObj.serviceId_);
                cmdObj.Parameters.AddWithValue("@serviceType", servicesEntityObj.serviceType_);
                cmdObj.Parameters.AddWithValue("@costWeight", servicesEntityObj.costWeight_);
                cmdObj.Parameters.AddWithValue("@costDistance", servicesEntityObj.costDistance_);
                conObj.Open();
                cmdObj.ExecuteNonQuery();
            }
        }
    protected void btnCalcDist_Click(object sender, EventArgs e)
    {
        addConsignmentBAL addConsignmentBALObj = new addConsignmentBAL();
        string            srcBrLong;
        cityEntity        cityEntityObj = new cityEntity();

        cityEntityObj.cityName_ = txtSrcBrCity.Text.Trim().ToUpper();


        string srcBrLat    = addConsignmentBALObj.consCityBALF(cityEntityObj, out srcBrLong);
        double srLatitude  = Convert.ToDouble(srcBrLat);
        double srLongitude = Convert.ToDouble(srcBrLong);

        string destBrLong;

        cityEntityObj.cityName_ = txtDestBrCity.Text.Trim().ToUpper();

        string destBrLat   = addConsignmentBALObj.consCityBALF1(cityEntityObj, out destBrLong);
        double dsLatitude  = Convert.ToDouble(destBrLat);
        double dsLongitude = Convert.ToDouble(destBrLong);

        double distance = DistanceBetweenPlaces(srLongitude, srLatitude, dsLongitude, dsLatitude);

        txtTotDist.Text = Convert.ToString(distance);

        //txtShpCharge.Text=(txtTotWeight.Text)

        string         costAccDist;
        servicesEntity servicesEntityObj = new servicesEntity();

        servicesEntityObj.serviceType_ = drpSrType.Text.Trim().ToUpper();

        string costAccWeight = addConsignmentBALObj.consServiceCostBALF(servicesEntityObj, out costAccDist);

        //Label1.Text = "hello"+costAccWeight;

        double servCostAccWeight = Convert.ToDouble(costAccWeight);
        double servCostAccDist   = Convert.ToDouble(costAccDist);

        double totWeightC = Convert.ToDouble(txtTotWeight.Text.Trim());

        txtShpCharge.Text = Convert.ToString(costCalculationF(servCostAccWeight, servCostAccDist, distance, totWeightC));
    }
Пример #4
0
        public string consServiceCostDALF(servicesEntity servicesEntityObj, out string costAccDist)
        {
            string costAccWeight = string.Empty;
            string costDistServ  = string.Empty;

            using (SqlConnection conObj = new SqlConnection(CS))
            {
                conObj.Open();
                SqlCommand cmdObj = new SqlCommand("consServiceCost", conObj);
                cmdObj.CommandType = CommandType.StoredProcedure;
                cmdObj.Parameters.AddWithValue("@serviceType", servicesEntityObj.serviceType_);
                using (SqlDataReader reader = cmdObj.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        costAccWeight = reader[0].ToString();
                        costDistServ  = reader[1].ToString();
                    }
                }
            }

            costAccDist = costDistServ;
            return(costAccWeight);
        }
Пример #5
0
        public void addServiceBALF(servicesEntity servicesEntityObj)
        {
            addServicesDAL addServicesDALObj = new addServicesDAL();

            addServicesDALObj.addservicesDALF(servicesEntityObj);
        }
Пример #6
0
 public string consServiceCostBALF(servicesEntity servicesEntityObj,out string costAccDist)
 {
     string costAccWeight = addConsignmentDALObj.consServiceCostDALF(servicesEntityObj, out costAccDist);
     return costAccWeight;
 }