示例#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;
        }
        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();
            }
        }
示例#3
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);
                }
            }
        }