private void Get_OrganizationDetails(int OrgID)
        {
            try
            {
                BL_SuperAdmin  objBL  = new BL_SuperAdmin();
                EWA_SuperAdmin objEWA = new EWA_SuperAdmin();

                DataSet ds = objBL.Get_OrganizationDetails(OrgID);

                lbl_CollegeName.Text    = ds.Tables[0].Rows[0]["OrgName"].ToString();
                lbl_CollegeAddress.Text = ds.Tables[0].Rows[0]["Address"].ToString();
                lbl_Number.Text         = ds.Tables[0].Rows[0]["PhoneNo"].ToString();
                lbl_website.Text        = ds.Tables[0].Rows[0]["Website"].ToString();

                lbl_CollegeName1.Text    = ds.Tables[0].Rows[0]["OrgName"].ToString();
                lbl_CollegeAddress1.Text = ds.Tables[0].Rows[0]["Address"].ToString();
                lbl_Number1.Text         = ds.Tables[0].Rows[0]["PhoneNo"].ToString();
                lbl_website1.Text        = ds.Tables[0].Rows[0]["Website"].ToString();
                //Lbl_TrustName.Text = ds.Tables[0].Rows[0]["TrustName"].ToString();
            }

            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
                //throw exp;
            }
        }
Exemple #2
0
        private void Get_OrganizationDetails(int OrgID)
        {
            try
            {
                BL_SuperAdmin  objBL  = new BL_SuperAdmin();
                EWA_SuperAdmin objEWA = new EWA_SuperAdmin();

                DataSet ds = objBL.Get_OrganizationDetails(OrgID);

                string StaffPhoto = ds.Tables[0].Rows[0]["Logo"].ToString();
                if (StaffPhoto != null && StaffPhoto != "")
                {
                    Byte[] bytes = (Byte[])ds.Tables[0].Rows[0]["Logo"];

                    string base64String = Convert.ToBase64String(bytes, 0, bytes.Length);
                    ImageButton_logo.ImageUrl = "data:image/png;base64," + base64String;
                }

                lbl_CollegeName.Text    = ds.Tables[0].Rows[0]["OrgName"].ToString();
                lbl_CollegeAddress.Text = ds.Tables[0].Rows[0]["Address"].ToString();
                //Lbl_TrustName.Text = ds.Tables[0].Rows[0]["TrustName"].ToString();
            }

            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
                //throw exp;
            }
        }
        //Get Org Code
        #region [Get Org Code]

        private int Get_orgCode()
        {
            try
            {
                BL_SuperAdmin bcls     = new BL_SuperAdmin();
                int           org_Code = bcls.Get_orgCode();
                return(org_Code);
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
                return(0);
            }
        }
        private void AddCollegeToDropDown()
        {
            try
            {
                EWA_SuperAdmin clas1 = new EWA_SuperAdmin();
                BL_SuperAdmin  bcls  = new BL_SuperAdmin();

                DataSet ds = bcls.AddCollegeToDropDown();

                DropDownList1.DataTextField  = "OrgLabel";
                DropDownList1.DataValueField = "OrgLabel";
                DropDownList1.DataSource     = ds;
                DropDownList1.DataBind();
                DropDownList1.Items.Insert(0, "Select");
            }
            catch (Exception exp)
            {
            }
        }
        private void AddCollegeToDropDown()
        {
            try
            {
                EWA_SuperAdmin clas1 = new EWA_SuperAdmin();
                BL_SuperAdmin  bcls  = new BL_SuperAdmin();

                DataSet ds = bcls.AddCollegeToDropDown();

                DDL_SelectCollege.DataTextField  = "OrgLabel";
                DDL_SelectCollege.DataValueField = "OrganizationId";
                DDL_SelectCollege.DataSource     = ds;
                DDL_SelectCollege.DataBind();
                DDL_SelectCollege.Items.Insert(0, "Select");
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Exemple #6
0
        private void AddCollegeToDropDown()
        {
            try
            {
                if (ddlorg.Items.Count <= 0)
                {
                    EWA_SuperAdmin clas1 = new EWA_SuperAdmin();
                    BL_SuperAdmin  bcls  = new BL_SuperAdmin();

                    DataSet ds = bcls.AddCollegeToDropDown();

                    ddlorg.DataTextField  = "OrgLabel";
                    ddlorg.DataValueField = "OrganizationId";
                    ddlorg.DataSource     = ds;
                    ddlorg.DataBind();
                    ddlorg.Items.Insert(0, "Select Organisation");
                }
            }
            catch (Exception ex)
            {
            }
        }
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            BL_SuperAdmin  objBL  = new BL_SuperAdmin();
            EWA_SuperAdmin objEWA = new EWA_SuperAdmin();

            try
            {
                objEWA.orgID          = Convert.ToInt32(TxtOrgID.Text);
                objEWA.OrgCode        = TxtOrgCode.Text;
                objEWA.OrgName        = TxtOrgName.Text;
                objEWA.OrgLabel       = TxtOrgLabel.Text;
                objEWA.PhoneNo        = TxtPhoneNo.Text;
                objEWA.FaxNo          = TxtFax.Text;
                objEWA.Website        = Txtwebsite.Text;
                objEWA.Email          = TxtEmail.Text;
                objEWA.Address        = TxtAddress.Text;
                objEWA.Country        = ddlcountry.SelectedItem.Text;
                objEWA.State          = ddlstate.SelectedItem.Text;
                objEWA.City           = ddlcity.SelectedItem.Text;
                objEWA.Pincode        = Convert.ToInt32(TxtPincode.Text);
                objEWA.UniversityCode = TxtUniversityCode.Text;
                objEWA.MSBTECode      = TxtMSBTEcode.Text;
                objEWA.AICTECode      = TxtAICTECode.Text;
                objEWA.DTECode        = TxtDTEcode.Text;
                objEWA.TrustName      = TxtTrustName.Text;
                objEWA.OrgType        = rbl_OrganizationType.SelectedValue.ToString();
                objEWA.OrgUniversity  = DDL_University.SelectedValue.ToString();

                // Code for store Logo Image

                int    length            = 0;
                byte[] imgLogobyte       = null;
                byte[] imgLetterHeadbyte = null;

                if (FileLogoImage.HasFile)
                {
                    length      = FileLogoImage.PostedFile.ContentLength;
                    imgLogobyte = new byte[length];
                    HttpPostedFile img1 = FileLogoImage.PostedFile;
                    img1.InputStream.Read(imgLogobyte, 0, length);
                }
                objEWA.LogoImage = imgLogobyte;

                if (FileLetterHeadImage.HasFile)
                {
                    length            = FileLetterHeadImage.PostedFile.ContentLength;
                    imgLetterHeadbyte = new byte[length];
                    HttpPostedFile img1 = FileLetterHeadImage.PostedFile;
                    img1.InputStream.Read(imgLetterHeadbyte, 0, length);
                }
                objEWA.LetterHeadImage = imgLetterHeadbyte;

                objBL.insertNew_College_RegistrationBLL(objEWA);

                string emailmsg = SendEmails();

                TxtOrgName.Text        = "";
                TxtPhoneNo.Text        = "";
                TxtAddress.Text        = "";
                TxtPincode.Text        = "";
                TxtTrustName.Text      = "";
                TxtUniversityCode.Text = "";
                Txtwebsite.Text        = "";
                TxtEmail.Text          = "";
                TxtMSBTEcode.Text      = "";
                TxtFax.Text            = "";
                TxtAICTECode.Text      = "";
                TxtDTEcode.Text        = "";

                ddlcity.Items.Insert(0, new ListItem("Select", "0"));

                ddlcountry.Items.Insert(0, new ListItem("Select", "0"));
                ddlstate.Items.Insert(0, new ListItem("Select", "0"));
                DDL_University.Items.Insert(0, new ListItem("Select", "0"));

                int orgID1 = Get_orgID();

                orgID1        = orgID1 + 1;
                TxtOrgID.Text = orgID1.ToString();

                int orgCode = Get_orgCode();
                TxtOrgCode.Text = "CLG/" + orgCode + 1;
                msgBox.ShowMessage("College Register Successfully !!!", "Information", UserControls.MessageBox.MessageStyle.Successfull);
            }
            catch (Exception ex)
            {
                msgBox.ShowMessage("College Registeration Failed !!!", "Information", UserControls.MessageBox.MessageStyle.Critical);
            }
            finally
            {
            }
        }
        // Bind Country State City to Dropdownbox   Data

        //#region Country_State_City Bind

        //protected void DDL_Country_SelectedIndexChanged(object sender, EventArgs e)
        //{

        //    Bind_ddlCountry();
        //    //try
        //    //{
        //    //    LoadStateDropDown(DDL_Country.SelectedValue);
        //    //}
        //    //catch (Exception exp)
        //    //{
        //    //    GeneralErr(exp.Message.ToString());
        //    //}
        //}

        //#endregion

        //Load State
        //#region[Load State]

        //private void LoadStateDropDown(string cid)
        //{
        //    try
        //    {
        //        if (DDL_Country.SelectedValue.Equals("Select") && DDL_Country.SelectedValue.Equals(""))
        //        {
        //            msgBox.ShowMessage("Please Select Country First.. !!!", "Information", UserControls.MessageBox.MessageStyle.Critical);
        //            SetFocus(DDL_Country.Text);
        //        }
        //        else
        //        {
        //            DDL_State.DataTextField = "name";
        //            DDL_State.DataValueField = "cid";
        //            DataSet ds = ViewState["DatasetAll"] as DataSet;

        //            DataView dv = new DataView(ds.Tables["State"]);

        //            dv.RowFilter = "cid = " + cid;
        //            DDL_State.DataSource = dv.ToTable();
        //            DDL_State.DataBind();
        //            DDL_State.Items.Insert(0, new ListItem(" Select ", "0"));
        //        }
        //    }
        //    catch (Exception exp)
        //    {
        //        GeneralErr(exp.Message.ToString());
        //    }
        //}

        //#endregion

        //State Changed
        #region [State Changed]

        //protected void DDL_State_SelectedIndexChanged(object sender, EventArgs e)
        //{

        //    Bind_ddlState();
        //    //try
        //    //{
        //    //    LoadCityDropDown(DDL_State.SelectedValue);
        //    //}
        //    //catch (Exception exp)
        //    //{
        //    //    GeneralErr(exp.Message.ToString());
        //    //}
        //}

        #endregion

        //Load City
        //#region[Load City]

        //private void LoadCityDropDown(string p)
        //{
        //    //try
        //    //{
        //    //    if (DDL_Country.SelectedValue.Equals("Select") && DDL_Country.SelectedValue.Equals("") && DDL_State.SelectedValue.Equals(""))
        //    //    {
        //    //        msgBox.ShowMessage("Please Select Country First !!!", "Information", UserControls.MessageBox.MessageStyle.Critical);
        //    //    }
        //    //    else
        //    //    {
        //    //        DDL_City.DataTextField = "name";
        //    //        DDL_City.DataValueField = "id";
        //    //        DataSet ds = ViewState["DatasetAll"] as DataSet;

        //    //        DataView dv = new DataView(ds.Tables["City"]);
        //    //        dv.RowFilter = "sid = " + p;
        //    //        DDL_City.DataSource = dv.ToTable();
        //    //        DDL_City.DataBind();
        //    //        DDL_City.Items.Insert(0, new ListItem(" Select ", "0"));
        //    //    }
        //    //}
        //    //catch (Exception exp)
        //    //{
        //    //    GeneralErr(exp.Message.ToString());
        //    //}
        //    Bind_ddlCity();
        //}

        //#endregion

        // Update College Information

        #region UpdateCollegeData

        protected void BtnUpdate_Click(object sender, EventArgs e)
        {
            BL_SuperAdmin  objBL  = new BL_SuperAdmin();
            EWA_SuperAdmin objEWA = new EWA_SuperAdmin();

            try
            {
                string[] confirmValue = Request.Form["confirm_value"].Split(',');
                if (confirmValue[confirmValue.Length - 1] == "Yes")
                {
                    objEWA.Action         = "Update";
                    objEWA.orgID          = Convert.ToInt32(TxtOrgID.Text);
                    objEWA.OrgCode        = TxtOrgCode.Text;
                    objEWA.TrustName      = TxtTrustName.Text;
                    objEWA.OrgName        = TxtOrgName.Text;
                    objEWA.OrgLabel       = TxtOrgLabel.Text;
                    objEWA.PhoneNo        = TxtPhoneNo.Text;
                    objEWA.FaxNo          = TxtFax.Text;
                    objEWA.Website        = Txtwebsite.Text;
                    objEWA.Email          = TxtEmail.Text;
                    objEWA.Address        = TxtAddress.Text;
                    objEWA.Country        = ddlcountry.SelectedItem.Text;
                    objEWA.State          = ddlstate.SelectedItem.Text;
                    objEWA.City           = ddlcity.SelectedItem.Text;
                    objEWA.Pincode        = Convert.ToInt32(TxtPincode.Text);
                    objEWA.UniversityCode = TxtUniversityCode.Text;
                    objEWA.MSBTECode      = TxtMSBTEcode.Text;
                    objEWA.AICTECode      = TxtAICTECode.Text;
                    objEWA.DTECode        = TxtDTEcode.Text;

                    // Code for store Logo Image

                    int    length            = 0;
                    byte[] imgLogobyte       = null;
                    byte[] imgLetterHeadbyte = null;

                    if (FileLogoImage.HasFile)
                    {
                        length            = FileLogoImage.PostedFile.ContentLength;
                        imgLogobyte       = new byte[length];
                        ViewState["Logo"] = imgLogobyte;
                        HttpPostedFile img1 = FileLogoImage.PostedFile;
                        img1.InputStream.Read(imgLogobyte, 0, length);
                    }
                    objEWA.LogoImage = (byte[])ViewState["Logo"];

                    if (FileLetterHeadImage.HasFile)
                    {
                        length                  = FileLetterHeadImage.PostedFile.ContentLength;
                        imgLetterHeadbyte       = new byte[length];
                        ViewState["LetterHead"] = imgLetterHeadbyte;
                        HttpPostedFile img1 = FileLetterHeadImage.PostedFile;
                        img1.InputStream.Read(imgLetterHeadbyte, 0, length);
                    }
                    objEWA.LetterHeadImage = (byte[])ViewState["LetterHead"];
                    objEWA.OrgUniversity   = DDL_University.SelectedValue;
                    objBL.Update_College_Data(objEWA);
                }
            }

            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
                msgBox.ShowMessage("College Updation Failed.. !!!", "Information", UserControls.MessageBox.MessageStyle.Critical);
            }
            finally
            {
                msgBox.ShowMessage("College Data Updated Successfully !!!", "Information", UserControls.MessageBox.MessageStyle.Successfull);
            }
        }
Exemple #9
0
        static void Main(string[] args)
        {
            IBL_Admin      bla        = new BL_Admin(new DAL_Linea(), new DAL_Parada(), new DAL_Salida(), new DAL_Vehiculo(), new DAL_Conductor(), new DAL_Tramo(), new DAL_Precio(), new DAL_Viaje());
            IBL_Usuario    blu        = new BL_Usuario(new DAL_Persona(), new DAL_Usuario(), new DAL_Linea(), new DAL_Salida(), new DAL_Tramo(), new DAL_Viaje(), new DAL_Pasaje(), new DAL_Parametro(), new DAL_Parada(), new DAL_Llegada(), new DAL_Vehiculo());
            IBL_Invitado   bli        = new BL_Invitado(new DAL_Persona(), new DAL_Usuario());
            IBL_General    blg        = new BL_General(new DAL_Viaje(), new DAL_Llegada(), new DAL_Salida(), new DAL_Linea(), new DAL_Tramo(), new DAL_Parada(), new DAL_Pasaje(), new DAL_Usuario(), new DAL_Vehiculo(), new DAL_Persona(), new DAL_Admin(), new DAL_Conductor(), new DAL_SuperAdmin());
            IBL_Conductor  iConductor = new BL_Conductor(new DAL_Viaje(), new DAL_Pasaje(), new DAL_Llegada(), new DAL_Tramo(), new DAL_Salida(), new DAL_Linea());
            IBL_SuperAdmin bls        = new BL_SuperAdmin(new DAL_Persona(), new DAL_Usuario(), new DAL_Admin(), new DAL_Conductor(), new DAL_Llegada(), new DAL_Parada(), new DAL_Salida(), new DAL_Vehiculo(), new DAL_Viaje());

            // ----------------- Testeado -------------------
            //EUsuario eu = bli.registrarse("55615808", "*****@*****.**", "1234", 1, "Carlos", "Mauro","Gonzalez","Perez");//testeado
            //EPersona ep = bls.asignarRol(1,Rol.Conductor);//testeada
            //bla.gestionConductores(1,new DateTime(2021,10,10));//testeada
            //EParada pa = bla.crearParada("Parada2", -34.333432, -56.324321);//testeado
            //ELinea el = bla.crearLinea("B");//testeado
            //EVehiculo ev = bla.crearVehiculos( "Mercedez-benz", "we3", "ABC1234", 42);//testeado
            //EVehiculo eve = bla.editarVehiculos("Mercedez-benz", "ert", "ABC1234", 42);//testeado
            //ESalida es = bla.crearSalida(1, "ABC1234", 1, new TimeSpan(8, 30, 00)); //testeada

            /*
             * List<Dias> dias = new List<Dias>();
             * dias.Add(Dias.Lunes);
             * Console.WriteLine(dias.First());
             * List<EViaje> viajes = bla.crearViajes(new DateTime(2020,10,2), new DateTime(2020, 10, 30), dias, 1); //testeado
             */
            //ETramo et = bla.crearTramos(1,1,1000,15,new DateTime(2019,04,04));//testeada
            //ELlegada ell = blg.CrearLlegada(2, 2, new TimeSpan(03, 03, 03));//Testeada

            //blc.iniciarViaje(1, new TimeSpan(20,0,0)); //testeado
            //blg.finalizarViaje(1);//testeado

            /*
             * List<DTOubicacion> lstdto = bls.ubicarVehiculo();
             * foreach (var l in lstdto)
             * {
             *  Console.WriteLine(l.hora + " " + l.lat +" "+ l.lon +" "+ l.matricula);//testeado
             * }*/

            // EPasaje ep = blu.comprarPasaje(1, 2, 1, 2, "null", "null", 2); //testeado

            EPasaje ep = blu.comprarPasaje(1, 2, 2, 5, "CI", "43338737", 18); //testeado

            //Console.WriteLine(blc.verificarPasaje(1, 1));//testeado
            //List<DTOproxVehiculo>  pv = blu.proximoVehiculo(2, 3);//testeado

            /*List<EPasaje> pasajes = blg.reposrtesPasajes(new DateTime(2020,12,01), new DateTime(2020,12,04),1,-1,-1); //testeado
             * foreach (var pasaje in pasajes)
             * {
             *  Console.WriteLine(pasaje.IdPasaje);
             * }*/
            /*List<EUsuario> usuarios =  blg.notificacionProximidad(1, 1);
             * foreach (var usuario in usuarios)
             * {
             *  Console.WriteLine(usuario.Id);
             * }*/

            //Console.WriteLine(blg.reporteUtilidad(1, new DateTime(2020,12,01),new DateTime(2020,12,04), -1, -1));//testeado


            // ----------------- Falta testear -------------------

            //foreach (var item in blu.GetFechasViajes(1))
            //{
            //  Console.WriteLine(item.IdSalida);

            // }

            //blu.canSelectSeat(1, 1, 2);

            /*
             * foreach (var item in blu.sinTerminales())
             * {
             *  Console.WriteLine(item.IdParada);
             * }*/
            //Console.WriteLine(blg.CrearLlegada(2,new TimeSpan(10,22,00), new DateTime(2020 , 12 , 03)));



            Console.WriteLine("\nPrecione Enter  para finalizar.");
            Console.Read();
        }