Exemplo n.º 1
0
 protected void linkExit_Click(object sender, EventArgs e)
 {
     HPCBusinessLogic.DAL.T_IdieaDAL Dal = new HPCBusinessLogic.DAL.T_IdieaDAL();
     Dal.IsLock(double.Parse(Page.Request["id"].ToString()), 0, _user.UserID, DateTime.Now);
     if (Page.Request["Tab"].ToString() != "-1")
     {
         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());
     }
 }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
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();
            }
        }
Exemplo n.º 4
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());
                }
            }
        }
Exemplo n.º 5
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());
            }
        }