private void btnFindAll_Click(object sender, EventArgs e)
        {
            //if (TextUtils.ToString(grvUser.GetFocusedRowCellValue(colUserId)) == "")
            //{
            //    grdData.DataSource = null;
            //    return;
            //}
            string[] _paraName  = new string[4];
            object[] _paraValue = new object[4];
            _paraName[0] = "@StartDate"; _paraValue[0] = TextUtils.ToDate2(dtpStartDate.EditValue);
            _paraName[1] = "@EndDate"; _paraValue[1] = TextUtils.ToDate2(dtpEndDate.EditValue);
            _paraName[2] = "@UserId"; _paraValue[2] = "";// TextUtils.ToString(grvUser.GetFocusedRowCellValue(colUserId));
            _paraName[3] = "@DepartmentId"; _paraValue[3] = TextUtils.ToString(cboDepartment.EditValue);
            DataTable Source = LibQLSX.LoadDataFromSP("spGetWorkingDiaries", "Source", _paraName, _paraValue);

            grdData.DataSource = Source;
            //Focus con trỏ chuột tại dòng đã select khi load lại dữ liệu
            if (_rownIndex >= grvData.RowCount)
            {
                _rownIndex = 0;
            }
            if (_rownIndex > 0)
            {
                grvData.FocusedRowHandle = _rownIndex;
            }
            grvData.SelectRow(_rownIndex);
            //grvData.BestFitColumns();

            type = 1;
        }
Exemple #2
0
        void loadData()
        {
            if (dtpWorkingDate.EditValue == null)
            {
                return;
            }
            if (dtpWorkingDate.EditValue == null)
            {
                return;
            }
            if (cboUser.EditValue == null)
            {
                return;
            }

            string[] _paraName  = new string[4];
            object[] _paraValue = new object[4];
            _paraName[0] = "@StartDate"; _paraValue[0] = TextUtils.ToDate2(dtpWorkingDate.EditValue);
            _paraName[1] = "@EndDate"; _paraValue[1] = TextUtils.ToDate2(dtpWorkingDate.EditValue);
            _paraName[2] = "@UserId"; _paraValue[2] = TextUtils.ToString(cboUser.EditValue);
            _paraName[3] = "@DepartmentId"; _paraValue[3] = "";
            DataTable Source = LibQLSX.LoadDataFromSP("spGetWorkingDiaries", "Source", _paraName, _paraValue);

            grdData.DataSource = Source;
        }
Exemple #3
0
        void loadData()
        {
            string[] _paraName  = new string[4];
            object[] _paraValue = new object[4];

            _paraName[0] = "@Period"; _paraValue[0] = 3;
            _paraName[1] = "@Status"; _paraValue[1] = 1;

            DataTable dt = new DataTable();

            if (Global.AppUserName == "khoi.pd" || Global.AppUserName == "thao.nv")
            {
                _paraName[2] = "@Account"; _paraValue[2] = "";
            }
            else
            {
                _paraName[2] = "@Account"; _paraValue[2] = Global.AppUserName;
            }

            _paraName[3] = "@IsCompleted"; _paraValue[3] = cboIsCompleted.SelectedIndex;

            dt = LibQLSX.LoadDataFromSP("spGetProposalProblem", "PP", _paraName, _paraValue);

            grdYCMVT.DataSource = dt;
            if (_rownIndex >= grvYCMVT.RowCount)
            {
                _rownIndex = 0;
            }
            if (_rownIndex > 0)
            {
                grvYCMVT.FocusedRowHandle = _rownIndex;
            }
            grvYCMVT.SelectRow(_rownIndex);
        }
        private void btnXemTatCa_Click(object sender, EventArgs e)
        {
            string[] _paraName  = new string[3];
            object[] _paraValue = new object[3];
            _paraName[0] = "@StartDate"; _paraValue[0] = TextUtils.ToDate2(dtpStartDate.EditValue);
            _paraName[1] = "@EndDate"; _paraValue[1] = TextUtils.ToDate2(dtpEndDate.EditValue);
            _paraName[2] = "@DepartmentId"; _paraValue[2] = TextUtils.ToString(cboDepartment.EditValue);
            DataTable Source = LibQLSX.LoadDataFromSP("spReport_NKCV_ForDate", "Source", _paraName, _paraValue);

            grdData.DataSource = Source;
        }
        void loadGrid()
        {
            DataTable dt = LibQLSX.Select("select top 1 * from vChucVu where Account = '" + Global.LoginName + "'");

            if (dt.Rows.Count == 0)
            {
                MessageBox.Show("Tài khoản trên QLSX và quản lý thiết kế của bạn đang khác nhau", TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            string[] _paraName  = new string[6];
            object[] _paraValue = new object[6];
            _paraName[0] = "@StartDate"; _paraValue[0] = TextUtils.ToDate2(dtpStartDate.EditValue);
            _paraName[1] = "@EndDate"; _paraValue[1] = TextUtils.ToDate2(dtpEndDate.EditValue);
            _paraName[2] = "@UserId"; _paraValue[2] = TextUtils.ToString(dt.Rows[0]["UserId"]);
            _paraName[3] = "@DepartmentId"; _paraValue[3] = TextUtils.ToString(cboDepartment.EditValue);
            _paraName[4] = "@GroupUserId";
            _paraName[5] = "@LeaderId";
            if (TextUtils.HasPermission("frmWorkingDiariesManager_ViewAll"))
            {
                _paraValue[2] = "1";
                _paraValue[4] = "";
                _paraValue[5] = "";
            }
            else
            {
                string departmentCode = TextUtils.ToString(dt.Rows[0]["DCode"]);
                string groupCode      = TextUtils.ToString(dt.Rows[0]["GroupCode"]);
                if (departmentCode == "" && groupCode == "")
                {
                    _paraValue[4] = "0";
                    _paraValue[5] = "0";
                }
                else
                {
                    _paraValue[4] = groupCode != "" ? TextUtils.ToString(dt.Rows[0]["UserId"]) : "";
                    _paraValue[5] = departmentCode != "" ? TextUtils.ToString(dt.Rows[0]["UserId"]) : "";
                }
            }

            DataTable Source = LibQLSX.LoadDataFromSP("spGetWorkingDiaries", "Source", _paraName, _paraValue);

            grdData.DataSource = Source;
        }
        private void btnXemTatCa_Click(object sender, EventArgs e)
        {
            string[] _paraName  = new string[4];
            object[] _paraValue = new object[4];
            _paraName[0] = "@StartDate"; _paraValue[0] = TextUtils.ToDate2(dtpStartDate.EditValue);
            _paraName[1] = "@EndDate"; _paraValue[1] = TextUtils.ToDate2(dtpEndDate.EditValue);
            _paraName[2] = "@UserId"; _paraValue[2] = "";
            _paraName[3] = "@DepartmentId"; _paraValue[3] = TextUtils.ToString(cboDepartment.EditValue);
            DataTable Source = LibQLSX.LoadDataFromSP("spGetWorkingDiaries", "Source", _paraName, _paraValue);

            grdData.DataSource = Source;
            //Focus con trỏ chuột tại dòng đã select khi load lại dữ liệu
            //if (_rownIndex >= grvData.RowCount)
            //    _rownIndex = 0;
            //if (_rownIndex > 0)
            //    grvData.FocusedRowHandle = _rownIndex;
            //grvData.SelectRow(_rownIndex);
            //grvData.BestFitColumns();

            type = 2;
        }
        void loadData(int type = 0)
        {
            try
            {
                using (WaitDialogForm fWait = new WaitDialogForm("Vui lòng chờ trong giây lát...", "Đang load dữ liệu..."))
                {
                    string[] paraName  = new string[2];
                    object[] paraValue = new object[2];

                    //paraName[0] = "@RecordPerPage"; paraValue[0] = _RecordPerPage;
                    //paraName[1] = "@PageIndex"; paraValue[1] = 1;
                    paraName[0] = "@TextFind"; paraValue[0] = txtName.Text.Trim();
                    if (type == 0)
                    {
                        paraName[1] = "@GroupId"; paraValue[1] = TextUtils.ToString(grvGroup.GetFocusedRowCellValue(colGroupId));
                    }
                    else
                    {
                        paraName[1] = "@GroupId"; paraValue[1] = "";
                    }

                    //_dtMaterial = SuppliersBO.Instance.LoadDataFromSP("spGetMaterialQLSX1", "Source", paraName, paraValue);
                    _dtMaterial        = LibQLSX.LoadDataFromSP("spGetMaterialQLSX1", "t", paraName, paraValue);
                    grdData.DataSource = _dtMaterial;

                    if (_rownIndex >= grvData.RowCount)
                    {
                        _rownIndex = 0;
                    }
                    if (_rownIndex > 0)
                    {
                        grvData.FocusedRowHandle = _rownIndex;
                    }
                    grvData.SelectRow(_rownIndex);
                }
            }
            catch
            {
            }
        }