Ejemplo n.º 1
0
        private void frmStaffMasterDetail_Load(object sender, EventArgs e)
        {
            if (_editInfo == null)
            {
                _editInfo = this.BaseParam as CardUserMaster_cus_Info;
            }

            if (this.EditState == Common.DefineConstantValue.EditStateEnum.OE_Insert)
            {
                this.Text = "新增 - " + this.Text;

                UserInputData insertInfo = new UserInputData();

                proUserData.SelectedObject = insertInfo;
            }
            else if (this.EditState == Common.DefineConstantValue.EditStateEnum.OE_Update)
            {
                this.Text = "查看 - " + this.Text;
                btnAutoNum.Enabled = false;

                UserInputData showData = new UserInputData(_editInfo);

                proUserData.SelectedObject = showData;
            }
        }
Ejemplo n.º 2
0
        public dlgCardReturnCheck(CardUserMaster_cus_Info CardUserInfo)
        {
            InitializeComponent();

            this._ListCheckedUsers = new List<CardUserMaster_cus_Info>();
            this._ListCheckedUsers.Add(CardUserInfo);
        }
Ejemplo n.º 3
0
        public frmChangeCard()
        {
            InitializeComponent();

            this._info = null;

            this._userCardPairBL = MasterBLLFactory.GetBLL<IUserCardPairBL>(MasterBLLFactory.UserCardPair);
        }
Ejemplo n.º 4
0
        public void ShowForm(CardUserMaster_cus_Info editInfo, Common.DefineConstantValue.EditStateEnum editStatc)
        {
            this._editInfo = editInfo;

            this.EditState = editStatc;

            this.ShowDialog();
        }
Ejemplo n.º 5
0
        public dlgGraduationCheck(CardUserMaster_cus_Info UserInfo)
        {
            InitializeComponent();

            List<CardUserMaster_cus_Info> listUserInfos = new List<CardUserMaster_cus_Info>();
            listUserInfos.Add(UserInfo);
            this._UserInfos = listUserInfos;
        }
Ejemplo n.º 6
0
        public frmStaffMasterDetail()
        {
            InitializeComponent();

            this._editInfo = null;

            this._hash = new Hashtable();
            this._ICardUserMasterBL = MasterBLLFactory.GetBLL<ICardUserMasterBL>(MasterBLLFactory.CardUserMaster);
        }
Ejemplo n.º 7
0
        public frmStudentMasterDetail()
        {
            InitializeComponent();

            this._editInfo = null;

            this._userInfos = null;

            this._cardUserMaster = MasterBLLFactory.GetBLL<ICardUserMasterBL>(MasterBLLFactory.CardUserMaster);

            _hash = new Hashtable();
        }
Ejemplo n.º 8
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                if (!String.IsNullOrEmpty(this.rspSearch.RSP_ClassID.ToString()))
                {
                    ClassMaster_csm_Info classInfo = new ClassMaster_csm_Info();

                    classInfo.csm_cRecordID = this.rspSearch.RSP_ClassID;

                    List<ClassMaster_csm_Info> csmList = _icmBL.AllRecords();

                    CardUserMaster_cus_Info cusInfo = new CardUserMaster_cus_Info();

                    if (this.rspSearch.RSP_ClassID != Guid.Empty)
                    {
                        cusInfo.cus_cClassID = this.rspSearch.RSP_ClassID;
                    }
                    else if (this.rspSearch.RSP_DepartmentID != Guid.Empty)
                    {
                        cusInfo.cus_cClassID = this.rspSearch.RSP_DepartmentID;
                    }

                    cusInfo.cus_cStudentID = this.rspSearch.RSP_StudentID;
                    cusInfo.cus_cChaName = this.rspSearch.RSP_ChaName;

                    List<CardUserAccount_cua_Info> cuaList = _imbBL.SearchRecords(cusInfo);

                    if (cuaList != null && cuaList.Count > 0)
                    {
                        cuaList = cuaList.OrderBy(p => p.cua_cClassName).OrderBy(p => p.cus_cStudentID).OrderBy(p => p.cua_dAddDate).ToList();

                        ShowReport(cuaList);
                    }
                    else
                    {
                        ShowWarningMessage("找不到符合条件的记录。");
                    }
                }
            }
            catch
            {

            }

            this.Cursor = Cursors.Default;
        }
        public void ShowForm(CardUserMaster_cus_Info userInfo, DefineConstantValue.EditStateEnum editOpt)
        {
            this._CurrentUserInfo = userInfo;
            this._EditOpt = editOpt;

            if (editOpt == Common.DefineConstantValue.EditStateEnum.OE_Insert)
            {
                this.Text = "新增--" + this.Text;

                tbxYear.Text = DateTime.Now.Year.ToString();
                tbxGraduation.Text = tbxYear.Text;
                cbxIsActive.SelectItemForValue("true");
            }
            else if (editOpt == Common.DefineConstantValue.EditStateEnum.OE_Update)
            {
                this.Text = "编辑--" + this.Text;

                labUserID.Text = userInfo.cus_cRecordID.ToString();
                tbxUserName.Text = userInfo.cus_cChaName;
                cbxClassName.SelectItemForValue(userInfo.cus_cClassID.ToString());
                tbxStuNum.Text = userInfo.cus_cStudentID;
                cbxSexName.SelectItemForValue(userInfo.cus_cSexNum);
                tbxYear.Text = userInfo.cus_cComeYear;
                tbxGraduation.Text = userInfo.cus_cGraduationPeriod;
                cbxIsActive.SelectItemForValue(userInfo.cus_lValid.ToString().ToLower());
                tbxContactName.Text = userInfo.cus_cContractName;
                tbxContactNum.Text = userInfo.cus_cContractPhone;
                tbxRemarks.Text = userInfo.cus_cRemark;
                nbxBankAccount.Text = userInfo.cus_cBankAccount;
            }
            else
            {
                return;
            }

            this.ShowDialog();
        }
Ejemplo n.º 10
0
        private void btnSelectUser_Click(object sender, EventArgs e)
        {
            dlgCardUserSelection dlg = new dlgCardUserSelection();
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                if (dlg.SelectedUser != null)
                {
                    this._CurrentUser = dlg.SelectedUser;
                    this._CurrentPair = dlg.SelectedUser.PairInfo;
                    labUserName.Text = this._CurrentUser.cus_cChaName;
                    labClassName.Text = dlg.SelectedUser.ClassInfo != null ? dlg.SelectedUser.ClassInfo.csm_cClassName : dlg.SelectedUser.DeptInfo.dpm_cName;
                    labStuNum.Text = this._CurrentUser.cus_cStudentID;

                    this.Cursor = Cursors.WaitCursor;

                    //获取当前余额
                    CardUserAccount_cua_Info accountInfo = this._ICardUserAccountBL.SearchRecords(new CardUserAccount_cua_Info()
                    {
                        cua_cCUSID = this._CurrentUser.cus_cRecordID
                    }).FirstOrDefault() as CardUserAccount_cua_Info;

                    if (accountInfo != null)
                    {
                        labAccountBalance.Text = accountInfo.cua_fCurrentBalance.ToString();
                        labAccountSyncTime.Text = accountInfo.cua_dLastSyncTime.ToString("yyyy/MM/dd HH:mm:ss");
                    }

                    tbxRefundMoney.Enabled = true;
                    tbxRefundMoney.Focus();
                    btnConfirmRefund.Enabled = false;
                    this.Cursor = Cursors.Default;
                }
            }
        }
Ejemplo n.º 11
0
        public ReturnValueInfo ResetAccountOverdraft(RechargeRecord_rcr_Info OverdraftInfo)
        {
            ReturnValueInfo rvInfo = new ReturnValueInfo();
            if (OverdraftInfo == null)
            {
                rvInfo.isError = true;
                rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
                return rvInfo;
            }
            try
            {
                //获取已发卡用户列表
                ICardUserMasterDA userDA = MasterDAFactory.GetDAL<ICardUserMasterDA>(MasterDAFactory.CardUserMaster);
                CardUserMaster_cus_Info userSearch = new CardUserMaster_cus_Info();
                userSearch.cus_cIdentityNum = Common.DefineConstantValue.CodeMasterDefine.KEY2_SIOT_CardUserIdentity_Student;
                List<CardUserMaster_cus_Info> listUsers = userDA.SearchRecordsWithCardInfo(userSearch);
                if (listUsers != null)
                {
                    listUsers = listUsers.Where(x => x.cus_lValid && x.PairCardNo != null).ToList();
                }

                //获取透支额列表
                IRechargeRecordDA rechargeDA = MasterDAFactory.GetDAL<IRechargeRecordDA>(MasterDAFactory.RechargeRecord);
                RechargeRecord_rcr_Info rechargeSearch = new RechargeRecord_rcr_Info();
                rechargeSearch.rcr_cRechargeType = Common.DefineConstantValue.ConsumeMoneyFlowType.Recharge_AdvanceMoney.ToString();
                List<RechargeRecord_rcr_Info> listRecharge = rechargeDA.SearchRecords(rechargeSearch);
                List<RechargeRecord_rcr> listRechargeRec = new List<RechargeRecord_rcr>();

                List<PreConsumeRecord_pcs> listInsertPreCost = new List<PreConsumeRecord_pcs>();
                if (listRecharge != null && listRecharge.Count > 0)
                {
                    IEnumerable<IGrouping<Guid, RechargeRecord_rcr_Info>> groupRecharge = listRecharge.GroupBy(x => x.rcr_cUserID);
                    foreach (var itemRecharge in groupRecharge)
                    {
                        Guid userID = itemRecharge.Key;
                        CardUserMaster_cus_Info userInfo = listUsers.Find(x => x.cus_cRecordID == userID);
                        if (userInfo == null)
                        {
                            continue;
                        }

                        RechargeRecord_rcr_Info userRecharge = itemRecharge.OrderByDescending(x => x.rcr_dRechargeTime).FirstOrDefault();
                        if (userRecharge != null)
                        {
                            Guid sourceID = Guid.NewGuid();
                            if (OverdraftInfo.rcr_fRechargeMoney > userRecharge.rcr_fRechargeMoney)
                            {
                                //新的透支额大于当前透支额
                            }
                            else if (OverdraftInfo.rcr_fRechargeMoney < userRecharge.rcr_fRechargeMoney)
                            {
                                //新的透支额小于当前透支额 eg: 0, 50
                                PreConsumeRecord_pcs preCost = new PreConsumeRecord_pcs();
                                preCost.pcs_cRecordID = Guid.NewGuid();
                                preCost.pcs_cSourceID = sourceID;
                                preCost.pcs_cAccountID = userInfo.AccountID.Value;
                                preCost.pcs_cAdd = OverdraftInfo.rcr_cAdd;
                                preCost.pcs_cConsumeType = Common.DefineConstantValue.ConsumeMoneyFlowType.Recharge_AdvanceMoney.ToString();
                                preCost.pcs_cUserID = userID;
                                preCost.pcs_dAddDate = DateTime.Now;
                                preCost.pcs_dConsumeDate = DateTime.Now;
                                preCost.pcs_fCost = Math.Abs(OverdraftInfo.rcr_fRechargeMoney - userRecharge.rcr_fRechargeMoney);

                                listInsertPreCost.Add(preCost);
                            }
                            else
                            {
                                continue;
                            }

                            RechargeRecord_rcr insertRechrage = Common.General.CopyObjectValue<RechargeRecord_rcr_Info, RechargeRecord_rcr>(userRecharge);
                            insertRechrage.rcr_cRecordID = sourceID;
                            insertRechrage.rcr_fRechargeMoney = OverdraftInfo.rcr_fRechargeMoney;
                            insertRechrage.rcr_fBalance = 0;
                            insertRechrage.rcr_dRechargeTime = DateTime.Now;
                            insertRechrage.rcr_cAdd = OverdraftInfo.rcr_cAdd;
                            insertRechrage.rcr_cLast = OverdraftInfo.rcr_cLast;
                            insertRechrage.rcr_cDesc = OverdraftInfo.rcr_cDesc;
                            insertRechrage.rcr_cStatus = Common.DefineConstantValue.ConsumeMoneyFlowStatus.Finished.ToString();

                            listRechargeRec.Add(insertRechrage);
                        }
                    }
                }

                if (listInsertPreCost.Count == listRechargeRec.Count && listRechargeRec.Count > 0)
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        db.Connection.Open();
                        db.Transaction = db.Connection.BeginTransaction();
                        try
                        {
                            db.RechargeRecord_rcr.InsertAllOnSubmit(listRechargeRec);
                            db.PreConsumeRecord_pcs.InsertAllOnSubmit(listInsertPreCost);
                            db.SubmitChanges();
                            db.Transaction.Commit();
                            rvInfo.boolValue = true;
                        }
                        catch (Exception exx)
                        {
                            db.Transaction.Rollback();
                            db.Connection.Close();
                            throw exx;
                        }
                    }
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
            return rvInfo;
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 获取当前用户计划定餐设置
        /// </summary>
        /// <param name="targetUser">用户信息</param>
        /// <returns></returns>
        public List<MealBookingHistory_mbh_Info> getlistMealBookingPlanning(CardUserMaster_cus_Info targetUser)
        {
            try
            {
                List<MealBookingHistory_mbh_Info> listMealPlan = new List<MealBookingHistory_mbh_Info>();

                //获取默认定餐设置
                List<PaymentUDGeneralSetting_pus_Info> listGeneralSettings = this._IPaymentUDGeneralSettingBL.SearchRecords(new PaymentUDGeneralSetting_pus_Info() { pus_iWeek = (int)DateTime.Now.DayOfWeek });

                //获取自定义定餐设置
                List<PaymentUDMealState_pms_Info> listCustomSettings = this._IPaymentUDMealStateBL.SearchRecords(new PaymentUDMealState_pms_Info()
                {
                    //pms_dStartDate = DateTime.Now.Date,
                    //pms_dEndDate = DateTime.Now.Date
                    TimeFrom = DateTime.Now.Date,
                    TimeTo = DateTime.Now.Date
                });

                foreach (Common.DefineConstantValue.MealType mealType in Enum.GetValues(typeof(Common.DefineConstantValue.MealType)))
                {
                    if (mealType == Common.DefineConstantValue.MealType.UnKnown)
                    {
                        continue;
                    }
                    MealBookingHistory_mbh_Info history = new MealBookingHistory_mbh_Info();
                    history.mbh_cMealType = mealType.ToString();

                    #region 个人--》班级--》年级

                    //学生自定义
                    PaymentUDMealState_pms_Info stuCustom = listCustomSettings.Find(x => x.pms_cCardUserID == targetUser.cus_cRecordID);
                    if (stuCustom == null)
                    {
                        //学生默认
                        PaymentUDGeneralSetting_pus_Info stuDefault = listGeneralSettings.Find(x => x.pus_cCardUserID == targetUser.cus_cRecordID);
                        if (stuDefault == null)
                        {
                            #region 班级--》年级

                            //班级自定义
                            stuCustom = listCustomSettings.Find(x => x.pms_cClassID == targetUser.cus_cClassID);
                            if (stuCustom == null)
                            {
                                //班级默认
                                stuDefault = listGeneralSettings.Find(x => x.pus_cClassID == targetUser.cus_cClassID);
                                if (stuDefault == null)
                                {
                                    if (targetUser.ClassInfo != null && targetUser.ClassInfo.GradeInfo != null)
                                    {
                                        #region 年级

                                        //年级自定义
                                        stuCustom = listCustomSettings.Find(x => x.pms_cGradeID == targetUser.ClassInfo.GradeInfo.gdm_cRecordID);
                                        if (stuCustom == null)
                                        {
                                            //年级默认
                                            stuDefault = listGeneralSettings.Find(x => x.pus_cGradeID == targetUser.ClassInfo.GradeInfo.gdm_cRecordID);
                                            if (stuDefault != null)
                                            {
                                                history.mbh_cTargetType = Common.DefineConstantValue.StuMealBookingType.GradeDefault.ToString();
                                                history.mbh_lIsSet = GetGeneralSettings(mealType.ToString(), stuDefault);
                                                listMealPlan.Add(history);
                                                continue;
                                            }
                                            else
                                            {
                                                //缺失年级默认设置时,默认不定餐
                                                history.mbh_cTargetType = Common.DefineConstantValue.StuMealBookingType.Unknown.ToString();
                                                history.mbh_lIsSet = false;
                                                listMealPlan.Add(history);
                                                continue;
                                            }
                                        }
                                        else
                                        {
                                            history.mbh_cTargetType = Common.DefineConstantValue.StuMealBookingType.GradeCustom.ToString();
                                            history.mbh_lIsSet = GetCustomMealSettings(mealType.ToString(), stuCustom);
                                            listMealPlan.Add(history);
                                            continue;
                                        }

                                        #endregion
                                    }
                                    else
                                    {
                                        //缺失年级信息时,默认不定餐
                                        history.mbh_cTargetType = Common.DefineConstantValue.StuMealBookingType.Unknown.ToString();
                                        history.mbh_lIsSet = false;
                                        listMealPlan.Add(history);
                                        continue;
                                    }
                                }
                                else
                                {
                                    history.mbh_cTargetType = Common.DefineConstantValue.StuMealBookingType.ClassDefault.ToString();
                                    history.mbh_lIsSet = GetGeneralSettings(mealType.ToString(), stuDefault);
                                    if (history.mbh_lIsSet)
                                    {
                                        CheckClassGradeIsSet(targetUser, history, listGeneralSettings, listCustomSettings, mealType.ToString());
                                    }
                                    listMealPlan.Add(history);
                                    continue;
                                }
                            }
                            else
                            {
                                history.mbh_cTargetType = Common.DefineConstantValue.StuMealBookingType.ClassCustom.ToString();
                                history.mbh_lIsSet = GetCustomMealSettings(mealType.ToString(), stuCustom);
                                if (history.mbh_lIsSet)
                                {
                                    CheckClassGradeIsSet(targetUser, history, listGeneralSettings, listCustomSettings, mealType.ToString());
                                }
                                listMealPlan.Add(history);
                                continue;
                            }

                            #endregion
                        }
                        else
                        {
                            history.mbh_cTargetType = Common.DefineConstantValue.StuMealBookingType.StudentDefault.ToString();
                            history.mbh_lIsSet = GetGeneralSettings(mealType.ToString(), stuDefault);
                            if (history.mbh_lIsSet)
                            {
                                CheckClassGradeIsSet(targetUser, history, listGeneralSettings, listCustomSettings, mealType.ToString());
                            }
                            listMealPlan.Add(history);
                            continue;
                        }
                    }
                    else
                    {
                        history.mbh_cTargetType = Common.DefineConstantValue.StuMealBookingType.StudentCustom.ToString();
                        history.mbh_lIsSet = GetCustomMealSettings(mealType.ToString(), stuCustom);
                        if (history.mbh_lIsSet)
                        {
                            CheckClassGradeIsSet(targetUser, history, listGeneralSettings, listCustomSettings, mealType.ToString());
                        }
                        listMealPlan.Add(history);
                        continue;
                    }

                    #endregion
                }

                return listMealPlan;
            }
            catch (Exception ex)
            { throw ex; }
        }
Ejemplo n.º 13
0
 public void ShowForm(CardUserMaster_cus_Info info)
 {
     this.ShowDialog();
 }
Ejemplo n.º 14
0
        private void sysToolBar_OnItemDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (lvStaffList.SelectedItems != null && lvStaffList.SelectedItems.Count > 0)
                {
                    if (!ShowQuestionMessage("是否确认需要删除此条记录?"))
                    {
                        return;
                    }

                    CardUserMaster_cus_Info delInfo = new CardUserMaster_cus_Info();
                    delInfo.cus_cRecordID = new Guid(lvStaffList.SelectedItems[0].SubItems[0].Text);

                    //级长检查
                    List<GradeMaster_gdm_Info> listGrade = this._IGradeMasterBL.SearchRecords(new GradeMaster_gdm_Info() { gdm_cPraepostorID = delInfo.cus_cRecordID });
                    if (listGrade != null && listGrade.Count > 0)
                    {
                        string strContent = "删除失败。该用户为年级长,请更新相关年级信息后重试。" + Environment.NewLine;
                        foreach (GradeMaster_gdm_Info gradeItem in listGrade)
                        {
                            strContent += gradeItem.gdm_cGradeName + Environment.NewLine;
                        }
                        ShowWarningMessage(strContent);
                        return;
                    }

                    //班级检查
                    List<ClassMaster_csm_Info> listClass = this._IClassMasterBL.SearchRecords(new ClassMaster_csm_Info() { csm_cMasterID = delInfo.cus_cRecordID });
                    if (listClass != null && listClass.Count > 0)
                    {
                        string strContent = "删除失败。该用户为班主任,请更新相关班级信息后重试。" + Environment.NewLine;
                        foreach (ClassMaster_csm_Info classItem in listClass)
                        {
                            strContent += classItem.csm_cClassName + Environment.NewLine;
                        }
                        ShowWarningMessage(strContent);
                        return;
                    }

                    //退卡检查
                    List<UserCardPair_ucp_Info> listCardUser = this._IUserCardPairBL.SearchRecords(new UserCardPair_ucp_Info() { ucp_cCUSID = delInfo.cus_cRecordID });
                    if (listCardUser != null)
                    {
                        listCardUser = listCardUser.Where(x => x.ucp_cUseStatus == Common.DefineConstantValue.ConsumeCardStatus.Normal.ToString() || x.ucp_cUseStatus == Common.DefineConstantValue.ConsumeCardStatus.LoseReporting.ToString()).ToList();
                        if (listCardUser.Count > 1)
                        {
                            string strContent = "删除失败。该用户未退卡,请退卡后重试。";
                            ShowWarningMessage(strContent);
                            return;
                        }
                    }

                    try
                    {
                        ReturnValueInfo returnInfo = this._ICardUserMasterBL.Save(delInfo, DefineConstantValue.EditStateEnum.OE_Delete);

                        if (returnInfo.boolValue)
                        {
                            ShowInformationMessage("删除成功。");

                            SearchStaffList(InputToInfo());
                        }
                        else
                        {
                            ShowWarningMessage(returnInfo.messageText);
                        }
                    }
                    catch (Exception Ex)
                    {

                        ShowErrorMessage(Ex.Message);
                    }
                }
                else
                {
                    ShowWarningMessage("请先选择删除的老师记录。");
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex);
            }

            sysToolBar.BtnModify_IsEnabled = false;
            sysToolBar.BtnNew_IsEnabled = true;
            sysToolBar.BtnRefresh_IsEnabled = true;
            sysToolBar.BtnDelete_IsEnabled = false;
            lvStaffList.SelectedItems.Clear();
        }
Ejemplo n.º 15
0
        private void ShowDetailForm(Common.DefineConstantValue.EditStateEnum editStatc)
        {
            ReturnValueInfo returnInfo = new ReturnValueInfo(false);
            CardUserMaster_cus_Info showInfo = new CardUserMaster_cus_Info();
            frmStaffMasterDetailNew frm = new frmStaffMasterDetailNew();
            frm.UserInformation = this.UserInformation;

            if (editStatc == DefineConstantValue.EditStateEnum.OE_Update)
            {
                if (lvStaffList.SelectedItems.Count > 0)
                {
                    showInfo.cus_cRecordID = new Guid(lvStaffList.SelectedItems[0].SubItems[0].Text);
                    showInfo = this._ListQueryUserInfos.FirstOrDefault(t => t.cus_cRecordID == showInfo.cus_cRecordID);
                    if (showInfo != null)
                    {
                        frm.ShowForm(showInfo, editStatc);
                        if (showInfo.IsSaved)
                        {
                            showInfo.cus_cLast = this.UserInformation.usm_cUserLoginID;
                            try
                            {
                                returnInfo = this._ICardUserMasterBL.Save(showInfo, DefineConstantValue.EditStateEnum.OE_Update);
                            }
                            catch (Exception Ex)
                            {
                                ShowErrorMessage(Ex.Message);
                            }
                        }
                        else
                        {
                            sysToolBar.BtnModify_IsEnabled = false;
                            sysToolBar.BtnNew_IsEnabled = true;
                            sysToolBar.BtnRefresh_IsEnabled = true;
                            sysToolBar.BtnDelete_IsEnabled = false;
                            lvStaffList.SelectedItems.Clear();
                        }
                    }
                }
                else
                {
                    ShowWarningMessage("请先选择需要查看的教师。");
                }
            }
            else if (editStatc == DefineConstantValue.EditStateEnum.OE_Insert)
            {
                frm.ShowForm(showInfo, editStatc);
                if (showInfo.IsSaved)
                {
                    showInfo.cus_cAdd = this.UserInformation.usm_cUserLoginID;
                    showInfo.cus_cLast = this.UserInformation.usm_cUserLoginID;

                    try
                    {
                        returnInfo = this._ICardUserMasterBL.Save(showInfo, DefineConstantValue.EditStateEnum.OE_Insert);

                        if (returnInfo.boolValue)
                        {
                            ShowInformationMessage(Common.DefineConstantValue.SystemMessageText.strMessageText_I_SaveSuccess);
                        }
                        else
                        {
                            ShowErrorMessage(returnInfo.messageText);
                        }
                    }
                    catch (Exception Ex)
                    {

                        ShowErrorMessage(Ex.Message);
                    }
                }
                else
                {
                    sysToolBar.BtnModify_IsEnabled = false;
                    sysToolBar.BtnNew_IsEnabled = true;
                    sysToolBar.BtnRefresh_IsEnabled = true;
                    sysToolBar.BtnDelete_IsEnabled = false;
                    lvStaffList.SelectedItems.Clear();
                }
            }

            //btnQuery_Click(null, null);
        }
Ejemplo n.º 16
0
        private void sysToolBar_OnItemModify_Click(object sender, EventArgs e)
        {
            if (_IsBatchModify)
            {
                if (lvStudentList.CheckedItems != null && lvStudentList.CheckedItems.Count > 0)
                {
                    frmStudentMasterDetailNew frmNew = new frmStudentMasterDetailNew();
                    frmNew.UserInformation = this.UserInformation;

                    List<CardUserMaster_cus_Info> editInfos = new List<CardUserMaster_cus_Info>();

                    foreach (ListViewItem item in lvStudentList.CheckedItems)
                    {
                        CardUserMaster_cus_Info info = new CardUserMaster_cus_Info();

                        info.cus_cRecordID = new Guid(item.SubItems[0].Text);

                        editInfos.Add(info);
                    }

                    frmNew.ShowForm(editInfos);
                }
                else
                {
                    ShowWarningMessage("请先选择学生记录。");
                    ckbSelectAll.Focus();
                }
            }
            else
            {
                ShowDetailForm(Common.DefineConstantValue.EditStateEnum.OE_Update);
            }
        }
Ejemplo n.º 17
0
        private void ShowDetailForm(Common.DefineConstantValue.EditStateEnum editStatc)
        {
            frmStudentMasterDetailNew frmNew = new frmStudentMasterDetailNew();
            frmNew.UserInformation = this.UserInformation;

            ReturnValueInfo rvInfo = new ReturnValueInfo(false);

            CardUserMaster_cus_Info objInfo = new CardUserMaster_cus_Info();

            if (editStatc == DefineConstantValue.EditStateEnum.OE_Update)
            {
                if (lvStudentList.SelectedItems.Count > 0)
                {
                    if (this._IsBatchModify)
                    {
                        //frmNew.ShowForm(null, Common.DefineConstantValue.EditStateEnum.OE_Insert, _IsBatchModify);
                    }
                    else
                    {
                        try
                        {
                            objInfo.cus_cRecordID = new Guid(lvStudentList.SelectedItems[0].SubItems[0].Text);

                            objInfo = this._ICardUserMasterBL.DisplayRecord(objInfo) as CardUserMaster_cus_Info;

                            objInfo.cus_cLast = this.UserInformation.usm_cUserLoginID;

                            frmNew.ShowForm(objInfo, Common.DefineConstantValue.EditStateEnum.OE_Update);
                        }
                        catch (Exception Ex)
                        {
                            ShowErrorMessage(Ex.Message);
                        }
                    }
                }
            }
            else
            {
                frmNew.ShowForm(objInfo, Common.DefineConstantValue.EditStateEnum.OE_Insert);
            }
        }
Ejemplo n.º 18
0
        private void btnBatchModifyDetail_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlgOpen = new OpenFileDialog();
            dlgOpen.Filter = Common.DefineConstantValue.ImportFileFilter.ExExcel;
            if (dlgOpen.ShowDialog() == DialogResult.OK)
            {
                string strPathName = dlgOpen.FileName;
                DataSet ds = General.GetExcelDs(strPathName, "批量修改用户信息导入");
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    CardUserMaster_cus_Info searchInfo = new CardUserMaster_cus_Info();
                    searchInfo.cus_cIdentityNum = Common.DefineConstantValue.CodeMasterDefine.KEY2_SIOT_CardUserIdentity_Student;
                    List<CardUserMaster_cus_Info> listUsers = this._ICardUserMasterBL.SearchRecord_ForMaster(searchInfo);
                    if (listUsers != null)
                    {
                        listUsers = listUsers.Where(x => x.cus_lValid).ToList();
                        for (int i = 1; i <= ds.Tables[0].Rows.Count - 1; i++)
                        {
                            string strName = ds.Tables[0].Rows[i][0].ToString();
                            string strClassName = ds.Tables[0].Rows[i][1].ToString();
                            string strParentName = ds.Tables[0].Rows[i][2].ToString();
                            string strParentPhone = ds.Tables[0].Rows[i][3].ToString();
                            string strBankAccount = ds.Tables[0].Rows[i][4].ToString();

                            CardUserMaster_cus_Info currentUser = listUsers.Find(x => x.cus_cChaName.Trim() == strName && x.ClassName.Trim() == strClassName);
                            if (currentUser != null)
                            {
                                currentUser.cus_cContractName = strParentName;
                                currentUser.cus_cContractPhone = strParentPhone;
                                currentUser.cus_cBankAccount = strBankAccount;
                            }
                            else
                            {

                            }
                        }

                        ReturnValueInfo rvInfo = this._ICardUserMasterBL.BatchUpdateUserInfo(listUsers);
                        if (rvInfo.boolValue && !rvInfo.isError)
                        {
                            ShowInformationMessage("批量修改银行信息成功");
                        }
                        else
                        {
                            ShowErrorMessage("批量修改银行信息失败。" + rvInfo.messageText);
                        }
                    }
                }
                else
                {
                    ShowErrorMessage("无可用资料。");
                }
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 確定換卡
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                bool resUkey = base.CheckUKey();
                if (!resUkey)
                {
                    return;
                }

                #region 添加换卡前对收数情况的判断,若收数未成功,则不能进行换卡操作

                ConsumeMachineMaster_cmm_Info searchMacInfo = new ConsumeMachineMaster_cmm_Info();
                searchMacInfo.cmm_cStatus = Common.DefineConstantValue.ConsumeMachineStatus.Using.ToString();
                List<ConsumeMachineMaster_cmm_Info> listMacInfos = this._IConsumeMachineBL.SearchRecords(searchMacInfo);
                listMacInfos = listMacInfos.Where(x => x.cmm_lIsActive).ToList();
                if (listMacInfos == null && listMacInfos.Count > 0)
                {
                    base.ShowErrorMessage("获取消费数据同步信息时出现异常,请重试。");
                    return;
                }
                //消费机最后同步时间
                DateTime dtMacSync = listMacInfos[0].cmm_dLastAccessTime;
                //List<ConsumeMachineMaster_cmm_Info> listUnSyncMachineInfos = listMacInfos.Where(x =>
                //          x.cmm_dLastAccessTime.Hour != dtMacSync.Hour).ToList();
                List<ConsumeMachineMaster_cmm_Info> listUnSyncMachineInfos = new List<ConsumeMachineMaster_cmm_Info>();
                foreach (ConsumeMachineMaster_cmm_Info macItem in listMacInfos)
                {
                    if (macItem != null)
                    {
                        DateTime dtAccess = macItem.cmm_dLastAccessTime;
                        if (Math.Abs((dtAccess - dtMacSync).TotalMinutes) > 30)
                        {
                            listUnSyncMachineInfos.Add(macItem);
                        }
                    }
                    else
                        continue;
                }
                List<ConsumeMachineMaster_cmm_Info> listUnConnMachineInfos = listMacInfos.Where(x =>
                        !x.cmm_lLastAccessRes).ToList();
                if ((listUnSyncMachineInfos != null && listUnSyncMachineInfos.Count > 0) || (listUnConnMachineInfos != null && listUnConnMachineInfos.Count > 0))
                {
                    if (base.ShowQuestionMessage("暂时不能进行换卡操作,因检测到有断线现象的消费机,请在恢复收集数据正常后重试。" + Environment.NewLine + "需要立即查看【消费数据收集情况】吗?"))
                    {
                        MenuItem menuClick = new MenuItem();
                        Sys_FormMaster_fom_Info formClick = new Sys_FormMaster_fom_Info();
                        formClick.fom_cExePath = "WindowUI.HHZX.ConsumerDevice.frmConsumptionRecordCollect";
                        menuClick.Tag = formClick;
                        base.ShowSubForm(menuClick, base.BaseDockPanel);
                    }
                    this.btnSave.Enabled = false;
                    this.lblReadNo.Text = "请读卡";
                    return;
                }

                #endregion

                this.btnSave.Enabled = false;
                this.lblReadNo.Text = "请读卡";

                UserCardPair_ucp_Info userPairInfo = new UserCardPair_ucp_Info();
                userPairInfo.ucp_cCardID = _CardInfo.CardSourceID;
                userPairInfo.ucp_iCardNo = int.Parse(_CardInfo.CardNo);
                //查询用户是否已拥有正常的消费卡
                List<UserCardPair_ucp_Info> listResUserPair = _IUserCardPairBL.SearchRecords(userPairInfo);
                if (userPairInfo != null)
                {
                    listResUserPair = listResUserPair.Where(x => x.ucp_cUseStatus != Common.DefineConstantValue.ConsumeCardStatus.Returned.ToString()).ToList();
                }

                if (listResUserPair != null && listResUserPair.Count > 0)
                {
                    string strMessage = string.Empty;

                    userPairInfo = listResUserPair[0] as UserCardPair_ucp_Info;

                    userPairInfo = _IUserCardPairBL.DisplayRecord(userPairInfo);

                    if (userPairInfo.CardOwner != null)
                    {
                        strMessage += userPairInfo.CardOwner.cus_cChaName + " " + userPairInfo.CardOwner.ClassName + " 卡号:" + userPairInfo.ucp_iCardNo;
                    }

                    base.ShowErrorMessage("该卡已在使用中。使用者:" + strMessage);
                    return;
                }

                if (!ShowQuestionMessage("是否确认换卡?"))
                {
                    return;
                }
                if (ShowQuestionMessage("是否需要重新设置【换卡工本费】?" + Environment.NewLine + "当前【换卡工本费】为:" + _ReplaceCost.ToString()))
                {
                    btnSetCost_Click(null, null);
                    if (!ShowQuestionMessage("【换卡工本费】更新完毕,是否需要继续进行换卡操作?"))
                    {
                        return;
                    }
                }

                userPairInfo = _CurrentUserInfo.PairInfo;
                int iOldCardNo = userPairInfo.ucp_iCardNo;
                userPairInfo.ucp_cUseStatus = DefineConstantValue.ConsumeCardStatus.Returned.ToString();
                userPairInfo.ucp_dReturnTime = System.DateTime.Now;

                if (!_IUserCardPairBL.Save(userPairInfo, DefineConstantValue.EditStateEnum.OE_Update).isError)
                {
                    ConsumeCardMaster_ccm_Info ccmInfo = new ConsumeCardMaster_ccm_Info();
                    ccmInfo.ccm_cCardID = _CardInfo.CardSourceID;

                    ccmInfo.ccm_cCardState = DefineConstantValue.CardUseState.InUse.ToString();
                    ccmInfo.ccm_lIsActive = true;
                    ccmInfo.ccm_cAdd = this.UserInformation.usm_cUserLoginID;
                    ccmInfo.ccm_dAddDate = System.DateTime.Now;
                    ccmInfo.ccm_cLast = this.UserInformation.usm_cUserLoginID;
                    ccmInfo.ccm_dLastDate = System.DateTime.Now;
                    ///如果新卡沒錄入系統,則先錄入新卡
                    if (_IConsumeCardMasterBL.DisplayRecord(ccmInfo) != null)
                    {
                        //如果新卡已在系統,則設為已使用
                        if (_IConsumeCardMasterBL.Save(ccmInfo, DefineConstantValue.EditStateEnum.OE_Update).isError)
                        {

                        }
                    }
                    else
                    {
                        //添加新卡信息
                        if (_IConsumeCardMasterBL.Save(ccmInfo, DefineConstantValue.EditStateEnum.OE_Insert).isError)
                        {
                            base.ShowErrorMessage("卡信息录入时发生错误,请再次尝试。");
                        }
                    }

                    //如果存在舊卡,將舊卡設為未使用
                    if (_CurrentUserInfo.PairInfo != null)
                    {
                        ConsumeCardMaster_ccm_Info oldCardInfo = new ConsumeCardMaster_ccm_Info();
                        oldCardInfo.ccm_cCardID = _CurrentUserInfo.PairInfo.ucp_cCardID;
                        oldCardInfo = _IConsumeCardMasterBL.DisplayRecord(oldCardInfo) as ConsumeCardMaster_ccm_Info;
                        if (oldCardInfo != null)
                        {
                            oldCardInfo.ccm_cCardState = DefineConstantValue.CardUseState.NotUsed.ToString();
                            _IConsumeCardMasterBL.Save(oldCardInfo, DefineConstantValue.EditStateEnum.OE_Update);
                        }
                    }

                    userPairInfo.ucp_cRecordID = Guid.NewGuid();
                    userPairInfo.ucp_cCardID = ccmInfo.ccm_cCardID;
                    userPairInfo.ucp_cAdd = this.UserInformation.usm_cUserLoginID;
                    userPairInfo.ucp_cLast = this.UserInformation.usm_cUserLoginID;
                    userPairInfo.ucp_dPairTime = DateTime.Now;
                    userPairInfo.ucp_dAddDate = DateTime.Now;
                    userPairInfo.ucp_dLastDate = DateTime.Now;
                    userPairInfo.ucp_cUseStatus = DefineConstantValue.ConsumeCardStatus.Normal.ToString();
                    userPairInfo.ucp_lIsActive = true;
                    userPairInfo.ucp_dReturnTime = null;

                    ReturnValueInfo returnInfo = _IUserCardPairBL.InsertExchargeCard(userPairInfo, _ReplaceCost);

                    userPairInfo = returnInfo.ValueObject as UserCardPair_ucp_Info;

                    if (returnInfo.isError)
                    {
                        base.ShowErrorMessage("换卡失败,请再次尝试。");
                        return;
                    }
                    else
                    {
                        //換卡成功,將新卡設為已使用
                        initValue();

                        UserCardPair_ucp_Info currentPair = this._IUserCardPairBL.DisplayRecord(new UserCardPair_ucp_Info() { ucp_cRecordID = userPairInfo.ucp_cRecordID }) as UserCardPair_ucp_Info;

                        string strCardName = string.Empty;

                        //抽取用户信息写入卡显示名称
                        if (currentPair.CardOwner != null)
                        {
                            CardUserMaster_cus_Info userSearch = new CardUserMaster_cus_Info() { cus_cRecordID = currentPair.CardOwner.cus_cRecordID };
                            CardUserMaster_cus_Info userInfo = this._ICardUserMasterBL.DisplayRecord(userSearch) as CardUserMaster_cus_Info;
                            if (userInfo != null)
                            {
                                if (userInfo.cus_cIdentityNum == DefineConstantValue.CodeMasterDefine.KEY2_SIOT_CardUserIdentity_Student)//学生
                                {
                                    if (userInfo.ClassInfo != null)
                                    {
                                        if (userInfo.ClassInfo.GradeInfo == null)
                                        {
                                            strCardName += userInfo.ClassInfo.csm_cClassName.Substring(0, 1) == "高" ? "G" : "C";
                                            strCardName += userInfo.ClassInfo.csm_cClassName.Substring(1, 1);
                                        }
                                        else
                                        {
                                            strCardName += userInfo.ClassInfo.GradeInfo.gdm_cAbbreviation;
                                        }

                                        string strTmpName = userInfo.cus_cChaName;
                                        if (userInfo.cus_cChaName.Length > 3)
                                        {
                                            strTmpName = userInfo.cus_cChaName.Substring(1, 3);
                                        }
                                        strCardName += strTmpName;
                                    }
                                    else
                                    {
                                        this.Cursor = Cursors.Default;
                                        base.ShowWarningMessage("用户班级信息不全,请重试。");
                                        return;
                                    }
                                }
                                else//老师
                                {
                                    string strTmpName = userInfo.cus_cChaName;
                                    if (userInfo.cus_cChaName.Length > 6)
                                    {
                                        strTmpName = strTmpName.Substring(0, 6);
                                    }
                                    strCardName = strTmpName;
                                }
                            }
                        }

                        CardUserAccount_cua_Info cuaInfo = new CardUserAccount_cua_Info();
                        cuaInfo.cua_cCUSID = userPairInfo.ucp_cCUSID;

                        cuaInfo = _ICardUserAccountBL.SearchRecords(cuaInfo).FirstOrDefault() as CardUserAccount_cua_Info;
                        _CardInfo.CardNo = userPairInfo.ucp_iCardNo.ToString();
                        _CardInfo.Name = strCardName;
                        _CardInfo.CardPwd = this._PayPwd;
                        //_cardInfo.CardBalance = cuaInfo.cua_fCurrentBalance;

                        decimal Balance = cuaInfo.cua_fCurrentBalance;

                        if (this._CurrentUserInfo != null)
                        {
                            if (this._CurrentUserInfo.cus_cIdentityNum == Common.DefineConstantValue.CodeMasterDefine.KEY2_SIOT_CardUserIdentity_Student)
                            {
                                CodeMaster_cmt_Info codeInfo = this._ICodeMasterBL.SearchRecords(new CodeMaster_cmt_Info() { cmt_cKey1 = Common.DefineConstantValue.CodeMasterDefine.KEY1_ConstantExpenses, cmt_cKey2 = Common.DefineConstantValue.CodeMasterDefine.KEY2_AdvanceCost }).FirstOrDefault() as CodeMaster_cmt_Info;
                                if (codeInfo != null)
                                {
                                    Balance = Balance + codeInfo.cmt_fNumber;
                                }
                            }
                        }

                        if (Balance < 0)
                        {
                            Balance = 0;
                        }

                        _CardInfo.CardBalance = Balance;

                        this._Reader.WriteCardInfo(this._CardInfoSection, this._SectionPwd, _CardInfo);

                        this.lblReadNo.Text = "已换卡";

                        userPairInfo = returnInfo.ValueObject as UserCardPair_ucp_Info;

                        _CurrentUserInfo.PairInfo = userPairInfo;

                        _CardInfo = null;

                        initValue();

                        ShowInformationMessage("换卡成功。");

                        ReturnValueInfo rvRemoveOld = RemoveOldCardFromWList(iOldCardNo);
                        ReturnValueInfo rvAddNew = AddNewCardToWList(userPairInfo.ucp_iCardNo);
                        if (rvRemoveOld.boolValue && rvAddNew.boolValue)
                        {
                            ShowInformationMessage("旧卡自动添加到黑名单列表成功,原卡已不能继续使用。");
                        }
                        else
                        {
                            ShowErrorMessage("旧卡自动添加到黑名单列表失败,可等待停餐服务收集名单添加或联系管理员手动添加。");
                        }
                    }
                }
            }
            catch
            {

            }
        }
Ejemplo n.º 20
0
 public UserCardInfo(CardUserMaster_cus_Info user)
 {
     this.userInfo = user;
     Ext_RecordID = user.cus_cRecordID;
     Ext_UserNum = user.cus_cStudentID;
     Ext_UserName = user.cus_cChaName;
     Ext_CardNo = user.PairInfo.ucp_iCardNo.ToString();
     Ext_PairTime = user.PairInfo.ucp_dPairTime;
     Ext_GroupName = user.ClassInfo != null ? user.ClassInfo.csm_cClassName : user.DeptInfo.dpm_cName;
 }
Ejemplo n.º 21
0
 private void btnSelectUser_Click(object sender, EventArgs e)
 {
     dlgCardUserSelection dcusForm = new dlgCardUserSelection();
     dcusForm.ShowDialog();
     if (dcusForm.SelectedUser != null)
     {
         _CurrentUserInfo = dcusForm.SelectedUser;
         gpbReplace.Enabled = true;
         initValue();
     }
     else
     {
         gpbReplace.Enabled = false;
     }
 }
 /// <summary>
 /// 显示等待转账的转账款总额
 /// </summary>
 /// <param name="cardUserMaster_cus_Info"></param>
 private void GetWaitForTransRecharge(CardUserMaster_cus_Info userInfo)
 {
     if (userInfo != null)
     {
         IPreRechargeRecordBL preRecBL = MasterBLLFactory.GetBLL<IPreRechargeRecordBL>(MasterBLLFactory.PreRechargeRecord);
         PreRechargeRecord_prr_Info searchInfo = new PreRechargeRecord_prr_Info();
         searchInfo.prr_cStatus = Common.DefineConstantValue.ConsumeMoneyFlowStatus.WaitForAcceptTransfer.ToString();
         searchInfo.prr_cUserID = userInfo.cus_cRecordID;
         List<PreRechargeRecord_prr_Info> listRecord = preRecBL.SearchRecords(searchInfo);
         if (listRecord != null && listRecord.Count > 0)
         {
             labWaitForTrans.Text = listRecord.Sum(x => x.prr_fRechargeMoney).ToString();
         }
         else
         {
             labWaitForTrans.Text = "0.00";
         }
     }
     else
     {
         labWaitForTrans.Text = "账户信息异常";
     }
 }
Ejemplo n.º 23
0
        private void SearchStudents()
        {
            try
            {
                CardUserMaster_cus_Info queryInfo = new CardUserMaster_cus_Info();

                if (cboClass.SelectedValue != null && !string.IsNullOrEmpty(cboClass.Text))
                {
                    queryInfo.cus_cClassID = new Guid(cboClass.SelectedValue.ToString());
                }
                if (!string.IsNullOrEmpty(tbxStudentID.Text))
                {
                    queryInfo.cus_cStudentID = tbxStudentID.Text.Trim().Replace("'", "''");
                }
                if (!string.IsNullOrEmpty(tbxStudenName.Text))
                {
                    queryInfo.cus_cChaName = tbxStudenName.Text.Trim().Replace("'", "''");
                }
                if (cboSex.SelectedValue != null && !string.IsNullOrEmpty(cboSex.Text))
                {
                    queryInfo.cus_cSexNum = cboSex.SelectedValue.ToString();
                }
                queryInfo.cus_lIsGraduate = cbxVaild.Checked;
                queryInfo.cus_cIdentityNum = Common.DefineConstantValue.CodeMasterDefine.KEY2_SIOT_CardUserIdentity_Student;

                try
                {
                    this.Cursor = Cursors.WaitCursor;

                    List<CardUserMaster_cus_Info> returnList = this._ICardUserMasterBL.SearchRecord_ForMaster(queryInfo);

                    if (returnList != null && returnList.Count > 0)
                    {
                        this._ListQueryStuInfo.Clear();

                        //foreach (CardUserMaster_cus_Info item in returnList)
                        //{
                        //    this._ListQueryStuInfo.Add(item);
                        //}
                        this._ListQueryStuInfo.AddRange(returnList);

                        lvStudentList.Items.Clear();
                        lvStudentList.SetDataSource(returnList);
                        gbxRes.Text = "查询结果:共 " + returnList.Count.ToString() + " 条";

                        ListViewSorter sorter = new ListViewSorter(1, SortOrder.Ascending);
                        lvStudentList.ListViewItemSorter = sorter;
                        lvStudentList.Sorting = SortOrder.Ascending;

                        btnExportGradeUp.Enabled = true;

                        btnBatchmodify.Enabled = true;
                    }
                    else
                    {

                        lvStudentList.Items.Clear();

                        this._ListQueryStuInfo = new List<CardUserMaster_cus_Info>();

                        ShowInformationMessage(Common.DefineConstantValue.SystemMessageText.strMessageText_W_RecordIsEmpty);

                        btnExportGradeUp.Enabled = false;

                        btnBatchmodify.Enabled = false;

                        gbxRes.Text = "查询结果:共 0 条";
                    }
                }
                catch (Exception Ex)
                {
                    ShowErrorMessage(Ex);
                }
            }
            catch (Exception exx)
            {
                ShowErrorMessage(exx);
            }
            this.Cursor = Cursors.Default;
        }
        /// <summary>
        /// 重设被欠费停餐的人员开餐情况
        /// </summary>
        /// <param name="userInfo"></param>
        private void ResetMealPlanning(CardUserMaster_cus_Info userInfo, DateTime? dtSysNow)
        {
            try
            {
                if (this._tsBLLunch == null || this._tsBLSupper == null || this._tsMealLunch == null || this._tsMealSupper == null)
                {
                    BindMealTime();
                }
                if (this._tsBLLunch == null || this._tsBLSupper == null || this._tsMealLunch == null || this._tsMealSupper == null)
                {
                    return;
                }
                TimeSpan tsBLLunch = this._tsBLLunch.Value;
                TimeSpan tsMealLunch = this._tsMealLunch.Value;
                TimeSpan tsBLSupper = this._tsBLSupper.Value;
                TimeSpan tsMealSupper = this._tsMealSupper.Value;
                TimeSpan tsNow = TimeSpan.Parse(dtSysNow.Value.ToString("HH:mm"));

                bool l_blnIsNeedAlert = false;

                if (tsNow >= tsBLLunch && tsNow <= tsMealLunch)
                {
                    //显示停餐信息
                    ucMealBookingDetail.ShowData(this._CurrentPairInfo.CardOwner);
                    ucMealBookingDetail.BreakfastDesc = "未读";
                    ucMealBookingDetail.LunchDesc = "未读";
                    ucMealBookingDetail.SupperDesc = "未读";

                    if (!ucMealBookingDetail.LunchPlanning)
                    {
                        MealBookingHistory_mbh_Info oldPlan = ucMealBookingDetail.ListUserOldPlanning.Find(x => x.mbh_cMealType == Common.DefineConstantValue.MealType.Lunch.ToString());
                        if (oldPlan.mbh_lIsSet)
                        {
                            UpdateMealPlanning(Common.DefineConstantValue.MealType.Lunch.ToString(), userInfo, oldPlan);
                            l_blnIsNeedAlert = true;
                        }
                    }
                }
                else if (tsNow >= tsBLSupper && tsNow <= tsMealSupper)
                {
                    //显示停餐信息
                    ucMealBookingDetail.ShowData(this._CurrentPairInfo.CardOwner);
                    ucMealBookingDetail.BreakfastDesc = "未读";
                    ucMealBookingDetail.LunchDesc = "未读";
                    ucMealBookingDetail.SupperDesc = "未读";

                    if (!ucMealBookingDetail.SupperPlanning)
                    {
                        MealBookingHistory_mbh_Info oldPlan = ucMealBookingDetail.ListUserOldPlanning.Find(x => x.mbh_cMealType == Common.DefineConstantValue.MealType.Supper.ToString());
                        if (oldPlan.mbh_lIsSet)
                        {
                            UpdateMealPlanning(Common.DefineConstantValue.MealType.Supper.ToString(), userInfo, oldPlan);
                            l_blnIsNeedAlert = true;
                        }
                    }
                }

                if (!l_blnIsNeedAlert)
                {
                    return;
                }
                ReturnValueInfo rvInfo = AddOldCardList(int.Parse(base._CurrentCardInfo.CardNo), DefineConstantValue.EnumCardUploadListOpt.AddWhiteList);
                if (rvInfo.boolValue && !rvInfo.isError)
                {
                    //base.ShowInformationMessage("欠费停餐状态已清除成功,等待两分钟左右后可恢复打卡。");
                }
                else
                {
                    base.ShowErrorMessage("欠费停餐状态已清除失败。" + rvInfo.messageText);
                }
            }
            catch (Exception ex)
            {
                base.ShowErrorMessage(ex);
            }
        }
Ejemplo n.º 25
0
        private void sysToolBar_OnItemDelete_Click(object sender, EventArgs e)
        {
            if (lvStudentList.SelectedItems.Count > 0)
            {
                if (ShowQuestionMessage("是否确认需要删除选中项?"))
                {
                    try
                    {
                        string strID = lvStudentList.SelectedItems[0].SubItems[0].Text;
                        Guid gRecordID = new Guid(strID);
                        CardUserMaster_cus_Info delInfo = new CardUserMaster_cus_Info();
                        delInfo.cus_cRecordID = gRecordID;

                        List<UserCardPair_ucp_Info> listCardPairInfo = this._IUserCardPairBL.SearchRecords(delInfo);
                        listCardPairInfo = listCardPairInfo.Where(x => x.ucp_cUseStatus == Common.DefineConstantValue.ConsumeCardStatus.Normal.ToString()).ToList();
                        if (listCardPairInfo != null && listCardPairInfo.Count > 0)
                        {
                            ShowWarningMessage("删除失败。此用户扔持有消费卡,请退卡后重试。");
                            return;
                        }

                        ReturnValueInfo rvInfo = this._ICardUserMasterBL.Save(delInfo, DefineConstantValue.EditStateEnum.OE_Delete);
                        if (rvInfo.boolValue && !rvInfo.isError)
                        {
                            ShowInformationMessage("删除成功。");
                        }
                        else
                        {
                            ShowErrorMessage("删除失败。" + rvInfo.messageText);
                        }
                        btnQuery_Click(null, null);
                    }
                    catch (Exception ex)
                    { ShowErrorMessage(ex); }
                }
            }
        }
        /// <summary>
        /// 更新定餐计划
        /// </summary>
        /// <param name="strMealType"></param>
        /// <param name="userInfo"></param>
        void UpdateMealPlanning(string strMealType, CardUserMaster_cus_Info userInfo, MealBookingHistory_mbh_Info oldMealInfo)
        {
            try
            {
                //ShowInformationMessage("检测到该用户此前被欠费自动停餐,现更新定餐信息并提交到各个消费机处。");

                IMealBookingHistoryBL mealBL = MasterBLLFactory.GetBLL<IMealBookingHistoryBL>(MasterBLLFactory.MealBookingHistory);
                MealBookingHistory_mbh_Info mealInfo = new MealBookingHistory_mbh_Info();
                mealInfo.mbh_cMealType = strMealType;
                mealInfo.mbh_cTargetID = userInfo.cus_cRecordID;
                mealInfo.mbh_dMealDate = DateTime.Now;
                List<MealBookingHistory_mbh_Info> listMealInfo = mealBL.SearchRecords(mealInfo);
                if (listMealInfo != null && listMealInfo.Count > 0)
                {
                    MealBookingHistory_mbh_Info currentMealInfo = listMealInfo.FirstOrDefault();
                    if (currentMealInfo != null)
                    {
                        currentMealInfo.mbh_lIsSet = oldMealInfo.mbh_lIsSet;
                        currentMealInfo.mbh_cTargetType = oldMealInfo.mbh_cTargetType;
                        currentMealInfo.mbh_dAddDate = DateTime.Now;
                        currentMealInfo.mbh_cAdd = base.UserInformation.usm_cUserLoginID;
                        ReturnValueInfo rvInfo = mealBL.UpdateRecordWithPreCost(currentMealInfo);
                    }
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex);
            }
        }
Ejemplo n.º 27
0
            public UserInputData(CardUserMaster_cus_Info showInfo)
            {
                this.cus_cRecordID = showInfo.cus_cRecordID.ToString();

                this.cus_cStudentID = showInfo.cus_cStudentID;

                this.cus_cChaName = showInfo.cus_cChaName;

                this.cus_cSexNum = showInfo.cus_cSexNum;

                this.cus_cComeYear = showInfo.cus_cComeYear;

                this.cus_cGraduationPeriod = showInfo.cus_cGraduationPeriod;

                this.cus_cClassID = showInfo.cus_cClassID.ToString();

                this.cus_cContractName = showInfo.cus_cContractName;

                this.cus_cContractPhone = showInfo.cus_cContractPhone;

                this.cus_cRemark = showInfo.cus_cRemark;

                this.cus_lValid = showInfo.cus_lValid == true ? "是" : "否";
            }
Ejemplo n.º 28
0
 public void ShowData(CardUserMaster_cus_Info userInfo)
 {
     this.UserInfo = userInfo;
     if (userInfo == null)
     {
         labBreakfastMB.Text = "缺失";
         labLunchMB.Text = "缺失";
         labSupperMB.Text = "缺失";
         return;
     }
     BindMealBookingInfo();
 }
Ejemplo n.º 29
0
        private void frmStudentMasterDetail_Load(object sender, EventArgs e)
        {
            if (!this._isBatchmodify)
            {
                if (_editInfo == null)
                {
                    _editInfo = this.BaseParam as CardUserMaster_cus_Info;
                }

                if (this.EditState == Common.DefineConstantValue.EditStateEnum.OE_Insert)
                {
                    this.Text = "新增 - " + this.Text;

                    UserInputData insertInfo = new UserInputData();
                    insertInfo.cus_cGraduationPeriod = DateTime.Now.Year.ToString();
                    insertInfo.cus_cComeYear = DateTime.Now.Year.ToString();
                    insertInfo.cus_lValid = "是";
                    proUserData.SelectedObject = insertInfo;
                }
                else if (this.EditState == Common.DefineConstantValue.EditStateEnum.OE_Update)
                {
                    this.Text = "查看 - " + this.Text;
                    btnAutoNum.Enabled = false;

                    UserInputData showData = new UserInputData(_editInfo);

                    proUserData.SelectedObject = showData;

                }
            }
            else
            {
                BatchUserInfo userInfo = new BatchUserInfo();

                proUserData.SelectedObject = userInfo;
            }
        }
Ejemplo n.º 30
0
        /// <summary>
        /// 扩展检查
        /// </summary>
        /// <param name="userInfo"></param>
        /// <param name="targetInfo"></param>
        /// <param name="listGeneralSettings"></param>
        /// <param name="listCustomSettings"></param>
        void CheckClassGradeIsSet(CardUserMaster_cus_Info userInfo, MealBookingHistory_mbh_Info targetInfo, List<PaymentUDGeneralSetting_pus_Info> listGeneralSettings, List<PaymentUDMealState_pms_Info> listCustomSettings, string strMealType)
        {
            MealBookingHistory_mbh_Info rvHistoryInfo = new MealBookingHistory_mbh_Info();
            if (targetInfo.mbh_lIsSet)
            {
                if (userInfo.ClassInfo != null)
                {
                    //先检查年级是否停餐,默认+自定义
                    //年级自定义
                    PaymentUDMealState_pms_Info stuCustom = listCustomSettings.Find(x => x.pms_cGradeID == userInfo.ClassInfo.GradeInfo.gdm_cRecordID);
                    if (stuCustom != null)
                    {
                        //有年级自定义
                        bool setInfo = GetCustomMealSettings(strMealType, stuCustom);
                        if (!setInfo)
                        {
                            targetInfo.mbh_lIsSet = setInfo;
                            targetInfo.mbh_cTargetType = Common.DefineConstantValue.StuMealBookingType.GradeCustom.ToString();
                            return;
                        }
                    }
                    else
                    {
                        PaymentUDGeneralSetting_pus_Info stuDefault = listGeneralSettings.Find(x => x.pus_cGradeID == userInfo.ClassInfo.GradeInfo.gdm_cRecordID);
                        if (stuDefault != null)
                        {
                            //无年级自定义,有年级默认
                            bool setInfo = GetGeneralSettings(strMealType, stuDefault);
                            if (!setInfo)
                            {
                                targetInfo.mbh_lIsSet = setInfo;
                                targetInfo.mbh_cTargetType = Common.DefineConstantValue.StuMealBookingType.GradeDefault.ToString();
                                return;
                            }
                        }
                    }

                    stuCustom = listCustomSettings.Find(x => x.pms_cClassID == userInfo.ClassInfo.csm_cRecordID);
                    if (stuCustom != null)
                    {
                        //无年级自定义、默认,有班级自定义
                        bool setInfo = GetCustomMealSettings(strMealType, stuCustom);
                        if (!setInfo)
                        {
                            targetInfo.mbh_lIsSet = setInfo;
                            targetInfo.mbh_cTargetType = Common.DefineConstantValue.StuMealBookingType.ClassCustom.ToString();
                            return;
                        }
                    }
                    else
                    {
                        PaymentUDGeneralSetting_pus_Info stuDefault = listGeneralSettings.Find(x => x.pus_cClassID == userInfo.ClassInfo.csm_cRecordID);
                        if (stuDefault != null)
                        {
                            //无年级自定义、默认,无班级自定义,有班级默认
                            bool setInfo = GetGeneralSettings(strMealType, stuDefault);
                            if (!setInfo)
                            {
                                targetInfo.mbh_lIsSet = setInfo;
                                targetInfo.mbh_cTargetType = Common.DefineConstantValue.StuMealBookingType.ClassDefault.ToString();
                                return;
                            }
                        }
                    }
                }
            }
        }