Пример #1
0
 protected void gvPollutionUnderControl_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     switch (e.CommandName)
     {
     case "roadTaxEdit":
         ViewState["PollutionUnderControlID"] = e.CommandArgument.ToString();
         _puc.UserDistId = Convert.ToInt32(Session["UserdistrictId"].ToString());
         var dspucedit = _puc.GetPollutionUnderControl();
         var drpuc     = dspucedit.Tables[0].Select("PollutionUnderControlID=" + e.CommandArgument);
         ClearControls();
         ddlVehicleNumber.Visible           = false;
         txtVehicleNumber.Visible           = true;
         txtVehicleNumber.Text              = drpuc[0][7].ToString();
         ViewState["VehNum"]                = Convert.ToInt16(drpuc[0][1].ToString());
         txtPollutionValidityStartDate.Text = drpuc[0][2].ToString();
         ddlPollutionValidityPeriod.Items.FindByValue(drpuc[0][3].ToString()).Selected = true;
         txtPollutionValidityEndDate.Text = drpuc[0][4].ToString();
         txtPollutionReceiptNo.Text       = drpuc[0][5].ToString();
         txtPollutionFee.Text             = drpuc[0][6].ToString();
         var dtUpdate = _fmsGeneral.GetPurchaseDate(int.Parse(ViewState["VehNum"].ToString()));
         vehiclePurchaseDate.Value = dtUpdate.ToString(CultureInfo.InvariantCulture);
         pnlPUC.Visible            = true;
         btSave.Text = "Update";
         break;
     }
 }
Пример #2
0
    protected void gvFabricatedVehicleDetails_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName != null)
        {
            try
            {
                switch (e.CommandName)
                {
                case "fabVehEdit":
                    ViewState["FabricatedVehicleDetID"] = e.CommandArgument.ToString();
                    var dsedit = _fabricatedvehicledet.GetFabricatedVehicleDetails();
                    var dr     = dsedit.Tables[0].Select("FabricatedVehicleDetID=" + e.CommandArgument);
                    ClearControls();
                    ddlTRNo.Visible    = false;
                    txtTrNo.Visible    = true;
                    txtTrNo.Text       = dr[0][11].ToString();
                    ViewState["VehId"] = Convert.ToInt16(dr[0][1].ToString());
                    ddlFabricatorName.Items.FindByValue(dr[0][2].ToString()).Selected = true;
                    txtInvoiceNo.Text           = dr[0][3].ToString();
                    txtInvoiceDate.Text         = dr[0][4].ToString();
                    txtFabricationCost.Text     = dr[0][5].ToString();
                    txtVehicleHandoverDate.Text = dr[0][6].ToString();
                    txtFabricationCompDate.Text = dr[0][7].ToString();
                    txtInspecetedBy.Text        = dr[0][8].ToString();
                    txtInspectionDate.Text      = dr[0][9].ToString();
                    var dtUp = _fmsGeneral.GetPurchaseDate(int.Parse(ViewState["VehId"].ToString()));
                    vehiclePurchaseDate.Value           = dtUp.ToString(CultureInfo.InvariantCulture);
                    pnlFabricatedVehicleDetails.Visible = true;
                    btSave.Text = "Update";
                    break;

                case "fabVehDelete":
                    _fabricatedvehicledet.FabricatedVehicleDetID = int.Parse(e.CommandArgument.ToString());
                    var output = _fabricatedvehicledet.ValidateRegVehicle();
                    switch (output)
                    {
                    case 0:
                        _ret = _fabricatedvehicledet.DelFabricatedVehicleDetails();
                        Show(_ret == 1 ? "Record Deleted Successfully" : "Error");
                        break;

                    default:
                        Show("Vehicle Registation has been completed, can not delete");
                        break;
                    }

                    ViewState["FabricatedVehicleDetID"] = null;
                    ClearControls();
                    GetFabricatedVehicleDetails();
                    GetTrNo();
                    break;
                }
            }
            catch (Exception ex)
            {
                _helper.ErrorsEntry(ex);
            }
        }
    }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User_Name"] == null)
        {
            Response.Redirect("Login.aspx");
        }
        if (!IsPostBack)
        {
            var dsPerms = (DataSet)Session["PermissionsDS"];
            if (dsPerms == null)
            {
                throw new ArgumentNullException(nameof(dsPerms));
            }
            dsPerms.Tables[0].DefaultView.RowFilter = "Url='" + Page.Request.Url.Segments[Page.Request.Url.Segments.Length - 1] + "'";
            var p = new PagePermissions(dsPerms, dsPerms.Tables[0].DefaultView[0]["Url"].ToString(), dsPerms.Tables[0].DefaultView[0]["Title"].ToString());
            btSave.Attributes.Add("onclick", "return validation()");
            GetVehicleNumber();
            if (Request.QueryString["vehicleid"] != null)
            {
                try
                {
                    ddlVehicleNo.Items.FindByValue(Request.QueryString["vehicleid"]).Selected = true;
                    GetVehicleInsuranceData();
                    var pdt = _fmsGeneral.GetPurchaseDate(int.Parse(ddlVehicleNo.SelectedItem.Value));
                    vehiclePurchaseDate.Value = pdt.ToString(CultureInfo.CurrentCulture);
                }
                catch (Exception)
                {
                    Show("No vehicle");
                }
            }

            GetAgency();
            GetInsuranceType();
            pnlVehicleInsurance.Visible = p.Add;
            if (p.View && p.Add == false && p.Modify == false && p.Approve == false)
            {
                Response.Redirect("~/VehicleInsuranceViewHistory.aspx", false);
            }
        }

        switch (chkBoxChangeInsuranceDetails.Checked)
        {
        case false:
            ddlInsuranceType.Visible       = false;
            ddlInsuranceAgency.Visible     = false;
            txtInsuranceAgency.Visible     = true;
            txtInsuranceType.Visible       = true;
            txtInsurancePolicyNo.BackColor = Color.DarkGray;
            break;
        }
    }
Пример #4
0
 protected void gvFitnessRenewal_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName != null)
     {
         try
         {
             switch (e.CommandName)
             {
             case "fitnessRenewalEdit":
                 ViewState["FitnessRenewalID"] = e.CommandArgument.ToString();
                 _fitnessren.UserDistrictId    = Convert.ToInt32(Session["UserdistrictId"].ToString());
                 var dsfitrenedit = _fitnessren.GetFitnessRenewal();
                 var drfitren     = dsfitrenedit.Tables[0].Select("FitnessRenewalID=" + e.CommandArgument);
                 ClearControls();
                 ddlVehicleNumber.Visible         = false;
                 txtVehicleNumber.Visible         = true;
                 txtVehicleNumber.Text            = drfitren[0][8].ToString();
                 ViewState["VehNum"]              = Convert.ToInt16(drfitren[0][1].ToString());
                 txtFitnessValidityStartDate.Text = drfitren[0][2].ToString();
                 ddlFitnessValidityPeriod.Items.FindByValue(drfitren[0][3].ToString()).Selected = true;
                 txtFitnessValidityEndDate.Text = drfitren[0][4].ToString();
                 txtVehicleRTACircle.Text       = drfitren[0][5].ToString();
                 txtFitnessReceiptNo.Text       = drfitren[0][6].ToString();
                 txtFitnessFee.Text             = drfitren[0][7].ToString();
                 var dtUpdat = _fmsGeneral.GetPurchaseDate(int.Parse(ViewState["VehNum"].ToString()));
                 vehiclePurchaseDate.Value = dtUpdat.ToString(CultureInfo.InvariantCulture);
                 pnlFitnessRenewal.Visible = true;
                 btSave.Text = "Update";
                 break;
             }
         }
         catch (Exception ex)
         {
             _helper.ErrorsEntry(ex);
         }
     }
 }