Beispiel #1
0
        public SubuserBLL.SubuserEntity  AuthenticateSubuser2(DBSite site, string email_id, string password)
        {
            SubuserBLL.SubuserEntity sub_user = null;

            string qry = "SELECT "
                         + " SubuserID "
                         + ", SubUserName "
                         + ", EmailId "
                         + ", Active "
                         + ", UserId "
                         + " FROM tblSubuser ";

            qry += " WHERE EmailId='" + email_id + "'"
                   + " AND SubuserPassword='******'";

            DataTable dt = site.ExecuteSelect(qry);

            if (dt.Rows.Count > 0)
            {
                DataRow row = dt.Rows[0];

                sub_user = new SubuserBLL.SubuserEntity();

                sub_user.SubuserId   = util.CheckNullInt(row["SubuserID"]);
                sub_user.SubuserName = util.CheckNull(row["SubUserName"]);
                sub_user.EmailId     = util.CheckNull(row["EmailID"]);
                sub_user.UserState   = util.CheckNull(row["Active"]);
                sub_user.UserId      = util.CheckNullInt(row["UserId"]);
            }

            return(sub_user);
        }
Beispiel #2
0
        //----------  Get subusers of user -------------------

        public List <SubuserBLL.SubuserEntity> GetSubusers(DBSite site, string user_id)
        {
            List <SubuserBLL.SubuserEntity> subuser_list = new List <SubuserBLL.SubuserEntity>();

            SubuserBLL.SubuserEntity subuser = null;

            string qry = " SELECT "
                         + "SubuserId"
                         + ", SubuserName"
                         + ", SubuserCreationDate"
                         + ", SubuserPassword"
                         + ", EmailId"
                         + ", Active"
                         + ", Designation"
                         + ", Address"
                         + ", City"
                         + ", Mobile"
                         + " FROM tblSubuser"
                         + " WHERE UserId=" + user_id;

            DataTable subuser_table = site.ExecuteSelect(qry);

            foreach (DataRow row in subuser_table.Rows)
            {
                subuser = new SubuserBLL.SubuserEntity();

                subuser.SubuserId    = util.CheckNullInt(row["SubuserId"]);
                subuser.SubuserName  = util.CheckNull(row["SubuserName"]);
                subuser.CreationDate = Convert.ToDateTime(row["SubuserCreationDate"]).ToShortDateString();
                subuser.Password     = util.CheckNull(row["SubuserPassword"]);
                subuser.EmailId      = util.CheckNull(row["EmailId"]);
                subuser.UserState    = util.CheckNull(row["Active"]);
                subuser.Designation  = util.CheckNull(row["Designation"]);
                subuser.Address      = util.CheckNull(row["Address"]);
                subuser.City         = util.CheckNull(row["City"]);
                subuser.Mobile       = util.CheckNull(row["Mobile"]);

                subuser_list.Add(subuser);
            }

            return(subuser_list);
        }