Пример #1
0
        protected void OnSearch(object sender, EventArgs e)
        {
            string searchTerm = searchBox.Text.ToLower();

            if (searchTerm.Length >= 3)
            {
                if (ViewState["dirState"] == null)
                {
                    return;
                }

                DataTable dtable = ViewState["dirState"] as DataTable;

                DataTable dtableNew = dtable.Clone();

                foreach (DataRow row in dtable.Rows)
                {
                    if (row["first_name"].ToString().ToLower().Contains(searchTerm))
                    {
                        dtableNew.Rows.Add(row.ItemArray);
                    }
                }

                GridViewUser.DataSource = dtableNew;
                GridViewUser.DataBind();
            }
        }
Пример #2
0
 protected void ButtonAddUser_OnClick(object sender, EventArgs e)
 {
     Business.Users.AddUser(Convert.ToInt32(TextBoxUserNId.Text), TextBoxUserName.Text, TextBoxUserSurname.Text, TextBoxUserGender.Text, TextBoxUserNationality.Text,
                            TextBoxUserLanguage.Text, TextBoxUserProfession.Text, Convert.ToDateTime(TextBoxUserBirthday.Text), TextBoxUserPhone.Text, TextBoxUserEmail.Text, TextBoxUserPassword.Text);
     GridViewUser.DataSource = Business.Users.GetAllUsers();
     GridViewUser.DataBind();
 }
Пример #3
0
        protected void OnSorting(object sender, GridViewSortEventArgs e)
        {
            DataTable dtable = ViewState["dirState"] as DataTable;

            if (dtable.Rows.Count > 0)
            {
                if (Convert.ToString(ViewState["sortdr"]) == "Asc")
                {
                    dtable.DefaultView.Sort = e.SortExpression + " Desc";
                    ViewState["sortdr"]     = "Desc";

                    Session["SortedView"] = e.SortExpression + " Desc";
                }
                else
                {
                    dtable.DefaultView.Sort = e.SortExpression + " Asc";
                    ViewState["sortdr"]     = "Asc";

                    Session["SortedView"] = e.SortExpression + " Asc";
                }

                GridViewUser.DataSource = dtable;
                GridViewUser.DataBind();
            }
        }
Пример #4
0
    void FillGrid_User()
    {
        if ((string)Session["AdminSessionID"] != null)
        {
            string xCode = Session["AdminSessionID"].ToString();

            SqlDataAdapter GDA = new SqlDataAdapter(" " +

                                                    " select Code, PlannerName=PlannerName+'-'+(Select left(Name,1) from fp_ComboDetail where Code=p.PlannerRole ) " +
                                                    " ,UserID,Pwd,City,Mobile=Mobile1,Website, PlannerRole=(Select Name from fp_ComboDetail " +
                                                    " where Code=p.PlannerRole ), " +
                                                    " ReportTo=(select Name from fp_prospects where Code=p.ReportTo) from fp_Planner p  " +
                                                    "  ", Con);

            DataSet GDS = new DataSet();
            Con.Open();
            GDA.Fill(GDS);
            Con.Close();

            GridViewUser.DataSource = GDS;
            GridViewUser.DataBind();
        }
        else
        {
            Response.Redirect("SessionExpired.aspx");
        }
    }
Пример #5
0
        public void UpdateGridview()
        {
            //SqlConnection conn = new SqlConnection(@"data source = DESKTOP-6CQP77U; integrated security = true; database = PestUpdated");
            SqlConnection conn = new SqlConnection(@"data source = localhost\SQLEXPRESS; integrated security = true; database = pestupdate");
            SqlDataReader rdr  = null;


            try
            {
                conn.Open();

                SqlCommand cmd = new SqlCommand("Select * from Help WHERE idcustomer = '" + Session["id"] + "'", conn);
                // SqlCommand cmd = new SqlCommand("Select * from Help WHERE idcustomer = 1", conn);
                rdr = cmd.ExecuteReader();

                GridViewUser.DataSource = rdr;
                GridViewUser.DataBind();
            }
            catch (Exception ex)
            {
                swag.Text = ex.Message;
            }
            finally
            {
                conn.Close(); // SqlDataAdapter closes connection by itself; but can fail in case of errors.
            }
        }
Пример #6
0
        void PopulateGridview()
        {
            DataTable dtbl = new DataTable();

            using (SqlConnection sqlCon = new SqlConnection(connectionString))
            {
                sqlCon.Open();
                SqlDataAdapter sqlDa = new SqlDataAdapter("SELECT * FROM UserData ", sqlCon);
                sqlDa.Fill(dtbl);
                if (dtbl.Rows.Count > 0)
                {
                    GridViewUser.DataSource = dtbl;
                    GridViewUser.DataBind();
                }
                else
                {
                    dtbl.Rows.Add(dtbl.NewRow());
                    GridViewUser.DataSource = dtbl;
                    GridViewUser.DataBind();
                    GridViewUser.Rows[0].Cells.Clear();
                    GridViewUser.Rows[0].Cells.Add(new TableCell());
                    GridViewUser.Rows[0].Cells[0].ColumnSpan      = dtbl.Columns.Count;
                    GridViewUser.Rows[0].Cells[0].Text            = "No Data Found ..!";
                    GridViewUser.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center;
                }
            }
        }
Пример #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.UnobtrusiveValidationMode = System.Web.UI.UnobtrusiveValidationMode.None;

        string strSQLUser    = null;
        string strSQLMessage = null;

        strSQLUser = "******";
        connection = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + System.Web.HttpContext.Current.Server.MapPath("VanierFaces.accdb") + ";Persist Security Info=False;");
        connection.Open();
        cmd = new OleDbCommand(strSQLUser, connection);

        OleDbDataAdapter adpU = new OleDbDataAdapter(cmd);
        DataSet          ds   = new DataSet();

        adpU.Fill(ds);
        GridViewUser.DataSource = ds;
        GridViewUser.DataBind();

        strSQLMessage = "SELECT sender, message, date_sent FROM tblMessages WHERE receiver = 'ewq'";
        cmd           = new OleDbCommand(strSQLMessage, connection);
        OleDbDataAdapter adpM = new OleDbDataAdapter(cmd);
        DataSet          dsM  = new DataSet();

        adpM.Fill(dsM);
        GridViewMessage.DataSource = dsM;
        GridViewMessage.DataBind();

        username    = Session["username"].ToString();
        userProfile = Session["userProfile"].ToString();
    }
Пример #8
0
    // get the existing users from users table.
    // show the users details below save/update button.
    private void BindGridView()
    {
        try
        {
            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }

            // sql query to get the list of users
            SqlCommand     cmd = new SqlCommand("select id as \"User Id\",fname+' '+lname as Name, sex as Gender, dob as \"Date of Birth\",mobile as \"Mobile No\", email as \"Email Id\" from users order by id;", conn);
            SqlDataAdapter adp = new SqlDataAdapter(cmd);
            DataSet        ds  = new DataSet();

            adp.Fill(ds);
            GridViewUser.DataSource = ds;
            GridViewUser.DataBind();
            lbltotalcount.Text = GridViewUser.Rows.Count.ToString();
        }
        catch (SqlException ex)
        {
            throw ex;
        }
        finally
        {
            conn.Close();
        }
    }
Пример #9
0
        public void loadUserslist()
        {
            List <UsersModel> list = Logic.LoadUsers();

            GridViewUser.DataSource = list;
            GridViewUser.DataBind();

            if (list.Count != 0)
            {
                int totalRecords = list.Count();
                int pageSize     = 5;
                int totalPages   = totalRecords / pageSize;
                if (totalRecords % 5 > 0)
                {
                    totalPages += 1;
                }
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < totalPages; i++)
                {
                    int pageNo = i + 1;

                    sb.Append("<a style=\"color: #FFFFFF\" href=\"ViewUsers.aspx?StartIndex=" + pageSize * i + "\">" + pageNo.ToString() + "</a>&nbsp;");
                    int GridPagingNumber = pageSize * i;
                    Session["GridPagingNumber"] = GridPagingNumber;
                }
                Literal.Text            = "Page: " + sb.ToString();
                GridViewUser.DataSource = list.Skip(StartIndex).Take(5);
                GridViewUser.DataBind();
            }
            else
            {
                lblNoData.Text = "There are no Users.";
                Literal.Text   = " ";
            }
        }
Пример #10
0
        /// <summary>
        ///
        /// </summary>
        protected void GridViewUser_Sorting(object sender, GridViewSortEventArgs e)
        {
            //Specify the direction in which to sort a list of items as ascending
            SortDirection sortDirection = SortDirection.Ascending;
            string        sortField     = string.Empty;

            SortGridview((GridView)sender, e, out sortDirection, out sortField);

            string strSortDirection = sortDirection == SortDirection.Ascending ? "ASC" : "DESC";

            // Create connection to SQL Server
            using (SqlConnection con = new SqlConnection(CS))
            {
                //Create a DataAdapter, and then provide the name of the stored procedure.
                SqlDataAdapter da = new SqlDataAdapter("spSortGridViewByField", con);

                //Set the command type as StoredProcedure.
                da.SelectCommand.CommandType = CommandType.StoredProcedure;

                //Create and add a parameter to Parameters collection for the stored procedure.
                da.SelectCommand.Parameters.AddWithValue("@UserId", Convert.ToInt32(Session["UserId"]));
                da.SelectCommand.Parameters.AddWithValue("@SortExpression", e.SortExpression.ToString());
                da.SelectCommand.Parameters.AddWithValue("@SortDirection", strSortDirection);

                // Create a new DataSet to hold the records.
                DataSet DS = new DataSet();

                // Fill the DataSet with the rows that are returned.
                da.Fill(DS);

                // Set the data source for the GridView as the DataSet that holds the rows.
                GridViewUser.DataSource = DS;
                GridViewUser.DataBind();
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         GridViewUser.DataSource = bllUserInfo.GetAllList().Tables[0];
         GridViewUser.DataBind();
     }
 }
Пример #12
0
    protected void btnupdate_Click(object sender, EventArgs e) //update button
    {
        try
        {
            User_Mangement bl = new User_Mangement();
            Business       B  = new Business();
            b.User_Id       = txtuserid.Text.Trim();
            b.Name          = TextBoxName.Text.Trim();
            b.Department_Id = DDLdeptname.SelectedValue;
            b.EmailId       = txtemailid.Text.Trim();
            b.InstituteId   = DDLinstitutename.SelectedValue;
            if (txtDOB.Text != "01/01/0001" && txtDOB.Text != null && txtDOB.Text != "")
            {
                b.StudentDOB = Convert.ToDateTime(txtDOB.Text.Trim());
            }
            if (txtMobileNo.Text != "")
            {
                b.MobileNo = txtMobileNo.Text;
            }
            b.Sex = DropDownListsex.SelectedValue;
            //b.BankAccountNumber = txtaccno.Text;
            b.CreatedDate = DateTime.Now.ToString("yyyy-MM-dd");
            b.UpdatedBy   = Session["UserId"].ToString();
            string OldmailID      = Session["OldmailID"].ToString();
            int    isupdatemailid = 0;
            if (OldmailID != "")
            {
                if (OldmailID != b.emailId)
                {
                    isupdatemailid = 1;
                }
            }
            //if (b.Role_Id == 1)
            //{
            //    b.pubinchargedept = RadioButtonListDeparmentPubincharge.SelectedValue;
            //}
            // int retemail = bl.Updatestudentmailid(txtemailid.Text, b, isupdatemailid, OldmailID);
            //   b.Role_Name = DDLrolename.SelectedValue;
            int retVal = bl.UpdateStudentdetails(b); //Business layer
            ClientScript.RegisterStartupScript(Page.GetType(), "validation1", "<script language='javascript'>alert('User detail update successfully')</script>");
            //btninsert.Enabled = false;
            txtemailid.Enabled       = false;
            popupPanelBaCode.Visible = false;
            GridViewUser.DataBind();
            GridViewUser.Visible = false;
        }
        catch (Exception ex)
        {
            log.Error(ex.StackTrace);
            log.Error(ex.Message);

            log.Error("Error!!!!!!!!!!!!!!!! ");

            ClientScript.RegisterStartupScript(Page.GetType(), "validation1", "<script language='javascript'>alert('Error!!!!!!!!!!')</script>");
        }
    }
Пример #13
0
        private void binddata()
        {
            string  usertype = Session["usertype"].ToString();
            DataSet DS       = new DataSet();

            DS = UserBLL.Instance.getallusers(usertype);

            GridViewUser.DataSource = DS.Tables[0];
            GridViewUser.DataBind();
        }
Пример #14
0
        protected void OnResetSearch(object sender, EventArgs e)
        {
            if (ViewState["dirState"] == null)
            {
                return;
            }

            DataTable dtable = ViewState["dirState"] as DataTable;

            searchBox.Text = "";

            GridViewUser.DataSource = dtable;
            GridViewUser.DataBind();
        }
Пример #15
0
 protected void OnPageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     GridViewUser.PageIndex = e.NewPageIndex;
     if (Session["SortedView"] != null)
     {
         DataTable dtable = ViewState["dirState"] as DataTable;
         dtable.DefaultView.Sort = Session["SortedView"].ToString();
         GridViewUser.DataSource = dtable;
         GridViewUser.DataBind();
     }
     else
     {
         BindGridView();
     }
 }
Пример #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable panelPopup = new DataTable();

            panelPopup.Columns.Add("Input");
            panelPopup.Columns.Add("Name");
            panelPopup.Columns.Add("Output");

            createActionTable("User", panelPopup);
            GridViewUser.DataSource = panelPopup;
            GridViewUser.DataBind();

            panelPopup.Clear();
            createActionTable("Friend", panelPopup);
            GridViewFriends.DataSource = panelPopup;
            GridViewFriends.DataBind();

            panelPopup.Clear();
            createActionTable("Album", panelPopup);
            GridViewAlbum.DataSource = panelPopup;
            GridViewAlbum.DataBind();

            panelPopup.Clear();
            createActionTable("Photo", panelPopup);
            GridViewPhoto.DataSource = panelPopup;
            GridViewPhoto.DataBind();

            panelPopup.Clear();
            createActionTable("Post", panelPopup);
            GridViewPost.DataSource = panelPopup;
            GridViewPost.DataBind();

            panelPopup.Clear();
            createActionTable("Video", panelPopup);
            GridViewVideo.DataSource = panelPopup;
            GridViewVideo.DataBind();

            panelPopup.Clear();
            createActionTable("Like", panelPopup);
            GridViewLike.DataSource = panelPopup;
            GridViewLike.DataBind();

            panelPopup.Clear();
            createActionTable("Comment", panelPopup);
            GridViewComment.DataSource = panelPopup;
            GridViewComment.DataBind();
        }
Пример #17
0
    private void SearchSubmit()
    {
        logger.Info(HttpContext.Current.Request.Cookies["User_ID"].Value + " " + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString() + " " + System.Reflection.MethodBase.GetCurrentMethod().Name);

        try
        {
            string user_id     = (ddlSearchFirst_Name.SelectedIndex == 0 ? string.Empty : ddlSearchFirst_Name.SelectedItem.Value);
            string role        = (ddlSearchRole.SelectedIndex == 0 ? string.Empty : ddlSearchRole.SelectedItem.Value);
            string PositionKey = (ddlSearchPosition.SelectedIndex == 0 ? string.Empty : ddlSearchPosition.SelectedItem.Value);
            string region      = string.Empty;

            foreach (ListItem item in ddlSearchState.Items)
            {
                if (item.Selected && item.Text != "==ระบุ==")
                {
                    if (string.IsNullOrEmpty(region))
                    {
                        region = item.Text;
                    }
                    else
                    {
                        region = region + "," + item.Text;
                    }
                }
            }

            List <dbo_UserClass> dt = dbo_UserDataClass.Search(user_id, string.Empty, PositionKey, string.Empty, ddlSearchStatus.Text, "CP Meiji", role, string.Empty, null, string.Empty, region);

            if (dt.Count > 0)
            {
                GridViewUser.DataSource = dt;
                GridViewUser.DataBind();
                showPanel("pnlGrid");

                GridViewUser.Visible = true;
                pnlNoRec.Visible     = false;
            }
            else
            {
                GridViewUser.Visible = false;
                pnlNoRec.Visible     = true;
            }
        }
        catch (Exception)
        {
        }
    }
Пример #18
0
        protected void srcbtn_Click(object sender, EventArgs e)
        {
            con.Open();
            SqlCommand cmd   = new SqlCommand();
            string     query = "Select *from UserInfo where AccID like '%'+@AccNo+'%' ";

            cmd.CommandText = query;
            cmd.Connection  = con;
            cmd.Parameters.AddWithValue("@AccNo", SearchBox.Text);
            DataTable      dt  = new DataTable();
            SqlDataAdapter sda = new SqlDataAdapter(cmd);

            sda.Fill(dt);
            GridViewUser.DataSource = dt;
            GridViewUser.DataBind();
            con.Close();
        }
Пример #19
0
 private void LoadData()
 {
     using (SqlConnection sqlconn = new SqlConnection(conStr))
     {
         using (SqlCommand cmd = new SqlCommand())
         {
             sqlconn.Open();
             cmd.Connection  = sqlconn;
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.CommandText = "getAllUser";
             SqlDataAdapter da = new SqlDataAdapter(cmd);
             DataTable      dt = new DataTable();
             da.Fill(dt);
             GridViewUser.DataSource = dt;
             GridViewUser.DataBind();
         }
     }
 }
Пример #20
0
    protected void btnupdate_Click(object sender, EventArgs e) //update button
    {
        try
        {
            Business B = new Business();
            b.User_Id     = txtuserid.Text;
            b.Role_Id     = Convert.ToInt32(DDLrolename.SelectedValue);
            b.InstituteId = DDLinstitutename.SelectedValue;
            b.emailId     = txtemailid.Text;
            string OldmailID = Session["OldmailID"].ToString();
            b.CreatedBy = Session["UserId"].ToString();
            int isupdatemailid = 0;
            if (OldmailID != "")
            {
                if (OldmailID != b.emailId)
                {
                    isupdatemailid = 1;
                }
            }
            if (b.Role_Id == 1)
            {
                b.pubinchargedept = RadioButtonListDeparmentPubincharge.SelectedValue;
            }
            int retemail = B.Updatemailid(txtemailid.Text, b, isupdatemailid, OldmailID);
            //   b.Role_Name = DDLrolename.SelectedValue;
            int retVal = bl.Update(b); //Business layer
            ClientScript.RegisterStartupScript(Page.GetType(), "validation1", "<script language='javascript'>alert('User detail update successfully')</script>");
            //btninsert.Enabled = false;
            txtemailid.Enabled       = false;
            popupPanelBaCode.Visible = false;
            GridViewUser.DataBind();
            GridViewUser.Visible = false;
        }
        catch (Exception ex)
        {
            log.Error(ex.StackTrace);
            log.Error(ex.Message);

            log.Error("Error!!!!!!!!!!!!!!!! ");

            ClientScript.RegisterStartupScript(Page.GetType(), "validation1", "<script language='javascript'>alert('Error!!!!!!!!!!')</script>");
        }
    }
Пример #21
0
 //删除用户
 private void BtnDelete_Click(object sender, EventArgs e)
 {
     CJia.PIVAS.Views.DataManage.UserEventArgs userArgs = new Views.DataManage.UserEventArgs();
     if (GridViewUser.FocusedRowHandle >= 0)
     {
         if (CJia.PIVAS.Tools.Message.ShowQuery("确认是否删除", CJia.PIVAS.Tools.Message.Button.YesNo) == CJia.PIVAS.Tools.Message.Result.Yes)
         {
             userArgs.CreateBy = User.UserId;
             userArgs.UserId   = long.Parse(GridViewUser.GetFocusedDataRow()["USER_ID"].ToString());
             this.OnDeleteUser(null, userArgs);
             this.OnLoadData(null, null);
         }
         {
             return;
         }
     }
     else
     {
         CJia.PIVAS.Tools.Message.Show("请选择数据");
     }
 }
Пример #22
0
    public void btnSearchCancel_Click(object sender, System.EventArgs e)
    {
        logger.Info(HttpContext.Current.Request.Cookies["User_ID"].Value + " " + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString() + " " + System.Reflection.MethodBase.GetCurrentMethod().Name);

        SetUpDrowDownList();
        showPanel("pnlGrid");

        if (GridViewUser.Rows.Count > 0)
        {
            List <dbo_UserClass> dt = new List <dbo_UserClass>();
            GridViewUser.DataSource = dt;
            GridViewUser.DataBind();
        }


        GridViewUser.Visible = false;
        pnlNoRec.Visible     = false;

        System.Threading.Thread.Sleep(500);
        ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true);
    }
Пример #23
0
        protected void BindGridView()
        {
            connection = new MySqlConnection(connectionStr);
            connection.Open();

            queryStr = "SELECT * FROM user_info JOIN favourite_foods ON user_info.user_id = favourite_foods.user_id";

            command = new MySqlCommand(queryStr, connection);
            MySqlDataAdapter sqlAdapter = new MySqlDataAdapter(command);

            DataTable dtable = new DataTable();

            sqlAdapter.Fill(dtable);

            connection.Close();

            GridViewUser.DataSource = dtable;
            GridViewUser.DataBind();

            ViewState["dirState"] = dtable;
            ViewState["sortdr"]   = "Asc";
        }
Пример #24
0
        /// <summary>
        ///     Binding data from stored procedure to Grid View
        /// </summary>
        private void BindData()
        {
            try
            {
                // Create connection to SQL Server
                using (SqlConnection con = new SqlConnection(CS))
                {
                    // Create a DataAdapter, and then provide the name of the stored procedure.
                    SqlDataAdapter da = new SqlDataAdapter("spGetUserDetailsbyUserId", con);

                    // Set the command type as StoredProcedure.
                    da.SelectCommand.CommandType = CommandType.StoredProcedure;

                    // Create and add parameter to Parameters collection for the stored procedure.
                    da.SelectCommand.Parameters.AddWithValue("@UserId", Session["UserId"]);

                    // Create a new DataSet to hold the records.
                    DataSet DS = new DataSet();

                    // Fill the DataSet with the rows that are returned.
                    da.Fill(DS);

                    // Set the data source for the GridView as the DataSet that holds the rows.
                    GridViewUser.DataSource = DS;
                    if (DS.Tables[0].Rows.Count == 0)
                    {
                        lblMessage.Text = "No users yet......";
                    }
                    else
                    {
                        GridViewUser.DataBind();
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorMessage.Text = ex.Message;
            }
        }
Пример #25
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         User us = (User)Session["user"];
         if (Session["user"] != null)
         {
             if (us.RoleID == 1)
             {
                 GridViewUser.DataSource = ViewUserController.getUser();
                 GridViewUser.DataBind();
             }
             else
             {
                 Response.Redirect("Home.aspx");
             }
         }
         else
         {
             Response.Redirect("Home.aspx");
         }
     }
 }
Пример #26
0
 protected void GridViewUser_RowDeleted(object sender, GridViewDeletedEventArgs e)
 {
     GridViewUser.DataBind();
 }
 private void GridViewDataBind()
 {
     if (ItemDataProcess.type == itemType)
     {
         if (Session["AuthenticatedAdminData"] != null)
         {
             GridViewAdmin.DataSource = ItemDataProcess.GetItems(); //Görüldüğü gibi GridView’e DataSet nesnesi atanıyor.
             GridViewAdmin.DataBind();                              //this.DataBind() değil GridView’in DataBind()’i çağrıldı
         }
         else
         {
             GridViewUser.DataSource = ItemDataProcess.GetItems(); //Görüldüğü gibi GridView’e DataSet nesnesi atanıyor.
             GridViewUser.DataBind();                              //this.DataBind() değil GridView’in DataBind()’i çağrıldı
         }
     }
     else if (ItemDataProcess.type == bookType)
     {
         if (Session["AuthenticatedAdminData"] != null)
         {
             GridViewAdminDistinct.DataSource = ItemDataProcess.GetBooks(); //Görüldüğü gibi GridView’e DataSet nesnesi atanıyor.
             GridViewAdminDistinct.DataBind();
         }
         else
         {
             GridViewUserDistinct.DataSource = ItemDataProcess.GetBooks(); //Görüldüğü gibi GridView’e DataSet nesnesi atanıyor.
             GridViewUserDistinct.DataBind();
         }
     }
     else if (ItemDataProcess.type == journalType)
     {
         if (Session["AuthenticatedAdminData"] != null)
         {
             GridViewAdminDistinct.DataSource = ItemDataProcess.GetJournals(); //Görüldüğü gibi GridView’e DataSet nesnesi atanıyor.
             GridViewAdminDistinct.DataBind();
         }
         else
         {
             GridViewUserDistinct.DataSource = ItemDataProcess.GetJournals(); //Görüldüğü gibi GridView’e DataSet nesnesi atanıyor.
             GridViewUserDistinct.DataBind();
         }
     }
     else if (ItemDataProcess.type == newspaperType)
     {
         if (Session["AuthenticatedAdminData"] != null)
         {
             GridViewAdminDistinct.DataSource = ItemDataProcess.GetNewspapers(); //Görüldüğü gibi GridView’e DataSet nesnesi atanıyor.
             GridViewAdminDistinct.DataBind();
         }
         else
         {
             GridViewUserDistinct.DataSource = ItemDataProcess.GetNewspapers(); //Görüldüğü gibi GridView’e DataSet nesnesi atanıyor.
             GridViewUserDistinct.DataBind();
         }
     }
     else if (ItemDataProcess.type == videoType)
     {
         if (Session["AuthenticatedAdminData"] != null)
         {
             GridViewAdminDistinct.DataSource = ItemDataProcess.GetVideos(); //Görüldüğü gibi GridView’e DataSet nesnesi atanıyor.
             GridViewAdminDistinct.DataBind();
         }
         else
         {
             GridViewUserDistinct.DataSource = ItemDataProcess.GetVideos(); //Görüldüğü gibi GridView’e DataSet nesnesi atanıyor.
             GridViewUserDistinct.DataBind();
         }
     }
 }
Пример #28
0
        private void MenuItem_ClickEvent(object sender, EventArgs e)
        {
            UIView.MenuItem item = sender as UIView.MenuItem;
            this.disableMenu(item);
            double time        = 100;
            double position    = this.UIContent.getLeft();
            double itemPostion = 0;

            if (UIContent.Children.Count > 0)
            {
                itemPostion = UIContent.Children[UIContent.Children.Count - 1].getLeft();
            }

            UIContent.Animation_Translate_Frame(double.NaN, double.NaN, position, double.NaN, time, () =>
            {
                if (UIContent.Children.Count > 1)
                {
                    this.UIContent.Children.RemoveAt(0);
                }
                switch (item.Code)
                {
                case "User":
                    // this.UIContent.Children.Clear();
                    GridViewUser tmpItem        = new GridViewUser();
                    tmpItem.BrowserMediaEvent  += tmpItem_BrowserMediaEvent;
                    tmpItem.BrowserCameraEvent += tmpItem_BrowserCameraEvent;
                    tmpItem.Width  = 1366;
                    tmpItem.Height = 668;
                    tmpItem.setLeft(itemPostion + 1366);
                    tmpItem.setTop(0);
                    this.UIContent.Children.Add(tmpItem);
                    break;

                case "Media":
                    // this.UIContent.Children.Clear();
                    GridMedia tmpMediaItem = new GridMedia();
                    tmpMediaItem.Width     = 1366;
                    tmpMediaItem.Height    = 668;
                    tmpMediaItem.setLeft(itemPostion + 1366);
                    tmpMediaItem.setTop(0);
                    tmpMediaItem.User = null;
                    this.UIContent.Children.Add(tmpMediaItem);
                    break;

                case "Camera":
                    // this.UIContent.Children.Clear();
                    GridMedia tmpCameraItem = new GridMedia();
                    tmpCameraItem.Width     = 1366;
                    tmpCameraItem.Height    = 668;
                    tmpCameraItem.setLeft(itemPostion + 1366);
                    tmpCameraItem.setTop(0);
                    tmpCameraItem.TypeMedia = 2;
                    this.UIContent.Children.Add(tmpCameraItem);
                    break;

                case "Device":
                    // this.UIContent.Children.Clear();
                    GridViewDevice tmpDeviceItem = new GridViewDevice();
                    tmpDeviceItem.Width          = 1366;
                    tmpDeviceItem.Height         = 668;
                    tmpDeviceItem.setLeft(itemPostion + 1366);
                    tmpDeviceItem.setTop(0);
                    this.UIContent.Children.Add(tmpDeviceItem);
                    break;

                case "Schedule":
                    // this.UIContent.Children.Clear();
                    MTC_Server.UIView.Schedule.UISchedule tmpCalendar = new UIView.Schedule.UISchedule();
                    tmpCalendar.Width  = 1366;
                    tmpCalendar.Height = 668;
                    tmpCalendar.setLeft(itemPostion + 1366);
                    tmpCalendar.setTop(0);
                    this.UIContent.Children.Add(tmpCalendar);
                    break;

                case "Playlist":
                    // this.UIContent.Children.Clear();
                    MTC_Server.UIView.Playlist.GridPlaylist tmpPlaylist = new MTC_Server.UIView.Playlist.GridPlaylist();
                    tmpPlaylist.Width  = 1366;
                    tmpPlaylist.Height = 668;
                    tmpPlaylist.setLeft(itemPostion + 1366);
                    tmpPlaylist.setTop(0);
                    this.UIContent.Children.Add(tmpPlaylist);
                    break;

                case "About":
                    About window = new About();
                    window.Show();
                    return;
                }
                this.UIContent.Animation_Translate_Frame(double.NaN, double.NaN, -itemPostion - 1366, double.NaN, 600,
                                                         () =>
                {
                    if (UIContent.Children.Count != 0)
                    {
                        this.UIContent.Children.RemoveAt(0);
                    }
                });
            });
        }
Пример #29
0
 protected void ButtonDelete_OnClick(object sender, EventArgs e)
 {
     Business.Users.DeleteUser(Convert.ToInt32(TextBoxId.Text));
     GridViewUser.DataSource = Business.Users.GetAllUsers();
     GridViewUser.DataBind();
 }
Пример #30
0
 protected void Page_Load(object sender, EventArgs e)
 {
     GridViewUser.DataSource = Business.Users.GetAllUsers();
     GridViewUser.DataBind();
 }