void PopulateItem1(int _ID) { T_Allotments _obj = new T_Allotments(); T_AllotmentDAL _objDAL = new T_AllotmentDAL(); T_Idiea obj_Idiea = new T_Idiea(); T_IdieaDAL obj_DAL = new T_IdieaDAL(); _obj = _objDAL.GetOneFromT_AllotmentByID(_ID); obj_Idiea = obj_DAL.GetOneFromT_IdieaByID(_obj.Idiea_ID); 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.Request; 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); }
public int InsertT_Allotment(T_Allotments _objT_Allotment) { int _inserted; try { _inserted = HPCDataProvider.Instance().InsertObjectReturn(_objT_Allotment, "Sp_InsertT_Allotment"); } catch (Exception ex) { throw ex; } return(_inserted); }
public T_Allotments SetItem1() { int id = Convert.ToInt32(Page.Request["id"].ToString()); T_Idiea _objIdiea = new T_Idiea(); HPCBusinessLogic.DAL.T_IdieaDAL _idieaDAL = new HPCBusinessLogic.DAL.T_IdieaDAL(); _objIdiea = _idieaDAL.GetOneFromT_IdieaByID(id); T_Allotments _obj_Allotment = new T_Allotments(); _obj_Allotment.Idiea_ID = id; _obj_Allotment.Lang_ID = Convert.ToInt32(this.ddlLang.SelectedValue.ToString()); _obj_Allotment.User_Created = _user.UserID; _obj_Allotment.User_Duyet = _user.UserID; _obj_Allotment.Date_Created = DateTime.Now; _obj_Allotment.Type = Convert.ToInt32(cbb_LoaiBaiviet.SelectedValue); _obj_Allotment.Request = txt_noidung.Text; _obj_Allotment.Date_start = txt_FromDate.Text; _obj_Allotment.Date_End = txt_ToDate.Text; _obj_Allotment.Lock = false; _obj_Allotment.User_NguoiNhan = int.Parse(cbo_NguoiNhan.SelectedValue); _obj_Allotment.Cat_ID = _objIdiea.Cat_ID; _obj_Allotment.Title = Txt_tieude.Text.ToString(); if (Page.Request["Tab"] != null) { int _tab = Convert.ToInt32(Page.Request["Tab"].ToString()); if (_tab == 0) { _obj_Allotment.Status = 32; } else { _obj_Allotment.Status = 23; } } return(_obj_Allotment); }
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 linkSave_Click(object sender, EventArgs e) { if (CheckForm()) { double DieaID = double.Parse(Page.Request["id"].ToString()); T_Idiea _t_idiea = new T_Idiea(); HPCBusinessLogic.DAL.T_IdieaDAL _T_dieaDAL = new HPCBusinessLogic.DAL.T_IdieaDAL(); HPCBusinessLogic.DAL.T_AllotmentDAL _objT_AllDAL = new HPCBusinessLogic.DAL.T_AllotmentDAL(); T_Allotments _obj = new T_Allotments(); T_Idiea _objIdiea = _T_dieaDAL.GetOneFromT_IdieaByID(int.Parse(DieaID.ToString())); int id = 0; if (_objIdiea.Diea_Stype == 1) { _t_idiea = SetItem(); id = _T_dieaDAL.InsertT_Idiea(_t_idiea); _T_dieaDAL.Insert_Version_From_T_idiea_WithUserModify(DieaID, 2, 23, _user.UserID, DateTime.Now); ActionsCode = "[TPPV Sửa đề tài:]-->[ Sửa][Đề tài_ID=" + id.ToString() + " ]"; UltilFunc.Log_Action(_user.UserID, _user.UserName, DateTime.Now, int.Parse(Request["Menu_ID"].ToString()), ActionsCode); } else { if (DateTime.Parse(txt_FromDate.Text.Trim(), new System.Globalization.CultureInfo("fr-FR")) > DateTime.Parse(txt_ToDate.Text.Trim(), new System.Globalization.CultureInfo("fr-FR")) || DateTime.Parse(txt_FromDate.Text.Trim() + " 23:59:59", new System.Globalization.CultureInfo("fr-FR")) < DateTime.Now) { FuncAlert.AlertJS(this, "Ngày bắt đầu phải lớn hơn hoặc bằng ngày hiện tại và nhỏ hơn hoặc bằng ngày kết thúc!"); return; } if (cbo_NguoiNhan.SelectedValue == "0" || cbo_NguoiNhan.SelectedValue == "-1") { FuncAlert.AlertJS(this, "Trước khi lưu bạn phải chọn người nhận việc !"); return; } _obj = SetItem1(); id = _objT_AllDAL.InsertT_Allotment(_obj); if (Page.Request["Tab"] != null) { int _tab = Convert.ToInt32(Page.Request["Tab"].ToString()); if (_tab == 0) { _T_dieaDAL.Update_Status_tintuc(DieaID, 32, _user.UserID, DateTime.Now, 0); } else { _t_idiea = SetItem(); id = _T_dieaDAL.InsertT_Idiea(_t_idiea); if (_tab == 2) { _T_dieaDAL.Update_Status_tintuc(DieaID, 26, _user.UserID, DateTime.Now, 0); } else { _T_dieaDAL.Update_Status_tintuc(DieaID, 23, _user.UserID, DateTime.Now, 0); } } } ActionsCode = "[TPPV Phân công công việc:]-->[PCCV][T_Allotment_ID=" + id + "]"; UltilFunc.Log_Action(_user.UserID, _user.UserName, DateTime.Now, int.Parse(Request["Menu_ID"].ToString()), ActionsCode); } _T_dieaDAL.IsLock(DieaID, 0, _user.UserID, DateTime.Now); if (int.Parse(Page.Request["Tab"].ToString()) != 0) { Response.Redirect("List_DuyetDeTaiTPPV.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&Tab=" + Page.Request["Tab"].ToString()); } else { Response.Redirect("List_DuyetDeTaiTPPV.aspx?Menu_ID=" + Request["Menu_ID"].ToString()); } } }
private void Gui_DuyetBT() { double DieaID = double.Parse(Page.Request["id"].ToString()); T_Idiea _t_idiea = new T_Idiea(); HPCBusinessLogic.DAL.T_IdieaDAL _T_dieaDAL = new HPCBusinessLogic.DAL.T_IdieaDAL(); HPCBusinessLogic.DAL.T_AllotmentDAL _objT_AllDAL = new HPCBusinessLogic.DAL.T_AllotmentDAL(); T_Allotments _obj = new T_Allotments(); T_Idiea _objIdiea = _T_dieaDAL.GetOneFromT_IdieaByID(int.Parse(DieaID.ToString())); int id = 0; if (_objIdiea.Diea_Stype == 1) { _t_idiea = SetItem(); id = _T_dieaDAL.InsertT_Idiea(_t_idiea); if (_T_dieaDAL.GetOneFromT_IdieaByID(int.Parse(DieaID.ToString())).Diea_Lock == true && _T_dieaDAL.GetOneFromT_IdieaByID(int.Parse(DieaID.ToString())).User_Edit != _user.UserID) { FuncAlert.AlertJS(this, "Bài đang có người làm việc.!"); return; } _T_dieaDAL.IsLock(DieaID, 0, _user.UserID, DateTime.Now); _T_dieaDAL.Update_Status_tintuc(DieaID, 52, _user.UserID, DateTime.Now, 0); _T_dieaDAL.Insert_Version_From_T_idiea_WithUserModify(DieaID, 2, 52, _user.UserID, DateTime.Now); ActionsCode = "[Gửi Duyệt(TBT)][Diea_ID:" + DieaID + "]"; UltilFunc.Log_Action(_user.UserID, _user.UserName, DateTime.Now, int.Parse(Request["Menu_ID"].ToString()), ActionsCode); } else { if (DateTime.Parse(txt_FromDate.Text.Trim(), new System.Globalization.CultureInfo("fr-FR")) > DateTime.Parse(txt_ToDate.Text.Trim(), new System.Globalization.CultureInfo("fr-FR")) || DateTime.Parse(txt_FromDate.Text.Trim() + " 23:59:59", new System.Globalization.CultureInfo("fr-FR")) < DateTime.Now) { FuncAlert.AlertJS(this, "Ngày bắt đầu phải lớn hơn hoặc bằng ngày hiện tại và nhỏ hơn hoặc bằng ngày kết thúc!"); return; } if (cbo_NguoiNhan.SelectedIndex == 0) { FuncAlert.AlertJS(this, "Trước khi lưu bạn phải chọn người nhận việc "); return; } _obj = SetItem1(); id = _objT_AllDAL.InsertT_Allotment(_obj); _t_idiea = SetItem(); id = _T_dieaDAL.InsertT_Idiea(_t_idiea); if (_T_dieaDAL.GetOneFromT_IdieaByID(int.Parse(DieaID.ToString())).Diea_Lock == true && _T_dieaDAL.GetOneFromT_IdieaByID(int.Parse(DieaID.ToString())).User_Edit != _user.UserID) { FuncAlert.AlertJS(this, "Bài đang có người làm việc.!"); return; } _T_dieaDAL.IsLock(DieaID, 0, _user.UserID, DateTime.Now); _T_dieaDAL.Update_Status_tintuc(DieaID, 52, _user.UserID, DateTime.Now, 0); _T_dieaDAL.Insert_Version_From_T_idiea_WithUserModify(DieaID, 2, 52, _user.UserID, DateTime.Now); ActionsCode = "[Gửi Duyệt(TBT)][Diea_ID:" + DieaID + "]"; UltilFunc.Log_Action(_user.UserID, _user.UserName, DateTime.Now, int.Parse(Request["Menu_ID"].ToString()), ActionsCode); } _T_dieaDAL.IsLock(DieaID, 0, _user.UserID, DateTime.Now); if (int.Parse(Page.Request["Tab"].ToString()) != 0) { Response.Redirect("List_DuyetDeTaiTPPV.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&Tab=" + Page.Request["Tab"].ToString()); } else { Response.Redirect("List_DuyetDeTaiTPPV.aspx?Menu_ID=" + Request["Menu_ID"].ToString()); } }