Ejemplo n.º 1
0
        protected void GetCitybyID(int id)
        {
            Citytbl ct = new Citytbl();

            ct.CityID = id;
            List <Citytbl> lst = new List <Citytbl>();

            lst = objCityBl.GetCitybyId(ct).ToList();
            StateBL objstatebl = new StateBL();

            foreach (var el in lst)
            {
                hdnCityID.Value = el.CityID.ToString();
                txtCity.Text    = el.CityName;

                Statetbl st = new Statetbl();
                st.StateID = el.StateID;
                List <Statetbl> lstst = new List <Statetbl>();
                lstst = objstatebl.GetStateById(st).ToList();
                ddlCountry.SelectedValue = lstst[0].CountryID.ToString();
                GetState(lstst[0].CountryID);
                ddlState.SelectedValue = el.StateID.ToString();
            }
            btnSave.Visible   = false;
            btnUpdate.Visible = true;
        }
Ejemplo n.º 2
0
        protected void GetState()
        {
            Statetbl        ls  = new Statetbl();
            List <Statetbl> lst = new List <Statetbl>();

            lst = objStateBL.GetAllState(ls).ToList();
            gdvState.DataSource = lst;
            gdvState.DataBind();
            btnUpdate.Visible = false;
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Statetbl st = new Statetbl();

            lstState = objStateBL.GetAllState(st).ToList();
            if (!IsPostBack)
            {
                GetCountry();
                GetCity();
            }
        }
Ejemplo n.º 4
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            Statetbl st = new Statetbl();

            st.StateID     = Convert.ToInt32(hdnStateID.Value);
            st.StateName   = txtState.Text;
            st.CountryID   = Convert.ToInt32(DDlCountry.SelectedValue);
            st.IsActive    = 1;
            st.UpdatedBy   = 1;
            st.UpdatedDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            List <Statetbl> lst = new List <Statetbl>();

            lst = objStateBL.UpdateState(st).ToList();
            ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('State Updated Successfully');", true);
            Reset();

            btnUpdate.Visible = false;
            btnSave.Visible   = true;
            GetState();
        }
Ejemplo n.º 5
0
        protected void lbtnActive_Click(object sender, EventArgs e)
        {
            LinkButton  lbtn   = (LinkButton)sender;
            GridViewRow gvr    = (GridViewRow)lbtn.NamingContainer;
            var         val    = gvr.DataItemIndex;
            var         status = gvr.Cells[3].Text;
            Statetbl    st     = new Statetbl();

            st.StateID = Convert.ToInt32(gvr.Cells[0].Text);
            if (status == "Active")
            {
                st.IsActive = 0;
            }
            else if (status == "InActive")
            {
                st.IsActive = 1;
            }
            objStateBL.UpdateStateIsActive(st);
            GetState();
        }
Ejemplo n.º 6
0
        protected void insertState()
        {
            Statetbl st = new Statetbl();

            st.StateName   = txtState.Text;
            st.CountryID   = Convert.ToInt32(DDlCountry.SelectedValue);
            st.IsActive    = 1;
            st.CreatedBy   = 1;
            st.CreatedDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            st.UpdatedBy   = 1;
            st.UpdatedDate = DateTime.Now.ToString();

            List <Statetbl> lst = new List <Statetbl>();

            lst = objStateBL.SaveState(st).ToList();
            if (lst[0].Message == "Success")
            {
                //ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('State Saved Successfully');", true);
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('State Saved Successfully');", true);
                //Response.Redirect("state.aspx");
            }
            Clear();
            GetState();
        }
Ejemplo n.º 7
0
        protected void GetState(int CountryID)
        {
            ddlState.Items.Clear();
            List <Statetbl> lststate = new List <Statetbl>();
            Statetbl        ste      = new Statetbl();

            ste.CountryID = CountryID;
            StateBL objstatebl = new StateBL();

            ste.IsActive = 1;
            lstState     = objStateBL.GetStateByCountryIdIsActive(ste).ToList();
            ListItem l = new ListItem();

            l.Text  = "--Select--";
            l.Value = 0.ToString();
            ddlState.Items.Add(l);
            foreach (var st in lstState)
            {
                ListItem li = new ListItem();
                li.Text  = st.StateName;
                li.Value = st.StateID.ToString();
                ddlState.Items.Add(li);
            }
        }
Ejemplo n.º 8
0
        protected void lbtnEdit_Click(object sender, EventArgs e)
        {
            LinkButton  lbtn = (LinkButton)sender;
            GridViewRow gvr  = (GridViewRow)lbtn.NamingContainer;
            var         val  = gvr.DataItemIndex;
            var         id   = Convert.ToInt32(gvr.Cells[0].Text);

            Statetbl st = new Statetbl();

            st.StateID = id;
            List <Statetbl> lst = new List <Statetbl>();

            lst = objStateBL.GetStateById(st).ToList();

            foreach (var el in lst)
            {
                hdnStateID.Value         = el.StateID.ToString();
                DDlCountry.SelectedValue = el.CountryID.ToString();
                txtState.Text            = el.StateName;
            }
            btnSave.Visible   = false;
            btnUpdate.Visible = true;
            //GetState();
        }
Ejemplo n.º 9
0
 public IEnumerable <Statetbl> GetStateByCountryIdIsActive(Statetbl st)
 {
     return(objStateDA.StateAll(11, st));
 }
Ejemplo n.º 10
0
 public IEnumerable <Statetbl> SaveState(Statetbl st)
 {
     return(objStateDA.StateAll(3, st));
 }
Ejemplo n.º 11
0
 public IEnumerable <Statetbl> UpdateState(Statetbl st)
 {
     return(objStateDA.StateAll(4, st));
 }
Ejemplo n.º 12
0
 public IEnumerable <Statetbl> DeleteState(Statetbl st)
 {
     return(objStateDA.StateAll(5, st));
 }
Ejemplo n.º 13
0
 public IEnumerable <Statetbl> UpdateStateIsActive(Statetbl st)
 {
     return(objStateDA.StateAll(6, st));
 }
Ejemplo n.º 14
0
 public IEnumerable <Statetbl> GetStateById(Statetbl st)
 {
     return(objStateDA.StateAll(2, st));
 }
Ejemplo n.º 15
0
        protected void GetAgencyById(int AgencyID)
        {
            Agentstbl agt = new Agentstbl
            {
                AgentID = AgencyID
            };

            List <Agentstbl> lstAgency = new List <Agentstbl>();

            lstAgency = objRegBL.GetAgentById(agt).ToList();

            foreach (var el in lstAgency)
            {
                hdnAgentID.Value   = el.AgentID.ToString();
                lblAgencyName.Text = el.AgencyName;
                lblAEmail.Text     = el.AgencyEmail;
                lblTN.Text         = el.MobileNo;

                if (el.CategoryId == 0)
                {
                    lblCategory1.Text = "B2B";
                }
                else if (el.CategoryId == 1)
                {
                    lblCategory1.Text = "B2C";
                }
                else if (el.CategoryId == 2)
                {
                    lblCategory1.Text = "Others";
                }

                if (el.IATAStatus == 1)
                {
                    lblIATAS.Text = "Yes";
                }
                else if (el.IATAStatus == 2)
                {
                    lblIATAS.Text = "No";
                }


                lblRN.Text       = el.IATARegNo;
                lblWeb.Text      = el.Website;
                lblFN.Text       = el.FirstName;
                lblLN.Text       = el.LastName;
                lblAddress1.Text = el.Address;

                Citytbl ct = new Citytbl();
                ct.CityID = el.CityId;
                var ctval = objCityBL.GetCitybyId(ct);
                lblCt.Text = ctval.Count() <= 0?"": ctval.First().CityName;

                Statetbl st = new Statetbl();
                st.StateID = el.StateID;
                var sval = objStateBL.GetStateById(st);
                lblSt.Text = sval.Count() <= 0 ? "" : sval.First().StateName;

                Countrytbl cn = new Countrytbl();
                cn.CountryID = Convert.ToInt32(el.CountryId);
                var cval = objCountryBL.GetCountryById(cn);
                lblCntry.Text = cval.First().CountryName;

                lblPCode.Text          = el.Pincode.ToString();
                lblPCurrency1.Text     = el.PreferredCurrency;
                lblRBy.Text            = el.ReferredBy;
                lblAcName.Text         = el.AccountsName;
                lblAcEmail.Text        = el.AccountsEmail;
                lblAcPhoneNumber.Text  = el.AccountsMobileNo;
                lblmnName2.Text        = el.ManagementsName;
                lblmnEmail2.Text       = el.ManagementsEmail;
                lblmnPhoneNumber2.Text = el.ManagementsMobileNo;
                lblopName1.Text        = el.OperationsName;
                lblopEmail1.Text       = el.OperationsEmail;
                lblopPhoneNumber1.Text = el.OperationsMobileNo;


                List <Employeetbl> lstEmployee = new List <Employeetbl>();
                Employeetbl        Emply       = new Employeetbl();
                EmployeeBL         objemplyBL  = new EmployeeBL();
                Emply.IsActive = 1;
                lstEmployee    = objemplyBL.GetEmployeeByStatus(Emply).ToList();
                foreach (var cnt in lstEmployee)
                {
                    ListItem li = new ListItem();
                    li.Text  = cnt.FirstName + " " + cnt.LastName;
                    li.Value = cnt.EmpId.ToString();
                    ddlEmployee.Items.Add(li);
                }
            }
        }
Ejemplo n.º 16
0
 public IEnumerable <Statetbl> GetStateByStateIdIsActive(Statetbl st)
 {
     return(objStateDA.StateAll(10, st));
 }
Ejemplo n.º 17
0
 public IEnumerable <Statetbl> GetStateWithCountry(Statetbl st)
 {
     return(objStateDA.StateAll(9, st));
 }
Ejemplo n.º 18
0
 public IEnumerable <Statetbl> GetStateByCountryID(Statetbl st)
 {
     return(objStateDA.StateAll(8, st));
 }
Ejemplo n.º 19
0
        protected void GetAgentsById(int AgentsID)
        {
            Agentstbl at = new Agentstbl
            {
                AgentID = AgentsID
            };

            List <Agentstbl> lstAgents = new List <Agentstbl>();

            lstAgents = objagBL.GetAgentById(at).ToList();


            foreach (var el in lstAgents)
            {
                if (el.CategoryId == 0)
                {
                    lblCN.Text = "B2B";
                }
                else if (el.CategoryId == 1)
                {
                    lblCN.Text = "B2C";
                }
                else if (el.CategoryId == 2)
                {
                    lblCN.Text = "Others";
                }

                lblWeb.Text = el.Website;
                lblAdd.Text = el.Address;

                Citytbl ct = new Citytbl();
                ct.CityID = el.CityId;
                var ctval = objCityBL.GetCitybyId(ct);
                lblCt.Text = ctval.Count() <= 0 ? "":ctval.First().CityName;

                Statetbl st = new Statetbl();
                st.StateID = el.StateID;
                var sval = objSBl.GetStateById(st);
                lblSt.Text = sval.Count() <= 0 ? "" : sval.First().StateName;

                Countrytbl cn = new Countrytbl();
                cn.CountryID = Convert.ToInt32(el.CountryId);
                var cval = objCountryBL.GetCountryById(cn);
                lblCntry.Text = cval.Count() <= 0 ? "" : cval.First().CountryName;

                Employeetbl emp = new Employeetbl();
                emp.EmpId = Convert.ToInt32(el.MfbStaff);
                var eval = empBL.GetEmployeeById(emp);
                lblEname.Text = eval.Count() <= 0 ? "" : eval.First().FirstName + " " + eval.First().LastName;

                Usertbl ut = new Usertbl();
                ut.LoginUserId = el.AgentID;
                var utval = objUBl.GetAgentExists(ut);
                lblUName.Text = utval.Count() <= 0 ?"": utval.First().Username;
                lblPWord.Text = utval.Count() <= 0 ? "" : utval.First().Password;

                if (el.IATAStatus == 1)
                {
                    lblIATAS.Text = "Yes";
                }
                else if (el.IATAStatus == 2)
                {
                    lblIATAS.Text = "NO";
                }

                lblAgencyName.Text = el.AgencyName;
                lblFN.Text         = el.FirstName;
                lblLName.Text      = el.LastName;

                lblAdd.Text         = el.Address;
                lblRBy.Text         = el.ReferredBy;
                lblIATARNo.Text     = el.IATARegNo;
                lblAC.Text          = el.AgencyCode;
                lblAEmail.Text      = el.AgencyEmail;
                lblTN.Text          = el.MobileNo;
                lblPC.Text          = el.PreferredCurrency;
                lblPin.Text         = el.Pincode.ToString();
                txtCommission1.Text = el.Commission;

                lblACName.Text        = el.AccountsName;
                lblACEmail.Text       = el.AccountsEmail;
                lblACPhoneNumber.Text = el.AccountsMobileNo;
                lblOPName.Text        = el.OperationsName;
                lblOPEmail1.Text      = el.OperationsEmail;
                lblOPPhoneNumber.Text = el.OperationsMobileNo;
                lblMNName.Text        = el.ManagementsName;
                lblMNEmail.Text       = el.ManagementsEmail;
                lblMNPhoneNumber.Text = el.ManagementsMobileNo;
                hdnAgentID.Value      = el.AgentID.ToString();
            }
        }
Ejemplo n.º 20
0
 public IEnumerable <Statetbl> GetAllState(Statetbl st)
 {
     return(objStateDA.StateAll(1, st));
 }