Example #1
0
        protected void ddlType_IndexChanged(object sender, EventArgs e)
        {
            if (txtToDate.Text == "" && txtFromDate.Text == "")
            {
                lblMessage.Text = "Please Select Dates";
                return;
            }

            LoadEmptyGrid();

            lblMessage.Text = string.Empty;
            SqlParameter[] param =
            {
                new SqlParameter("@DealerCode", SqlDbType.Char, 5),           //0
                new SqlParameter("@Type",       SqlDbType.Char, 3),           //0
                new SqlParameter("@FromDate",   SqlDbType.DateTime),          //0
                new SqlParameter("@ToDate",     SqlDbType.DateTime),          //0
            };
            param[0].Value = Session["DealerCode"].ToString();
            param[1].Value = ddlTypes.SelectedValue;
            param[2].Value = sysFunc.SaveDate(txtFromDate.Text);
            param[3].Value = sysFunc.SaveDate(txtToDate.Text);

            ds = ObjGenral.FillDataSet("sp_2W_Service_GetClaimBillingData_new", param);

            if (ds.Tables[0].Rows.Count > 0)
            {
                Grdbillings.DataSource = ds;
                Grdbillings.DataBind();
                Session["JENDetail"] = ds.Tables[0];

                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (GridViewRow gvr in Grdbillings.Rows)
                    {
                        PST         = TotalAmount + SysFunctions.CustomCDBL(ds.Tables[0].Rows[0]["HandlingAmount"].ToString()) + SysFunctions.CustomCDBL(ds.Tables[0].Rows[0]["PSTSubletAmount"].ToString()) + SysFunctions.CustomCDBL(ds.Tables[0].Rows[0]["PSTLaborAmount"].ToString());
                        GST         = TotalAmount + SysFunctions.CustomCDBL(ds.Tables[0].Rows[0]["GSTAmount"].ToString());
                        TotalAmount = TotalAmount + SysFunctions.CustomCDBL(ds.Tables[0].Rows[0]["TotalAmount"].ToString());
                        CheckBox Chk = (CheckBox)gvr.Cells[0].FindControl("ChkBox");
                        Chk.Checked = true;
                        //ChkBox.Checked = true;
                    }
                    txtLabPST.Text      = PST.ToString();
                    txtGSTAmt.Text      = GST.ToString();
                    txtTotalAmount.Text = TotalAmount.ToString();
                    //CalculatePSTPercentage();
                }
            }
            else
            {
                //txtPstAmt.Text = "";
                //txtPerc.Text = "";
                lblMessage.Text = "No Record Found !!!";
            }
        }
Example #2
0
    protected void btn_selfsubmit_Click(object sender, EventArgs e)
    {
        dv_shipping.Visible = false;

        dv_ship_by_self.Visible = true;
        dv_RCS.Visible          = true;
        lbl_ship_self.Text      = txt_self_ship.Text;
        double a1, b1, c1, i;

        double.TryParse(lbl_ref.Text, out a1);
        double.TryParse(lbl_closingfee.Text, out b1);
        double.TryParse(lbl_ship_self.Text, out c1);

        i            = a1 + b1 + c1;
        lbl_RCS.Text = i.ToString();

        double GST, rcs, gst, per;

        per = 100;
        double.TryParse(lbl_RCS.Text, out rcs);
        double.TryParse(lbl_gst_per.Text, out gst);
        GST          = ((rcs * gst) / per);
        lbl_GST.Text = GST.ToString();

        double total, GST_total;

        double.TryParse(lbl_GST.Text, out GST_total);
        total          = rcs + GST_total;
        lbl_total.Text = total.ToString();

        double prod_price, you_make, profit, cost;

        double.TryParse(txt_prod_price.Text, out prod_price);

        you_make          = prod_price - total;
        lbl_you_make.Text = you_make.ToString();
        double.TryParse(txt_cost.Text, out cost);
        profit = you_make - cost;
    }
Example #3
0
    protected void btn_easy_amazon_Click(object sender, EventArgs e)
    {
        dv_shipping.Visible = false;

        dv_ship_by_budgetok.Visible = true;
        dv_RCS.Visible  = true;
        lbl_weight.Text = txt_weight.Text;
        Double weight, gms, kg5, kg12, gms500u, kg5u, kg12u, ship;

        double.TryParse(lbl_weight.Text, out weight);

        if (rbl_lrn.SelectedValue == "Locally")
        {
            gms     = 40;
            gms500u = 40;
            kg5     = 90;
            kg5u    = 19;
            kg12    = 210;
            kg12u   = 12.50;
            lbl_ship_by_budgetok.Text = " " + rbl_lrn.SelectedValue + " ";

            if (weight <= 500)
            {
                lbl_ship.Text = gms.ToString();
            }
            else if (weight >= 501 && weight < 5000)
            {
                double extra = (weight - 500);
                if (extra <= 500)
                {
                    ship          = gms + (gms500u * 1);
                    lbl_ship.Text = ship.ToString();
                }
                else if (extra > 500)
                {
                    double my = (extra / 500);
                    double aa = Math.Ceiling(my);
                    ship          = (gms + (gms500u * aa));
                    lbl_ship.Text = ship.ToString();
                }
            }
            //else if (weight >= 501 && weight <= 1000)
            //{
            //    lbl_ship.Text = (gms + (gms500u * 1)).ToString();
            //}

            //else if (weight >= 1001 && weight <= 1500)
            //{
            //    lbl_ship.Text = (gms + (gms500u * 2)).ToString();
            //}
            //else if (weight >= 1501 && weight <= 2000)
            //{
            //    lbl_ship.Text = (gms + (gms500u * 3)).ToString();
            //}
            //else if (weight >= 2001 && weight <= 3000)
            //{
            //    lbl_ship.Text = (gms + (gms500u * 4)).ToString();
            //}
            //else if (weight >= 3001 && weight <= 4000)
            //{
            //    lbl_ship.Text = (gms + (gms500u * 5)).ToString();
            //}
            //else if (weight >= 4001 && weight < 5000)
            //{
            //    lbl_ship.Text = (gms + (gms500u * 6)).ToString();
            //}
            else if (weight == 5000)
            {
                lbl_ship.Text = kg5.ToString();
            }
            else if (weight >= 5001 && weight < 12000)
            {
                double extra = (weight - 5000);
                if (extra <= 1000)
                {
                    ship          = kg5 + (kg5u * 1);
                    lbl_ship.Text = ship.ToString();
                }
                else if (extra > 1000)
                {
                    double my = (extra / 1000);
                    double aa = Math.Ceiling(my);
                    ship          = (kg5 + (kg5u * aa));
                    lbl_ship.Text = ship.ToString();
                }
            }

            else if (weight == 12000)
            {
                lbl_ship.Text = kg12.ToString();
            }
            else if (weight >= 12000)
            {
                double extra = (weight - 12000);
                if (extra <= 1000)
                {
                    ship          = kg12 + (kg12u * 1);
                    lbl_ship.Text = ship.ToString();
                }
                else if (extra > 1000)
                {
                    double my = (extra / 1000);
                    double aa = Math.Ceiling(my);
                    ship          = (kg12 + (kg12u * aa));
                    lbl_ship.Text = ship.ToString();
                }
            }
        }
        else if (rbl_lrn.SelectedValue == "Regionally")
        {
            gms     = 55;
            gms500u = 45;
            kg5     = 140;
            kg5u    = 21;
            kg12    = 310;
            kg12u   = 15;
            lbl_ship_by_budgetok.Text = "&nbsp;" + rbl_lrn.SelectedValue + "&nbsp;";

            if (weight <= 500)
            {
                lbl_ship.Text = gms.ToString();
            }

            else if (weight >= 501 && weight < 5000)
            {
                double extra = (weight - 500);
                if (extra <= 500)
                {
                    ship          = gms + (gms500u * 1);
                    lbl_ship.Text = ship.ToString();
                }
                else if (extra > 500)
                {
                    double my = (extra / 500);
                    double aa = Math.Ceiling(my);
                    ship          = (gms + (gms500u * aa));
                    lbl_ship.Text = ship.ToString();
                }
            }
            else if (weight == 5000)
            {
                lbl_ship.Text = kg5.ToString();
            }
            else if (weight >= 5001 && weight < 12000)
            {
                double extra = (weight - 5000);
                if (extra <= 1000)
                {
                    ship          = kg5 + (kg5u * 1);
                    lbl_ship.Text = ship.ToString();
                }
                else if (extra > 1000)
                {
                    double my = (extra / 1000);
                    double aa = Math.Ceiling(my);
                    ship          = (kg5 + (kg5u * aa));
                    lbl_ship.Text = ship.ToString();
                }
            }

            else if (weight == 12000)
            {
                lbl_ship.Text = kg12.ToString();
            }
            else if (weight >= 12000)
            {
                double extra = (weight - 12000);
                if (extra <= 1000)
                {
                    ship          = kg12 + (kg12u * 1);
                    lbl_ship.Text = ship.ToString();
                }
                else if (extra > 1000)
                {
                    double my = (extra / 1000);
                    double aa = Math.Ceiling(my);
                    ship          = (kg12 + (kg12u * aa));
                    lbl_ship.Text = ship.ToString();
                }
            }
        }
        else if (rbl_lrn.SelectedValue == "Nationally")
        {
            gms     = 75;
            gms500u = 55;
            kg5     = 190;
            kg5u    = 23;

            lbl_ship_by_budgetok.Text = "&nbsp;" + rbl_lrn.SelectedValue + "&nbsp;";

            if (weight <= 500)
            {
                lbl_ship.Text = gms.ToString();
            }

            else if (weight >= 501 && weight < 5000)
            {
                double extra = (weight - 500);
                if (extra <= 500)
                {
                    ship          = gms + (gms500u * 1);
                    lbl_ship.Text = ship.ToString();
                }
                else if (extra > 500)
                {
                    double my = (extra / 500);
                    double aa = Math.Ceiling(my);
                    ship          = (gms + (gms500u * aa));
                    lbl_ship.Text = ship.ToString();
                }
            }
            else if (weight == 5000)
            {
                lbl_ship.Text = kg5.ToString();
            }
            else if (weight >= 5001 && weight < 12000)
            {
                double extra = (weight - 5000);
                if (extra <= 1000)
                {
                    ship          = kg5 + (kg5u * 1);
                    lbl_ship.Text = ship.ToString();
                }
                else if (extra > 1000)
                {
                    double my = (extra / 1000);
                    double aa = Math.Ceiling(my);
                    ship          = (kg5 + (kg5u * aa));
                    lbl_ship.Text = ship.ToString();
                }
            }
        }
        double a1, b1, c1, i;

        double.TryParse(lbl_ref.Text, out a1);
        double.TryParse(lbl_closingfee.Text, out b1);
        double.TryParse(lbl_ship.Text, out c1);

        i            = a1 + b1 + c1;
        lbl_RCS.Text = i.ToString();

        double GST, rcs, gst, per;

        per = 100;
        double.TryParse(lbl_RCS.Text, out rcs);
        double.TryParse(lbl_gst_per.Text, out gst);
        GST          = ((rcs * gst) / per);
        lbl_GST.Text = GST.ToString();

        double total, GST_total;

        double.TryParse(lbl_GST.Text, out GST_total);
        total          = rcs + GST_total;
        lbl_total.Text = total.ToString();

        double prod_price, you_make, profit, cost;

        double.TryParse(txt_prod_price.Text, out prod_price);

        you_make          = prod_price - total;
        lbl_you_make.Text = you_make.ToString();
        double.TryParse(txt_cost.Text, out cost);
        profit = you_make - cost;
    }