コード例 #1
0
        public void BindData()
        {
            #region
            //if (!Context.User.Identity.IsAuthenticated)
            //{
            //    return;
            //}
            //AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name);
            //if (user.HasPermissionID(PermId_Modify))
            //{
            //    gridView.Columns[6].Visible = true;
            //}
            //if (user.HasPermissionID(PermId_Delete))
            //{
            //    gridView.Columns[7].Visible = true;
            //}
            #endregion

            DataSet       ds       = new DataSet();
            StringBuilder strWhere = new StringBuilder();
            if (txtKeyword.Text.Trim() != "")
            {
                #warning 代码生成警告:请修改 keywordField 为需要匹配查询的真实字段名称
                //strWhere.AppendFormat("keywordField like '%{0}%'", txtKeyword.Text.Trim());
            }
            ds = bll.GetList(strWhere.ToString());
            gridView.DataSource = ds;
            gridView.DataBind();
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sal_ID"></param>
        private void ShowInfo(int sta_ID)
        {
            DataSet ds = bll.GetList("sal_sta_id=" + sta_ID + " and sal_date=(SELECT MAX(t_staffsalary.sal_date) from t_staffsalary where sal_sta_id=" + sta_ID + ")");

            WalleProject.Model.t_staffsalary model = new Model.t_staffsalary();
            if (ds.Tables[0].Rows.Count != 0)
            {
                foreach (DataTable table in ds.Tables)
                {
                    model = bll.GetModel(int.Parse(table.Rows[0]["sal_ID"].ToString()));
                }
            }

            this.lblsal_staff.Text = sta_ID.ToString();
            if (model != null && model.sal_year == DateTime.Now.Year && model.sal_month == DateTime.Now.Month)
            {
                this.lblsal_ID.Text             = model.sal_ID.ToString();
                this.txtsal_bonusM.Text         = model.sal_bonusM.ToString();
                this.txtsal_describe.Value      = model.sal_describe;
                this.txtsal_deductM.Text        = model.sal_deductM.ToString();
                this.txtsal_totalM.Text         = model.sal_totalM.ToString();
                this.txtsal_incrementM.Text     = model.sal_incrementM.ToString();
                this.txtSal_leaveDay.Text       = model.Sal_leaveDay.ToString();
                this.txtSal_absenteeismDay.Text = model.Sal_absenteeismDay.ToString();
            }
            else
            {
                this.lblsal_ID.Text             = new BLL.t_staffsalary().GetMaxId().ToString();
                this.txtsal_bonusM.Text         = "0.0";
                this.txtsal_describe.Value      = " ";
                this.txtsal_deductM.Text        = "0.0";
                this.txtsal_totalM.Text         = new BLL.t_staff().GetModel(sta_ID).sta_salary.ToString();
                this.txtsal_incrementM.Text     = "0.0";
                this.txtSal_leaveDay.Text       = "0";
                this.txtSal_absenteeismDay.Text = "0";
            }
        }