protected void dtgWaitingDeployList_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "return") { try { ContentDB.SetStatus(ConvertUtility.ToInt32(e.Item.Cells[0].Text), (int)AppEnv.CMSWorkFlow.Return); ContentDB.SetComment(ConvertUtility.ToInt32(e.Item.Cells[0].Text), Convert.ToChar(34) + txtComment.Text + Convert.ToChar(34) + "\r\n Trả lại bởi : " + CurrentAdminInfo.User_FullName); lblStatusUpdate.Text = AppEnv.MSG_Return + dropZones.SelectedItem.Text; txtComment.Text = string.Empty; } catch { lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR; } } if (e.CommandName == "deploy") { try { ContentDB.SetStatus(ConvertUtility.ToInt32(e.Item.Cells[0].Text), (int)AppEnv.CMSWorkFlow.Deploy); lblStatusUpdate.Text = AppEnv.MSG_Deploy + dropZones.SelectedItem.Text; DistributionInfo info = new DistributionInfo(); info.Distribution_ContentID = ConvertUtility.ToInt32(e.Item.Cells[0].Text); info.Distribution_ZoneID = ConvertUtility.ToInt32(dropZones.SelectedValue); info.Distribution_Rank = (int)AppEnv.CMSContentRank.Default; DistributionDB.Insert(info); } catch { lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR; } } }
protected void cmdUpdate_Click(object sender, EventArgs e) { if (isManager || isDeployer) { //try //{ lblStatusUpdate.Text = AppEnv.MSG_Deploy + "<br /> "; //lstZones.Items.FindByValue(dropZones.SelectedValue).Selected = true; foreach (ListItem item in lstZones.Items) { if (item.Selected) { if (!DistributionDB.CheckContentExist(contentInfo.Content_ID, Convert.ToInt32(item.Value))) { //DistributionDB.RemoverInZoneID(contentInfo.Content_ID, Convert.ToInt32(item.Value)); int zoneID = ConvertUtility.ToInt32(item.Value); var newDist = new DistributionInfo(); newDist.Distribution_ContentID = contentInfo.Content_ID; newDist.Distribution_ZoneID = zoneID; newDist.Distribution_CreateDate = DateTime.Now; newDist.Distribution_Rank = ConvertUtility.ToInt32(AppEnv.CMSContentRank.Default); newDist.Distribution_Layout = "zone"; newDist.Distribution_DisableTeaser = false; newDist.Distribution_DisableAvatar = false; DistributionDB.Insert(newDist); } lblStatusUpdate.Text += item.Text + ",<br>"; } else { DistributionDB.RemoverInZoneID(contentInfo.Content_ID, Convert.ToInt32(item.Value)); } } lblStatusUpdate.Text = lblStatusUpdate.Text.Substring(0, lblStatusUpdate.Text.Length - 5) + "</font>"; lblStatusUpdate2.Text = MiscUtility.UPDATE_SUCCESS; //cmdHuy_Click(null, null); //} //catch //{ // lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR; //} } }
protected void dtgReturnList_ItemCommand(object source, DataGridCommandEventArgs e) { try { int contentID = ConvertUtility.ToInt32(e.Item.Cells[0].Text); switch (e.CommandName) { case "deploy": { if (isManager || isDeployer) { ContentDB.SetStatus(contentID, (int)AppEnv.CMSWorkFlow.Deploy); DistributionInfo newDist = new DistributionInfo(); newDist.Distribution_ContentID = contentID; newDist.Distribution_ZoneID = ConvertUtility.ToInt32(dropZones.SelectedValue); newDist.Distribution_Rank = (int)AppEnv.CMSContentRank.Default; DistributionDB.Insert(newDist); lblStatusUpdate.Text = AppEnv.MSG_Deploy + dropZones.SelectedItem.Text; } else if (isCreater) { ContentDB.SetStatus(contentID, (int)AppEnv.CMSWorkFlow.Waiting); lblStatusUpdate.Text = AppEnv.MSG_Waiting + dropZones.SelectedItem.Text; } break; } case "delete": ContentDB.Delete(contentID); lblStatusUpdate.Text = MiscUtility.UPDATE_SUCCESS; break; case "edit": Response.Redirect(AppEnv.ADMIN_CMD + "cmseditcontent&contentid=" + contentID); break; } } catch { lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR; } }
protected void cmdUpdate_Click(object sender, EventArgs e) { contentInfo.Content_Name = txtName.Text; contentInfo.Content_Teaser = txtTeaser.Text; contentInfo.Content_Body = Editor1.HtmlValue; contentInfo.Content_CreateDate = ConvertUtility.ToDateTime(txtCreateDate.Text); contentInfo.Content_ModifiedDate = DateTime.Now; contentInfo.Content_OriginalZoneID = ConvertUtility.ToInt32(dropZones.SelectedValue); contentInfo.Content_ModifiedUserID = CurrentAdminInfo.User_ID; contentInfo.Content_Author = txtAuthor.Text; contentInfo.Content_EventDate = ConvertUtility.ToDateTime(txtEventDate.Text); contentInfo.Content_FriendlyUrl = UnicodeUtility.UnicodeToFriendlyUrl(txtName.Text); contentInfo.Content_ExcludeFromSearch = chkExcludeFromSearch.Checked; contentInfo.Content_IsPhoto = chkIsPhoto.Checked; contentInfo.Content_IsDownload = chkIsDownload.Checked; contentInfo.Content_IsVideo = chkIsVideo.Checked; contentInfo.Content_IsPoll = chkIsPoll.Checked; contentInfo.Content_IsProduct = chkIsProduct.Checked; contentInfo.Content_Visible = chkVisible.Checked; contentInfo.Content_IsTemp = false; if (isManager || isDeployer) { //try //{ contentInfo.Content_Status = (int)AppEnv.CMSWorkFlow.Deploy; ContentDB.Update(contentInfo); lblStatusUpdate.Text = AppEnv.MSG_Deploy + "<br /> "; lstZones.Items.FindByValue(dropZones.SelectedValue).Selected = true; foreach (ListItem item in lstZones.Items) { if (item.Selected) { if (!DistributionDB.CheckContentExist(contentInfo.Content_ID, Convert.ToInt32(item.Value))) { //DistributionDB.RemoverInZoneID(contentInfo.Content_ID, Convert.ToInt32(item.Value)); int zoneID = ConvertUtility.ToInt32(item.Value); var newDist = new DistributionInfo(); newDist.Distribution_ContentID = contentInfo.Content_ID; newDist.Distribution_ZoneID = zoneID; newDist.Distribution_CreateDate = DateTime.Now; newDist.Distribution_Rank = ConvertUtility.ToInt32(rdoContentRanks.SelectedValue); newDist.Distribution_Layout = dropLayout.SelectedValue; newDist.Distribution_DisableTeaser = chkDisableTeaser.Checked; newDist.Distribution_DisableAvatar = chkDisableAvatar.Checked; DistributionDB.Insert(newDist); } lblStatusUpdate.Text += item.Text + ",<br>"; } else { DistributionDB.RemoverInZoneID(contentInfo.Content_ID, Convert.ToInt32(item.Value)); } } lblStatusUpdate.Text = lblStatusUpdate.Text.Substring(0, lblStatusUpdate.Text.Length - 5) + "</font>"; lblStatusUpdate2.Text = MiscUtility.UPDATE_SUCCESS; //cmdHuy_Click(null, null); //} //catch //{ // lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR; //} } else { //try //{ ContentDB.Update(contentInfo); lblStatusUpdate.Text = lblStatusUpdate2.Text = MiscUtility.UPDATE_SUCCESS; //} //catch //{ // lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR; //} } }