Exemplo n.º 1
0
        protected void btnClick_btnupdateVehicleroutemap(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                // My credential check code


                transportdata         = new TransportData();
                transport             = new Transports();
                transport.trVRMID     = string.IsNullOrEmpty(hfvmapId.Value) ? 0 : Convert.ToInt32(hfvmapId.Value);
                transport.trVehicleNo = Convert.ToInt32(dpVehicleNo.SelectedItem.Value);;

                transport.trRouteID = Convert.ToInt32(dproute.SelectedItem.Value);
                transport.CreatedBy = GlobalInfo.Userid;
                if (dpIsActive.SelectedItem.Value == "1")
                {
                    transport.IsActive = true;
                }
                else if (dpIsActive.SelectedItem.Text == "2")
                {
                    transport.IsActive = false;
                }
                transport.Createddate  = DateTime.Now.ToString("dd-MM-yyyy");
                transport.ModifiedBy   = GlobalInfo.Userid;
                transport.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy");
                transport.flag         = "Update";
                int Result = 0;
                Result = transportdata.AddVehicleRouteMapInfo(transport);
                if (Result > 0)
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = false;
                    divSusccess.Visible = true;
                    lblSuccess.Text     = "Vehicle Route Map Updated  Successfully";

                    ClearTextBox();
                    BindVehicleRoteMapInfo();
                    pnlError.Update();
                    upMain.Update();
                    uprouteList.Update();
                    btnupdateVehicleroutemap.Visible = false;
                    btnAddVehicleroutemap.Visible    = true;
                }
                else
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = true;
                    divSusccess.Visible = false;
                    lblwarning.Text     = "Please Contact to Site Admin";
                    pnlError.Update();
                }
            }
        }
Exemplo n.º 2
0
        public void DeleteMapbyID(int trVRMID)
        {
            transportdata         = new TransportData();
            transport             = new Transports();
            transport.trVRMID     = Convert.ToInt32(trVRMID);
            transport.trVehicleNo = 0;
            transport.trRouteID   = 0;

            transport.CreatedBy    = GlobalInfo.Userid;
            transport.IsActive     = true;
            transport.Createddate  = DateTime.Now.ToString("dd-MM-yyyy");
            transport.ModifiedBy   = GlobalInfo.Userid;
            transport.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy");
            transport.flag         = "Delete";
            int Result = 0;

            Result = transportdata.AddVehicleRouteMapInfo(transport);
            if (Result > 0)
            {
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                lblSuccess.Text     = "Vehicle Route Map Deleted  Successfully";

                ClearTextBox();
                BindVehicleRoteMapInfo();
                pnlError.Update();
                upMain.Update();
                uprouteList.Update();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblwarning.Text     = "Please Contact to Site Admin";
                pnlError.Update();
            }
        }