protected void InsertUsers()
        {
            Usertbl ut = new Usertbl();

            ut.RoleID      = Convert.ToInt32(ddlRole.SelectedValue);
            ut.LoginUserId = Convert.ToInt32(ddlName.SelectedValue);
            ut.Username    = txtUserName.Text;
            ut.Password    = txtPassword.Text;
            ut.Status      = 1;
            ut.CreatedBy   = 1;
            ut.CreatedDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            List <Usertbl> lst = new List <Usertbl>();

            lst = objUserBL.GetAgentExists(ut).ToList();
            if (Convert.ToInt32(lst.Count()) <= 0)
            {
                lst = objUserBL.GetUserExists(ut).ToList();
                if (Convert.ToInt32(lst.Count()) <= 0)
                {
                    lst = objUserBL.InsertUsers(ut).ToList();
                    ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('Data Inserted Successfully');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('Username Already Taken');", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('Username for this agent already exists');", true);
            }
            btnSave.Visible = true;
            GetUser();
        }
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            Usertbl us = new Usertbl();

            us.Username = txtUsername.Text;
            us.Password = txtPassword.Text;
            us.Email    = txtEmailID.Text;
            List <Usertbl> lust = new List <Usertbl>();

            lust = objLoBL.GetUserExists(us).ToList();
            Reset();
            if (lust.Count() >= 1)
            {
                Session["Username"] = us.Username;
                Session["Password"] = us.Password;
                Response.Redirect("MainDashboard.aspx");
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('Invalid Credentials');", true);
            }
            //List<Usertbl> ust = new List<Usertbl>();
            //ust = objLoBL.GetAllUsers(us).ToList();
            //ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('Data Inserted Successfully');", true);
            //btnSave.Visible = true;
        }
        protected void GetUser()
        {
            Usertbl        ut  = new Usertbl();
            List <Usertbl> lst = new List <Usertbl>();

            lst = objUserBL.GetAllUser(ut).ToList();
            gdvUsers.DataSource = lst;
            gdvUsers.DataBind();
            btnUpdate.Visible = false;
        }
Example #4
0
        protected void InsertUser()
        {
            Usertbl us = new Usertbl();

            us.LoginUserId = Convert.ToInt32(hdnAgentID.Value);
            us.RoleID      = 1;
            us.Username    = lblAEmail.Text;
            us.Password    = System.Web.Security.Membership.GeneratePassword(6, 1);
            us.Status      = 1;
            us.IsActive    = 1;
            us.CreatedBy   = 1;
            us.CreatedDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            List <Usertbl> lstus = new List <Usertbl>();

            lstus = objuserBL.InsertUsers(us).ToList();
        }
        protected void lbtnLMarkAsActive_Click(object sender, EventArgs e)
        {
            LinkButton  lbtn = (LinkButton)sender;
            GridViewRow gvr  = (GridViewRow)lbtn.NamingContainer;
            var         val  = gvr.DataItemIndex;
            var         id   = gvr.Cells[5].Text;
            Usertbl     ct   = new Usertbl();

            ct.UserID = Convert.ToInt32(gvr.Cells[0].Text);
            if (gvr.Cells[5].Text == "Active")
            {
                ct.Status = 0;
            }
            else if (gvr.Cells[5].Text == "InActive")
            {
                ct.Status = 1;
            }
            objUserBL.UpdateUsresStatus(ct);
            GetUser();
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            Usertbl ct = new Usertbl();

            ct.UserID      = Convert.ToInt32(hdnUsersId.Value);
            ct.RoleID      = Convert.ToInt32(ddlRole.SelectedValue);
            ct.LoginUserId = Convert.ToInt32(ddlName.SelectedValue);
            ct.Username    = txtUserName.Text;
            ct.Password    = txtPassword.Text;
            ct.Status      = Convert.ToInt32(hdnStatus.Value);
            ct.UpdatedBy   = 1;
            ct.UpdatedDate = DateTime.Now.ToString();
            List <Usertbl> lst = new List <Usertbl>();

            lst = objUserBL.UpdateUsers(ct).ToList();
            ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('User Updated Successfully');", true);
            Reset();
            GetUser();
            btnUpdate.Visible = false;
            btnSave.Visible   = true;
        }
        protected void GetUserbyID(int id)
        {
            Usertbl ut = new Usertbl();

            ut.UserID = id;
            List <Usertbl> lst = new List <Usertbl>();

            lst = objUserBL.GetUsersbyId(ut).ToList();
            RoleBL objRoleBL = new RoleBL();

            foreach (var el in lst)
            {
                hdnUsersId.Value = el.UserID.ToString();
                txtUserName.Text = el.Username;
                txtPassword.Text = el.Password;
                txtPassword.Attributes["value"] = txtPassword.Text;
                ddlRole.SelectedValue           = el.RoleID.ToString();
                GetName(ddlRole.SelectedValue);
                ddlName.SelectedValue = el.LoginUserId.ToString();
                hdnStatus.Value       = el.Status.ToString();
            }
            btnSave.Visible   = false;
            btnUpdate.Visible = true;
        }
Example #8
0
 public IEnumerable <Usertbl> GetUserExists(Usertbl ut)
 {
     return(objUserDA.UsersAll(11, ut));
 }
Example #9
0
 public IEnumerable <Usertbl> GetAgentExists(Usertbl ut)
 {
     return(objUserDA.UsersAll(13, ut));
 }
Example #10
0
 public IEnumerable <Usertbl> GetUsresByRoleId(Usertbl ut)
 {
     return(objUserDA.UsersAll(8, ut));
 }
Example #11
0
 public IEnumerable <Usertbl> GetUsresWithColumns(Usertbl ut)
 {
     return(objUserDA.UsersAll(9, ut));
 }
Example #12
0
 public IEnumerable <Usertbl> DeleteUsres(Usertbl ut)
 {
     return(objUserDA.UsersAll(5, ut));
 }
Example #13
0
 //public IEnumerable<Usertbl> UpdateUsresIsActive(Usertbl ut)
 //{
 //    return objUserDA.UsersAll(6, ut);
 //}
 public IEnumerable <Usertbl> UpdateUsresStatus(Usertbl ut)
 {
     return(objUserDA.UsersAll(7, ut));
 }
        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();
            }
        }
Example #15
0
 public IEnumerable <Usertbl> GetAllUsers(Usertbl ls)
 {
     return(objDA.UsersAll(1, ls));
 }
Example #16
0
 public IEnumerable <Usertbl> GetUsersbyId(Usertbl ut)
 {
     return(objUserDA.UsersAll(2, ut));
 }
Example #17
0
 public IEnumerable <Usertbl> GetAllUser(Usertbl ut)
 {
     return(objUserDA.UsersAll(1, ut));
 }
Example #18
0
 public IEnumerable <Usertbl> GetUserExists(Usertbl ls)
 {
     return(objDA.UsersAll(4, ls));
 }
Example #19
0
 public IEnumerable <Usertbl> GetUserByStatus(Usertbl ls)
 {
     return(objDA.UsersAll(3, ls));
 }
Example #20
0
 public IEnumerable <Usertbl> GetUserById(Usertbl ls)
 {
     return(objDA.UsersAll(2, ls));
 }
Example #21
0
 public IEnumerable <Usertbl> InsertUsers(Usertbl ut)
 {
     return(objUserDA.UsersAll(3, ut));
 }
Example #22
0
 public IEnumerable <Usertbl> UpdateUsers(Usertbl ut)
 {
     return(objUserDA.UsersAll(4, ut));
 }