Example #1
0
        void PopulateItem(int _ID)
        {
            T_Idiea obj_Idiea = new T_Idiea();

            HPCBusinessLogic.DAL.T_IdieaDAL obj_DAL = new HPCBusinessLogic.DAL.T_IdieaDAL();
            obj_Idiea             = obj_DAL.GetOneFromT_IdieaByID(_ID);
            Txt_tieude.Text       = obj_Idiea.Title;
            ddlLang.SelectedValue = obj_Idiea.Lang_ID.ToString();

            if (ddlLang.SelectedIndex > 0)
            {
                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;
            if (obj_Idiea.Diea_Stype == 1)
            {
                txt_noidungbaiviet.Text = obj_Idiea.Diea_Articles;
                cbb_Loai.SelectedValue  = obj_Idiea.Diea_Stype.ToString();
            }
            else
            {
                lb_noidungbaiviet.Visible  = false;
                txt_noidungbaiviet.Visible = false;
                cbb_Loai.SelectedValue     = "2";
            }
        }
Example #2
0
        private void PopulateItem(int _ID)
        {
            T_Idiea obj_Idiea = new T_Idiea();

            HPCBusinessLogic.DAL.T_IdieaDAL obj_DAL = new HPCBusinessLogic.DAL.T_IdieaDAL();
            obj_Idiea             = obj_DAL.GetOneFromT_IdieaByID(_ID);
            Txt_tieude.Text       = obj_Idiea.Title;
            txt_noidung.Text      = obj_Idiea.Comment;
            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(" Hoatdong=1 and Ma_Anpham= " + this.ddlLang.SelectedValue + " AND Ma_Chuyenmuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), "---Tất 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();
            }
            if (obj_Idiea.Diea_Stype == 1)
            {
                txt_noidungbaiviet.Text      = obj_Idiea.Diea_Articles;
                cbb_Loai.SelectedValue       = obj_Idiea.Diea_Stype.ToString();
                this.pnlEdit_Editor1.Visible = false;
            }
            else
            {
                if (Page.Request["Tab"].ToString() == "1")
                {
                    this.pnlEdit_Editor1.Visible = true;
                    lb_noidungbaiviet.Visible    = true;
                    txt_noidungbaiviet.Visible   = true;
                    cbb_Loai.SelectedValue       = "2";
                    txt_noidungbaiviet.Text      = obj_Idiea.Diea_Articles;
                    txt_FromDate.Text            = obj_Idiea.Date_From.ToString();
                    txt_ToDate.Text = obj_Idiea.Date_To.ToString();
                    BindComboxNguoiNhan(0);
                    cbo_NguoiNhan.SelectedValue = obj_Idiea.User_NguoiNhan.ToString();
                    ddlGroup.Enabled            = false;
                    cbo_NguoiNhan.Enabled       = false;
                    txt_FromDate.Enabled        = false;
                    txt_ToDate.Enabled          = false;
                    cbb_LoaiBaiviet.Enabled     = false;
                }
                else
                {
                    this.pnlEdit_Editor1.Visible = true;
                    lb_noidungbaiviet.Visible    = false;
                    txt_noidungbaiviet.Visible   = false;
                    cbb_Loai.SelectedValue       = "2";
                }
            }
        }
Example #3
0
        protected void dgData_EditCommand1(object source, DataGridCommandEventArgs e)
        {
            if (e.CommandArgument.ToString().ToLower() == "edit")
            {
                int tab = TabContainer1.ActiveTabIndex;

                HPCBusinessLogic.DAL.T_IdieaDAL Dal = new HPCBusinessLogic.DAL.T_IdieaDAL();
                string _ID = dgr_tintuc2.DataKeys[e.Item.ItemIndex].ToString();

                if (Dal.GetOneFromT_IdieaByID(int.Parse(_ID)).Diea_Lock == true && Dal.GetOneFromT_IdieaByID(int.Parse(_ID)).User_Edit != _user.UserID)
                {
                    System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Bài đang có người làm việc.!');", true);
                    return;
                }
                //Dal.Update_Status_tintuc(double.Parse(_ID), 23, _user.UserID, DateTime.Now);
                Dal.IsLock(double.Parse(_ID), 1, _user.UserID, DateTime.Now);// trang thai bai lock

                Response.Redirect("Edit_DuyetDeTaiTPPV.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&ID=" + _ID.ToString() + "&Tab=" + tab);
            }
        }
Example #4
0
        public T_Idiea SetItem()
        {
            T_Idiea obj_Idiea = new T_Idiea();

            HPCBusinessLogic.DAL.T_IdieaDAL Dal = new HPCBusinessLogic.DAL.T_IdieaDAL();
            if (Page.Request.Params["id"] != null)
            {
                obj_Idiea = Dal.GetOneFromT_IdieaByID(int.Parse(Page.Request["id"].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.Lang_ID      = Convert.ToInt32(this.ddlLang.SelectedValue.ToString());
            obj_Idiea.Date_Edit    = DateTime.Now;
            obj_Idiea.User_Edit    = _user.UserID;
            obj_Idiea.Diea_Lock    = true;
            obj_Idiea.Diea_Stype   = int.Parse(cbb_Loai.SelectedValue.ToString());
            if (cbb_Loai.Visible == true)
            {
                obj_Idiea.Diea_Articles = txt_noidungbaiviet.Text;
            }
            if (Page.Request["Tab"] != null)
            {
                tab = Convert.ToInt32(Page.Request["Tab"].ToString());
            }
            if (tab == 0)
            {
                obj_Idiea.Status = 62;
            }
            else if (tab == -1)
            {
                obj_Idiea.Status = 62;
            }
            else if (tab == 1)
            {
                obj_Idiea.Status = 63;
            }

            return(obj_Idiea);
        }
Example #5
0
        private void LoadComboBox()
        {
            int     id  = int.Parse(Page.Request.QueryString["ID"].ToString());
            T_Idiea obj = new T_Idiea();

            HPCBusinessLogic.DAL.T_IdieaDAL dal = new HPCBusinessLogic.DAL.T_IdieaDAL();
            int _curentID = dal.GetOneFromT_IdieaByID(id).User_Created;

            UltilFunc.BindCombox(ddlLang, "ID", "TenNgonNgu", "T_NgonNgu", " Hoatdong=1 and ID=" + HPCComponents.Global.DefaultCombobox + " and ID in (select Ma_Ngonngu from T_Nguoidung_NgonNgu where Ma_Nguoidung=" + _user.UserID + ")", "---Tất cả---");

            ddlLang.SelectedIndex = UltilFunc.GetIndexControl(ddlLang, HPCComponents.Global.DefaultCombobox);
            if (ddlLang.SelectedIndex != 0)
            {
                UltilFunc.BindCombox_CategoryDequy(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", " WHERE Hoatdong=1 and  Ma_ChuyenMuc in (select Ma_ChuyenMuc from T_Nguoidung_Chuyenmuc where Ma_Nguoidung = " + _user.UserID.ToString() + ") and Ma_AnPham= " + ddlLang.SelectedValue, "-Chọn chuyên mục-", "Ma_Chuyenmuc_Cha");
            }
            UltilFunc.BindCombox(ddlGroup, "Ma_nhom", "Ten_nhom", "T_Nhom", " 1=1  Order by Ten_Nhom", "");
            BindComboxNguoiNhan(0);
        }
Example #6
0
        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);
        }
Example #7
0
        protected void PopulateItem(int _ID)
        {
            T_Idiea obj_Idiea = new T_Idiea();

            HPCBusinessLogic.DAL.T_IdieaDAL obj_DAL = new HPCBusinessLogic.DAL.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_CategoryDequy(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", " WHERE Hoatdong=1 and Ma_ChuyenMuc in (select Ma_ChuyenMuc from T_Nguoidung_Chuyenmuc where Ma_Nguoidung = " + _user.UserID.ToString() + ") and Ma_AnPham= " + ddlLang.SelectedValue, "-Chọn chuyên mục-", "Ma_Chuyenmuc_Cha");

                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;
        }
Example #8
0
        private void Gui_TraLai()
        {
            HPCBusinessLogic.DAL.T_IdieaDAL _T_IdieaDAL = new HPCBusinessLogic.DAL.T_IdieaDAL();
            ArrayList ar     = new ArrayList();
            string    sOrder = GetOrderString() == "" ? "" : " ORDER BY " + GetOrderString();

            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()));
                    }
                }
            }
            else if (TabContainer1.ActiveTabIndex == 2)
            {
                foreach (DataGridItem m_Item in dgr_tintuc3.Items)
                {
                    CheckBox chk_select = (CheckBox)m_Item.FindControl("optSelect");
                    if (chk_select != null && chk_select.Checked)
                    {
                        ar.Add(double.Parse(dgr_tintuc3.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString()));
                    }
                }
            }
            if (TabContainer1.ActiveTabIndex == 0)
            {
                LoadData_DangXuly();
            }
            else if (TabContainer1.ActiveTabIndex == 1)
            {
                LoadData_Bitralai();
            }
            else if (TabContainer1.ActiveTabIndex == 2)
            {
                Load_DaPhanViec();
            }

            for (int i = 0; i < ar.Count; i++)
            {
                double Diea_ID = double.Parse(ar[i].ToString());

                if (_T_IdieaDAL.GetOneFromT_IdieaByID(int.Parse(Diea_ID.ToString())).Diea_Lock == true && _T_IdieaDAL.GetOneFromT_IdieaByID(int.Parse(Diea_ID.ToString())).User_Edit != _user.UserID)
                {
                    System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Bài đang có người làm việc.!');", true);
                    return;
                }
                _T_IdieaDAL.IsLock(Diea_ID, 0, _user.UserID, DateTime.Now);
                _T_IdieaDAL.Update_Status_tintuc(Diea_ID, 33, _user.UserID, DateTime.Now, 0);
                _T_IdieaDAL.Insert_Version_From_T_idiea_WithUserModify(Diea_ID, 2, 33, _user.UserID, DateTime.Now);

                ActionsCode = "[Danh sách Đề tài đang chờ xử lý TPPV:]-->[Trả Lại(PV)][Diea_ID:" + Diea_ID + "]";
                UltilFunc.Log_Action(_user.UserID, _user.UserName, DateTime.Now, int.Parse(Request["Menu_ID"].ToString()), ActionsCode);
            }
            if (TabContainer1.ActiveTabIndex == 0)
            {
                LoadData_DangXuly();
                DataSet _dsReturn;
                _dsReturn = _T_IdieaDAL.BindGridT_IdieaEditor(pages.PageIndex, pages.PageSize, BuildSQL(22, sOrder));
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "javascript", "javascript: SetInnerBaiChuaPhanCong(" + _dsReturn.Tables[1].Rows[0].ItemArray[0].ToString() + ");", true);
                _dsReturn.Clear();
            }
            else if (TabContainer1.ActiveTabIndex == 1)
            {
                LoadData_Bitralai();
                DataSet _dsReturn;
                _dsReturn = _T_IdieaDAL.BindGridT_IdieaEditor(pages2.PageIndex, pages2.PageSize, BuildSQL(23, sOrder));
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "javascript", "javascript: SetInnerBaiDaHoanThanh(" + _dsReturn.Tables[1].Rows[0].ItemArray[0].ToString() + ");", true);
                _dsReturn.Clear();
            }
            else if (TabContainer1.ActiveTabIndex == 2)
            {
                Load_DaPhanViec();
                DataSet _dsReturn;
                _dsReturn = _T_IdieaDAL.BindGridT_IdieaEditor(Pager3.PageIndex, Pager3.PageSize, BuildSQL(26, sOrder));
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "javascript", "javascript: SetInnerBaiDaPhanCong(" + _dsReturn.Tables[1].Rows[0].ItemArray[0].ToString() + ");", true);
                _dsReturn.Clear();
            }
        }
Example #9
0
        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());
                }
            }
        }
Example #10
0
        public T_Idiea SetItem()
        {
            T_Idiea obj_Idiea = new T_Idiea();

            HPCBusinessLogic.DAL.T_IdieaDAL _objDAL = new HPCBusinessLogic.DAL.T_IdieaDAL();
            if (Page.Request.Params["ID"] != null && cbb_Loai.SelectedValue == "1")
            {
                obj_Idiea               = _objDAL.GetOneFromT_IdieaByID(int.Parse(Page.Request["id"].ToString()));
                obj_Idiea.Diea_Stype    = 1;
                obj_Idiea.Diea_Articles = txt_noidungbaiviet.Text;
            }
            else
            {
                obj_Idiea = _objDAL.GetOneFromT_IdieaByID(int.Parse(Page.Request["id"].ToString()));
                if (Page.Request["Tab"] != null)
                {
                    int _tab = Convert.ToInt32(Page.Request["Tab"].ToString());
                    if (_tab == 2)
                    {
                        obj_Idiea.Status = 26;
                    }
                    else
                    {
                        obj_Idiea.Status = 23;
                    }
                }
                obj_Idiea.Diea_Stype     = 2;
                obj_Idiea.Date_From      = txt_FromDate.Text;
                obj_Idiea.Date_To        = txt_ToDate.Text;
                obj_Idiea.User_NguoiNhan = int.Parse(cbo_NguoiNhan.SelectedValue);
            }
            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 (txt_noidungbaiviet.Text.Length > 0)
            {
                obj_Idiea.Diea_Articles = txt_noidungbaiviet.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.Lang_ID      = Convert.ToInt32(this.ddlLang.SelectedValue.ToString());
            obj_Idiea.Date_Edit    = DateTime.Now;
            obj_Idiea.User_Edit    = _user.UserID;


            if (Page.Request["Tab"] != null)
            {
                tab = Convert.ToInt32(Page.Request["Tab"].ToString());
            }

            return(obj_Idiea);
        }
Example #11
0
        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());
            }
        }