protected void dtgZones_RowDataBound(object sender, GridViewRowEventArgs e) { Label lbl; LinkButton lnk; DropDownList ddl; lbl = (Label)e.Row.FindControl("lblHZone_Name"); if (lbl != null) { lbl.Text = (lang == "vi-VN" ? "Tên mục" : "Index Name"); } lnk = (LinkButton)e.Row.FindControl("lnkOrder"); if (lnk != null) { lnk.Text = (lang == "vi-VN" ? "Thứ tự" : "Order"); } lbl = (Label)e.Row.FindControl("lblPriority"); ddl = (DropDownList)e.Row.FindControl("ddlOrder"); if (lbl != null && ddl != null) { int order = ConvertUtility.ToInt32(lbl.Text); MiscUtility.FillIndex(ddl, totalPriority, order); } }
protected void Page_Load(object sender, EventArgs e) { _dotuoi = ConvertUtility.ToString(Request.QueryString["dt"]); _monhoc = ConvertUtility.ToString(Request.QueryString["mh"]); _coso = ConvertUtility.ToString(Request.QueryString["cs"]); _lophoc = ConvertUtility.ToString(Request.QueryString["lh"]); _khoahocid = ConvertUtility.ToInt32(Request.QueryString["khoahocid"]); if (!IsPostBack) { MiscUtility.FillIndex(dropDay, 1, 31, DateTime.Now.Day); MiscUtility.FillIndex(dropMonth, 1, 12, DateTime.Now.Month); MiscUtility.FillIndex(dropYear, 1950, DateTime.Now.Year, DateTime.Now.Year); dropFilterMonHoc.DataSource = MonhocDB.GetAll(); dropFilterMonHoc.DataTextField = "Monhoc_Name"; dropFilterMonHoc.DataValueField = "Monhoc_ID"; dropFilterMonHoc.DataBind(); dropFilterMonHoc.Items.Insert(0, new ListItem("Chọn môn học", "")); dropFilterCoso.DataSource = CosoDB.GetAll(); dropFilterCoso.DataTextField = "Coso_Name"; dropFilterCoso.DataValueField = "Coso_ID"; dropFilterCoso.DataBind(); dropFilterCoso.Items.Insert(0, new ListItem("Chọn cơ sở", "")); ZoneUtility.LoadZonesByParentID(dropFilterLopHoc.Items, ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneKhoaHoc + AppEnv.GetLanguage()))); dropFilterLopHoc.Items.Insert(0, new ListItem("Chọn lớp học", "")); MiscUtility.SetSelected(dropFilterDoTuoi.Items, _dotuoi); MiscUtility.SetSelected(dropFilterMonHoc.Items, _monhoc); MiscUtility.SetSelected(dropFilterLopHoc.Items, _lophoc); MiscUtility.SetSelected(dropFilterCoso.Items, _coso); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MiscUtility.FillIndex(dropDay, 1, 31, DateTime.Now.Day); MiscUtility.FillIndex(dropMonth, 1, 12, DateTime.Now.Month); MiscUtility.FillIndex(dropYear, DateTime.Now.Year, DateTime.Now.Year + 15, DateTime.Now.Year); } }
protected void Page_Load(object sender, EventArgs e) { if (!CurrentUser.IsSuperAdmin) { Response.Redirect(AppEnv.ADMIN_CMD); } controlId = ConvertUtility.ToInt32(Request.QueryString["cid"]); moduleId = ConvertUtility.ToInt32(Request.QueryString["mid"]); ModuleInfo module = ModuleController.GetModule(moduleId); ModuleControlInfo moduleControl = ModuleControlController.GetModuleControl(controlId); if (moduleControl == null) { this.btnDelete.Visible = false; } if (module == null) { module = ModuleController.GetModule(moduleControl.ModuleID); } if (module != null) { lblModuleName.Text = module.ModuleName; txtControlIcon.fpUploadDir = CheckPath(module); } if (!Page.IsPostBack) { if (module != null && module.ModuleFolder.Length > 0) { GetFiles(Server.MapPath("/"), Server.MapPath(module.ModuleFolder)); dropPath.DataSource = lstFile; dropPath.DataBind(); } MiscUtility.FillIndex(dropControlOrder, 30, 1); chkControlType.DataSource = RoleController.GetRoles(); chkControlType.DataBind(); if (moduleControl == null) { return; } lblModuleName.Text = ModuleController.GetModule(moduleControl.ModuleID).ModuleName; txtControlName.Text = moduleControl.ControlName; txtControlDescription.Text = moduleControl.ControlDescription; txtControlKey.Text = moduleControl.ControlKey; MiscUtility.SelectItemFromList(dropPath, moduleControl.ControlPath); txtControlIcon.Text = moduleControl.ControlIcon; txtControlDescription.Text = moduleControl.ControlDescription; chkControlHeader.Checked = moduleControl.ControlHeader; MiscUtility.SelectItemFromList(dropControlOrder, moduleControl.ControlOrder.ToString()); string[] roleList = (moduleControl.ControlRole != null)?moduleControl.ControlRole.Split("|".ToCharArray()):null; MiscUtility.SelectItemFromList(chkControlType, roleList); } }
protected void Page_Load(object sender, EventArgs e) { lblUpdateStatus.Text = string.Empty; if (!CurrentUser.IsSuperAdmin) { Response.Redirect(AppEnv.ADMIN_CMD); } if (!Page.IsPostBack) { MiscUtility.FillIndex(dropIndex, 30, 1); DataTable dtPortalByLang = null; dgrNameFollowLang.DataSource = builddata(dtPortalByLang); dgrNameFollowLang.DataBind(); } }
protected void dtgAdvertises_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemIndex < 0) { return; } DataRowView curData = (DataRowView)e.Item.DataItem; string locations = "|" + curData["Advertise_Params"]; //string strLocation = string.Empty; //foreach (ListItem item in lstZones.Items) //{ // if (locations.IndexOf("|" + item.Value + "|") >= 0) // strLocation += item.Text + "<br>"; //} //e.Item.Cells[2].Text = strLocation; Literal litUrl = (Literal)e.Item.FindControl("litUrl"); switch (curData["Advertise_Type"].ToString()) { case "flash": litUrl.Text = MultimediaUtility.strInitFlash(curData["Advertise_Path"].ToString(), Convert.ToInt32(curData["Advertise_Width"]), Convert.ToInt32(curData["Advertise_Height"])); break; case "media": litUrl.Text = MultimediaUtility.strInitMultimedia(curData["Advertise_Path"].ToString(), Convert.ToInt32(curData["Advertise_Width"]), Convert.ToInt32(curData["Advertise_Height"])); break; case "other": litUrl.Text = curData["Advertise_Path"].ToString(); break; case "image": if (curData["Advertise_Path"].ToString() != string.Empty) { litUrl.Text = "<img src='" + curData["Advertise_Path"] + "' width='120'></img>"; } break; } litUrl.Text += "<br><a href='" + curData["Advertise_RedirectURL"] + "'>" + curData["Advertise_Name"] + "</a>"; Button cmdDel = (Button)e.Item.FindControl("cmdDel"); cmdDel.Attributes.Add("onclick", MiscUtility.DELETE_CONFIRM); DropDownList dropPriority = (DropDownList)e.Item.FindControl("dropPriority"); MiscUtility.FillIndex(dropPriority, 0, 20, ConvertUtility.ToInt32(curData["Advertise_Priority"])); }
protected void dtgDeployList_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemIndex < 0) { return; } DataRowView rowData = (DataRowView)e.Item.DataItem; DropDownList dropContentRank = (DropDownList)e.Item.FindControl("dropContentRank"); dropContentRank.Items.FindByValue(rowData["Distribution_Rank"].ToString()).Selected = true; DropDownList dropIndex = (DropDownList)e.Item.FindControl("dropIndex"); MiscUtility.FillIndex(dropIndex, MAX_PRIORITY, ConvertUtility.ToInt32(rowData["Distribution_Priority"])); HyperLink lnkHeadline = (HyperLink)e.Item.FindControl("lnkHeadline"); lnkHeadline.Text = DistributionDB.GetNameByDistID(ConvertUtility.ToInt32(e.Item.Cells[0].Text)); lnkHeadline.NavigateUrl = AppEnv.ADMIN_CMD + "cmsviewcontent&contentID=" + e.Item.Cells[1].Text; lnkHeadline.ToolTip = ContentDB.GetAuthorInfoByContentID(Convert.ToInt32(e.Item.Cells[1].Text)); Button cmdRemove = (Button)e.Item.FindControl("cmdRemove"); Button cmdDel = (Button)e.Item.FindControl("cmdDel"); Button cmdEdit = (Button)e.Item.FindControl("cmdEdit"); if (!isManager && !isDeployer) { cmdDel.Enabled = false; cmdEdit.Enabled = false; cmdRemove.Enabled = false; dropContentRank.Enabled = false; dropIndex.Enabled = false; } else { cmdRemove.Attributes.Add("onclick", MiscUtility.DELETE_CONFIRM); cmdDel.Attributes.Add("onclick", MiscUtility.DELETE_CONFIRM); } }
protected void tvwCmds_NodeSelected(object sender, TreeViewNodeEventArgs e) { int curID = ConvertUtility.ToInt32(e.Node.ID); CmdInfo info = CmdDB.GetInfo(curID); if (info == null) { cmdEmpty_Click(null, null); return; } txtID.Text = info.Cmd_ID.ToString(); txtName.Text = info.Cmd_Name; txtCmd.Text = info.Cmd_Value; txtParams.Text = info.Cmd_Params; txtPath.Text = info.Cmd_Path; txtUrl.Text = info.Cmd_Url; int maxIndex = CmdDB.GetChildCount(info.Cmd_ParentID); MiscUtility.FillIndex(dropIndex, maxIndex, info.Cmd_Index); chkEnable.Checked = info.Cmd_Enable; chkVisble.Checked = info.Cmd_Visible; }