void PopulateItem(int _ID) { T_Idiea obj_Idiea = new T_Idiea(); T_IdieaDAL obj_DAL = new T_IdieaDAL(); obj_Idiea = obj_DAL.GetOneFromT_IdieaByID(_ID); Txt_tieude.Text = obj_Idiea.Title; ddlLang.SelectedValue = obj_Idiea.Lang_ID.ToString(); cbo_chuyenmuc.Items.Clear(); if (ddlLang.SelectedIndex > 0) { UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_Chuyenmuc", "Ten_Chuyenmuc", "T_Chuyenmuc", string.Format(" Ma_Anpham=" + this.ddlLang.SelectedValue.ToString() + " AND Ma_Chuyenmuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), "---Chọn chuyên mục---", "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC"); cbo_chuyenmuc.SelectedIndex = CommonLib.GetIndexControl(cbo_chuyenmuc, obj_Idiea.Cat_ID.ToString()); } else { this.cbo_chuyenmuc.DataSource = null; this.cbo_chuyenmuc.DataBind(); } txt_noidung.Text = obj_Idiea.Comment; txt_noidungbaiviet.Text = obj_Idiea.Diea_Articles; cbb_Loai.SelectedValue = "1"; }
public T_Idiea SetItem() { T_IdieaDAL _objDAL = new T_IdieaDAL(); T_Idiea obj_Idiea = new T_Idiea(); T_Allotments obj_All = new T_Allotments(); T_AllotmentDAL _DAL = new T_AllotmentDAL(); if (Page.Request.Params["id"] != null) { int Diea_ID = Convert.ToInt32(Page.Request["id"].ToString()); obj_Idiea = _objDAL.GetOneFromT_IdieaByID(Diea_ID); } obj_All = _DAL.GetOneFromT_AllotmentByIdieaID(int.Parse(Page.Request["DT_id"].ToString())); obj_Idiea.Lang_ID = Convert.ToInt32(this.ddlLang.SelectedValue.ToString()); if (Txt_tieude.Text != "") { obj_Idiea.Title = UltilFunc.CleanFormatTags(Txt_tieude.Text); } if (txt_noidung.Text.Length > 0) { obj_Idiea.Comment = txt_noidung.Text; } if (int.Parse(cbo_chuyenmuc.SelectedIndex.ToString()) > 0) { obj_Idiea.Cat_ID = int.Parse(cbo_chuyenmuc.SelectedValue.ToString()); } obj_Idiea.User_Created = _user.UserID; obj_Idiea.User_Duyet = _user.UserID; obj_Idiea.Date_Created = DateTime.Now; obj_Idiea.Date_Duyet = DateTime.Now; obj_Idiea.Diea_Stype = 2; obj_Idiea.Date_Edit = DateTime.Now; obj_Idiea.User_Edit = _user.UserID; obj_Idiea.Diea_Articles = txt_noidungbaiviet.Text; //Add by nvthai if (obj_All != null) { obj_Idiea.Date_From = obj_All.Date_start; obj_Idiea.Date_To = obj_All.Date_End; obj_Idiea.User_NguoiNhan = obj_All.User_NguoiNhan; } //end if (Page.Request["Tab"] != null) { tab = Convert.ToInt32(Page.Request["Tab"].ToString()); } if (int.Parse(Page.Request["Tab"].ToString()) == 1) { obj_Idiea.Status = 33; } else { obj_Idiea.Status = 32; } obj_Idiea.CV_id = int.Parse(Page.Request["DT_id"].ToString()); return(obj_Idiea); }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); if (!Page.IsPostBack) { int id = int.Parse(Page.Request.QueryString["ID"].ToString()); if (Page.Request.QueryString["Menu_ID"] != null) { T_Idiea obj = new T_Idiea(); T_IdieaDAL dal = new T_IdieaDAL(); ChuyenmucDAL caDal = new ChuyenmucDAL(); obj = dal.GetOneFromT_IdieaByID(id); //add by Hung viet if (obj.Cat_ID > 0) { this.litCatName.Text = caDal.GetOneFromT_ChuyenmucByID(int.Parse(obj.Cat_ID.ToString())).Ten_ChuyenMuc; } else { this.litCatName.Text = ""; } this.litTittle.Text = obj.Title.ToString(); this.litTacgia.Text = UltilFunc.GetUserFullName(obj.User_Created); this.litContent.Text = CleanHTMLFont(obj.Comment.ToString()); this.lit_baiviet.Text = CleanHTMLFont(obj.Diea_Articles.ToString()); string count = this.litContent.Text + "" + this.lit_baiviet.Text; this.LitCount.Text = UltilFunc.WordCount(count) + " từ "; if (obj.Status == 6) { this.LitDatePublisher.Text = obj.Date_Duyet.ToString("dd/MM/yyyy HH:mm") + " (GMT + 7)"; } ViewState["ver"] = -1; } } } } }
public override void DataBind() { T_Idiea obj = new T_Idiea(); T_Allotments _Allotment = new T_Allotments(); T_IdieaDAL dal = new T_IdieaDAL(); T_AllotmentDAL _AllotmentDAL = new T_AllotmentDAL(); ChuyenmucDAL caDal = new ChuyenmucDAL(); if (Request["DT_id"] != null && Request["DT_id"].ToString() != "" && Request["DT_id"].ToString() != String.Empty) { int id = int.Parse(Page.Request["DT_id"].ToString()); _Allotment = _AllotmentDAL.GetOneFromT_AllotmentByID(id); obj = dal.GetOneFromT_IdieaByID(_Allotment.Idiea_ID); this.T_AllotmentNgayHT.Text = _Allotment.Date_End.ToString(); this.ltrYeuCau.Text = _Allotment.Request.ToString(); if (obj.Cat_ID > 0) { this.lblNameCM.Text = caDal.GetOneFromT_ChuyenmucByID(int.Parse(obj.Cat_ID.ToString())).Ten_ChuyenMuc; } if (obj.Title.ToString().Length > 0) { this.lbtieude.Text = obj.Title.ToString(); } if (_Allotment.Type == 1) { ltr_loaibai1.Text = "Bài viết"; } else { ltr_loaibai1.Text = "Bài ảnh"; } MaCM = obj.Cat_ID; } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); if (!Page.IsPostBack) { int id = int.Parse(Page.Request.QueryString["ID"].ToString()); if (Page.Request.QueryString["Menu_ID"] != null) { T_Idiea obj = new T_Idiea(); T_IdieaVersion _obj2 = new T_IdieaVersion(); T_IdieaDAL dal = new T_IdieaDAL(); ChuyenmucDAL caDal = new ChuyenmucDAL(); obj = dal.GetOneFromT_IdieaByID(id); //add by nvthai T_IdieaVersion _objVer = new T_IdieaVersion(); if (obj.Diea_Stype == 1) { _objVer = dal.GetOneFromT_IdieaVersionByIDVersion(id, 4, 54); _obj2 = dal.GetOneFromT_IdieaVersionByIDVersion(id, 1, 62); } else { _objVer = dal.GetOneFromT_IdieaVersionByIDVersion(id, 4, 54); _obj2 = dal.GetOneFromT_IdieaVersionByIDVersion(id, 3, 23); } //add by Hung viet if (obj.Cat_ID > 0) { this.litCatName.Text = caDal.GetOneFromT_ChuyenmucByID(int.Parse(_obj2.Cat_ID.ToString())).Ten_ChuyenMuc; this.litCM.Text = caDal.GetOneFromT_ChuyenmucByID(int.Parse(_objVer.Cat_ID.ToString())).Ten_ChuyenMuc; } else { this.litCatName.Text = ""; this.litCM.Text = ""; } this.litTittle.Text = _obj2.Title.ToString(); this.litTacgia.Text = UltilFunc.GetUserFullName(_obj2.User_Created); this.litContent.Text = CleanHTMLFont(_obj2.Comment.ToString()); this.lit_baiviet.Text = CleanHTMLFont(_obj2.Diea_Articles.ToString()); string coutstring = this.litContent.Text + " " + this.lit_baiviet.Text; this.litCounter.Text = UltilFunc.WordCount(coutstring).ToString() + " từ"; this.litTenDetai.Text = _objVer.Title.ToString(); this.literNguoiviet.Text = UltilFunc.GetUserFullName(_objVer.User_Edit); this.litContents.Text = CleanHTMLFont(_objVer.Comment.ToString()); this.litbai.Text = CleanHTMLFont(_objVer.Diea_Articles.ToString()); string coutstring2 = this.litContents.Text + " " + this.litbai.Text; this.litCouter2.Text = UltilFunc.WordCount(coutstring2).ToString() + " từ"; ViewState["ver"] = -1; } } } } }
private void Gui_Duyet() { ArrayList ar = new ArrayList(); if (TabContainer1.ActiveTabIndex == 0) { foreach (DataGridItem m_Item in dgr_tintuc1.Items) { CheckBox chk_select = (CheckBox)m_Item.FindControl("optSelect"); if (chk_select != null && chk_select.Checked) { ar.Add(double.Parse(dgr_tintuc1.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString())); } } } else if (TabContainer1.ActiveTabIndex == 1) { foreach (DataGridItem m_Item in dgr_tintuc2.Items) { CheckBox chk_select = (CheckBox)m_Item.FindControl("optSelect"); if (chk_select != null && chk_select.Checked) { ar.Add(double.Parse(dgr_tintuc2.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString())); } } } if (TabContainer1.ActiveTabIndex == 0) { LoadData_DangXuly(); } else if (TabContainer1.ActiveTabIndex == 1) { LoadData_Bitralai(); } for (int i = 0; i < ar.Count; i++) { T_Idiea _obj = new T_Idiea(); T_IdieaDAL _objDAL = new T_IdieaDAL(); double _ID = double.Parse(ar[i].ToString()); if (_objDAL.BinT_Idiea(_ID, 32) == true || _objDAL.BinT_Idiea(_ID, 33) == true) { FuncAlert.AlertJS(this, "Bạn vẫn còn bài chưa gửi đi trong đề tài này!"); return; } T_AllotmentDAL DAL = new T_AllotmentDAL(); DAL.Update_Status_tintuc(_ID, 33, _user.UserID, DateTime.Now); ActionsCode = "[Danh sách công việc đang xử lý:]-->[hoàn thành(CV)][ID: " + _ID + "]"; UltilFunc.Log_Action(_user.UserID, _user.UserFullName, DateTime.Now, int.Parse(Request["Menu_ID"]), ActionsCode); } if (TabContainer1.ActiveTabIndex == 0) { LoadData_DangXuly(); } else if (TabContainer1.ActiveTabIndex == 1) { LoadData_Bitralai(); } SetTotal(); }