Esempio n. 1
0
        protected void dtgDeployList_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            try
            {
                switch (e.CommandName)
                {
                case "updaterank":
                    if (isManager || isDeployer)
                    {
                        foreach (DataGridItem item in dtgDeployList.Items)
                        {
                            DropDownList dropContentRank = (DropDownList)item.FindControl("dropContentRank");
                            DistributionDB.SetRank(ConvertUtility.ToInt32(item.Cells[0].Text), ConvertUtility.ToInt32(dropContentRank.SelectedValue));
                        }
                    }
                    break;

                case "updatepriority":
                    if (isManager || isDeployer)
                    {
                        foreach (DataGridItem item in dtgDeployList.Items)
                        {
                            DropDownList dropIndex = (DropDownList)item.FindControl("dropIndex");
                            DistributionDB.SetPriority(ConvertUtility.ToInt32(item.Cells[0].Text), ConvertUtility.ToInt32(dropIndex.SelectedValue));
                        }
                    }
                    break;

                case "remover":
                    DistributionDB.Delete(ConvertUtility.ToInt32(e.Item.Cells[0].Text));
                    break;

                case "delete":
                    // xoa anh?
                    ContentDB.Delete(ConvertUtility.ToInt32(e.Item.Cells[1].Text));
                    break;

                case "edit":
                    Response.Redirect(AppEnv.ADMIN_CMD + "cmseditcontent&contentid=" + ConvertUtility.ToInt32(e.Item.Cells[1].Text));
                    break;
                }
                lblStatusUpdate.Text = MiscUtility.UPDATE_SUCCESS;
            }
            catch
            {
                lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
            }
        }