Ejemplo n.º 1
0
        //查询
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            T_Train_Rec_MDL trMdl = new T_Train_Rec_MDL();

            Search(tblSearch, trMdl);
            BindGridView();
        }
        /// <summary>
        ///  新增培训记录
        /// </summary>
        /// <param name="TrainPlanID"></param>
        /// <param name="ltUserID"></param>
        protected void AddTrainRec(int TrainPlanID, List <string> ltUserID)
        {
            if (ltUserID.Count > 0)
            {
                foreach (string UserID in ltUserID)
                {
                    if (Common.ConvertEx.ToInt(UserID) > 0)
                    {
                        T_Train_Rec_MDL trMDL = new T_Train_Rec_MDL();
                        trMDL.UserID      = Common.ConvertEx.ToInt(UserID);
                        trMDL.TrainPlanID = TrainPlanID;
                        new T_Train_Rec_BLL().Add(trMDL);


                        //更改用户的培训记录
                        T_UsersInfo_BLL uiBll = new T_UsersInfo_BLL();
                        T_UsersInfo_MDL uiMdl = uiBll.GetModel(Common.ConvertEx.ToInt(UserID));

                        int TrainCount = Common.ConvertEx.ToInt(uiMdl.TrainCount);//得到档案员的当前培训次数
                        uiMdl.TrainCount = TrainCount + 1;

                        uiBll.Update(uiMdl);
                    }
                }
            }
        }