Beispiel #1
0
        protected void btnsearch_Click1(object sender, EventArgs e)
        {
            AgentBAL     agntBal  = new AgentBAL();
            List <Agent> lstAgent = new List <Agent>();
            int          LocId    = basePage.LoggedInUser.UserLocation.LocationId;
            int          userId   = basePage.LoggedInUser.UserTypeId;

            if (userId == Convert.ToInt32(UserType.Admin))
            {
                LocId    = 0;
                lstAgent = agntBal.ReadUsers(txtname.Text, LocId, 0);
            }
            else
            {
                lstAgent = agntBal.ReadUsers(txtname.Text, LocId, basePage.LoggedInUser.AgentId);
            }

            if (lstAgent.Count > 0)
            {
                LstAgent.DataSource     = lstAgent;
                LstAgent.DataTextField  = "AgentName";
                LstAgent.DataValueField = "AgentId";
                LstAgent.DataBind();
                System.Threading.Thread.Sleep(1000);
                //this.LstAgent.MouseDoubleClick += new MouseEventHandler(LstAgent_MouseDoubleClick);
            }
            else
            {
                Response.Write("<script type=\"text/javascript\">alert('Record Not Found');</script>");
            }
        }
Beispiel #2
0
        private bool ValidateAgent()
        {
            AgentBAL agentBal = new AgentBAL();

            if (agentBal.ValidateAgent(LoginUser.UserName, LoginUser.Password) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #3
0
 public string AgentList()
 {
     try
     {
         AgentBAL oAgentBAL = new AgentBAL();
         DataTable dt = new DataTable();
         dt = oAgentBAL.SelectAgent();
         JSONClass objJSONClass = new JSONClass();
         return objJSONClass.CreateJSONParameters(dt);
     }
     catch
     {
         throw;
     }
 }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //Session.Remove("ConsignmentDetails");
         //Session.Remove("NewMailRemarks");
         //Session.Remove("consignmentEditpax");
         //Session.Remove("pax");
         //Session.Remove("paxAdditional");
         //Session.Remove("VisaTypeOneId");
         //Session.Remove("CurrentTable");
         //Session.Remove("CurrentTable");
         //Session.Remove("lstBillItem");
         //Session.Remove("lstBillItemm");
         //Session.Remove("lstBillItems");
         //Session.Remove("billIdds");
         //Session.Remove("billitem");
         //Session.Remove("tempdata");
         //Session.Remove("Type");
         //Session.Remove("version");
         Session.RemoveAll();
         AgentBAL     agntBal  = new AgentBAL();
         List <Agent> lstAgent = new List <Agent>();
         int          LocId    = basePage.LoggedInUser.UserLocation.LocationId;
         int          userId   = basePage.LoggedInUser.UserTypeId;
         if (userId == Convert.ToInt32(UserType.Admin))
         {
             LocId    = 0;
             lstAgent = agntBal.ReadUsers("", LocId, 0);
         }
         else
         {
             lstAgent = agntBal.ReadUsers("", LocId, basePage.LoggedInUser.AgentId);
         }
         LstAgent.DataSource     = lstAgent;
         LstAgent.DataTextField  = "AgentName";
         LstAgent.DataValueField = "AgentId";
         LstAgent.DataBind();
     }
 }