Ejemplo n.º 1
0
        private void GetItem(double _id)
        {
            T_Congviec  _objCongViec = new T_Congviec();
            CongviecDAL _CongViecDAL = new CongviecDAL();

            _objCongViec            = _CongViecDAL.GetOneFromT_CongviecByID(_id);
            txt_tencongviec.Text    = _objCongViec.Tencongviec;
            this.txt_NoidungCV.Text = _objCongViec.Noidung_Congviec;

            if (_objCongViec.Phong_ID > 0)
            {
                this.cbo_room.SelectedIndex = CommonLib.GetIndexControl(cbo_room, _objCongViec.Phong_ID.ToString());
            }
            BinddDropDownList(double.Parse(cbo_room.SelectedValue));
            if (_objCongViec.NguoiNhan > 0)
            {
                this.cbo_nguoinhan.SelectedIndex = CommonLib.GetIndexControl(cbo_nguoinhan, _objCongViec.NguoiNhan.ToString());
            }

            this.txt_NgayHT.Text = _objCongViec.NgayHoanthanh.ToString("dd/MM/yyyy");
            txt_phanhoi.Text     = _objCongViec.Vet;
            if (_objCongViec.Attachfile != "")
            {
                txt_attachfile.Visible = true;
                txt_attachfile.HRef    = System.Configuration.ConfigurationManager.AppSettings["viewimg"].ToString() + _objCongViec.Attachfile;
            }
            else
            {
                txt_attachfile.Visible = false;
            }
        }
Ejemplo n.º 2
0
        public void grdListCVCanLam_EditCommand(object source, DataGridCommandEventArgs e)
        {
            string Thaotac = string.Empty;
            string _ID     = string.Empty;

            if (TabContainerListCV.ActiveTabIndex == 0)
            {
                _ID = grdListCVCanLam.DataKeys[e.Item.ItemIndex].ToString();
            }
            else if (TabContainerListCV.ActiveTabIndex == 1)
            {
                _ID = grdListTheodoi.DataKeys[e.Item.ItemIndex].ToString();
            }
            int tab = 0;

            tab = TabContainerListCV.ActiveTabIndex;
            TextBox txt_phanhoi = (TextBox)e.Item.FindControl("txt_phanhoi");

            if (e.CommandArgument.ToString().ToLower() == "edit")
            {
                if (tab != 1)
                {
                    Response.Redirect("~/Congviec/NoidungCV.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + _ID + "&Tab=" + tab.ToString());
                }
                else
                {
                    Response.Redirect("~/Congviec/EditCongviec.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + _ID + "&Tab=" + tab.ToString());
                }
            }
            else if (e.CommandArgument.ToString().ToLower() == "nhanviec")
            {
                string sql = "update T_Congviec set Loai=0,Vet=N'" + txt_phanhoi.Text.Trim() + "', NguoiNhan=" + _user.UserID + ", TenNguoiNhan=N'" + _user.UserFullName + "' where Ma_Congviec=" + _ID;
                ulti.ExecSql(sql);
                Thaotac = _user.UserFullName + "thực hiện nhận việc " + _DALCV.GetOneFromT_CongviecByID(double.Parse(_ID)).Tencongviec;
            }
            else if (e.CommandArgument.ToString().ToLower() == "finishcv")
            {
                string sql     = string.Empty;
                int    _status = UltilFunc.GetColumnValuesOne("T_Congviec", "Status", " Ma_Congviec=" + _ID);
                if (_status == 0)
                {
                    sql = "update T_Congviec set Status=1,Vet=N'" + txt_phanhoi.Text.Trim() + "', NguoiNhan=" + _user.UserID + ", TenNguoiNhan=N'" + _user.UserFullName + "' where Ma_Congviec=" + _ID;
                }
                else
                {
                    sql = "update T_Congviec set Status=0,Vet=N'" + txt_phanhoi.Text.Trim() + "', NguoiNhan=" + _user.UserID + ", TenNguoiNhan=N'" + _user.UserFullName + "' where Ma_Congviec=" + _ID;
                }
                ulti.ExecSql(sql);
                Thaotac = _user.UserFullName + "thực hiện hoàn thành công việc " + _DALCV.GetOneFromT_CongviecByID(double.Parse(_ID)).Tencongviec;
            }
            else if (e.CommandArgument.ToString().ToLower() == "cancelcv")
            {
                string sql = "update T_Congviec set Status=0, Vet=N'" + txt_phanhoi.Text.Trim() + "',NguoiNhan=0, TenNguoiNhan=N'" + _user.UserFullName + "' where Ma_Congviec=" + _ID;
                ulti.ExecSql(sql);
                Thaotac = _user.UserFullName + "thực hiện hủy việc " + _DALCV.GetOneFromT_CongviecByID(double.Parse(_ID)).Tencongviec;
            }
            else if (e.CommandArgument.ToString().ToLower() == "phanhoi")
            {
                string sql = "update T_Congviec set Vet=N'" + txt_phanhoi.Text.Trim() + "',TenNguoiNhan=N'" + _user.UserFullName + "' where Ma_Congviec=" + _ID;
                ulti.ExecSql(sql);
            }
            else if (e.CommandArgument.ToString().ToLower() == "delete")
            {
                Thaotac = "Thực hiện xóa công viêc " + _DALCV.GetOneFromT_CongviecByID(double.Parse(_ID)).Tencongviec;
                _DALCV.DeleteOneFromT_Congviec(double.Parse(_ID), _user.UserID);
            }
            UltilFunc.Log_Action(_user.UserID, _user.UserFullName, DateTime.Now, int.Parse(Request["Menu_ID"]), Thaotac);
            this.TabContainerListCV.ActiveTabIndex = tab;
            this.TabContainer1_ActiveTabChanged(source, e);
        }