Ejemplo n.º 1
0
        protected void btnClick_btnAddFuelPumpDetails(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                transportdata          = new TransportData();
                transport              = new Transports();
                transport.ID           = 0;
                transport.fuelpumpname = txtfuelpumpname.Text;

                transport.pumpaddress = txtpumpaddress.Text;

                transport.RouteID       = Convert.ToInt32(dproute.SelectedItem.Value);
                transport.fuelcompanyId = Convert.ToInt32(dpfuelcompany.SelectedItem.Value);

                transport.contractstartdate = string.IsNullOrEmpty(txtcontractstartdate.Text) ? string.Empty : (Convert.ToDateTime(txtcontractstartdate.Text)).ToString("dd-MM-yyyy");
                transport.contractenddate   = string.IsNullOrEmpty(txtcontractenddate.Text) ? string.Empty : (Convert.ToDateTime(txtcontractenddate.Text)).ToString("dd-MM-yyyy");



                transport.NonRegisterpump = txtregistrationno.Text;
                transport.contractamt     = string.IsNullOrEmpty(txtcontractamt.Text) ? 0 : Convert.ToDouble(txtcontractamt.Text);

                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         = "Insert";
                int Result = 0;

                Result = transportdata.AddFuelPumpMasterInfo(transport);
                if (Result > 0)
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = false;
                    divSusccess.Visible = true;
                    lblSuccess.Text     = " Fuel Dealer Added  Successfully";

                    ClearTextBox();
                    BindVehicleOperationInfo();
                    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();
                }
            }
        }
Ejemplo n.º 2
0
        public void DeleteMapbyID(int Tr_FuelID)
        {
            transportdata = new TransportData();
            transport     = new Transports();
            transport.ID  = Convert.ToInt32(Tr_FuelID);


            transport.fuelpumpname = txtfuelpumpname.Text;

            transport.pumpaddress = txtpumpaddress.Text;

            transport.RouteID = 0;

            transport.fuelcompanyId     = 0;
            transport.contractstartdate = "";
            transport.contractenddate   = "";



            transport.NonRegisterpump = txtregistrationno.Text;
            transport.contractamt     = Convert.ToDouble(txtcontractamt.Text);

            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         = "Delete";
            int Result = 0;

            Result = transportdata.AddFuelPumpMasterInfo(transport);
            if (Result > 0)
            {
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                lblSuccess.Text     = "Fuel Dealer   Deleted  Successfully";

                ClearTextBox();
                BindVehicleOperationInfo();
                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();
            }
        }