Exemple #1
0
        /// <summary>
        /// validate input data confirm and delete money collection info information data into database
        /// </summary>
        /// <param name="DeleteReceiptNo">delete criteria</param>
        /// <returns></returns>
        public ActionResult ICS101_DeleteData(string DeleteReceiptNo)
        {
            ICS101_ScreenParameter param        = GetScreenObject <ICS101_ScreenParameter>();
            ICS101_RegisterData    RegisterData = new ICS101_RegisterData();
            CommonUtil             comUtil      = new CommonUtil();

            ObjectResultData res = new ObjectResultData();

            res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;

            try
            {
                IIncomeHandler iincomeHandler = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler;

                List <tbt_MoneyCollectionInfo> _dotbt_MoneyCollectionInfo = new List <tbt_MoneyCollectionInfo>();

                _dotbt_MoneyCollectionInfo = iincomeHandler.DeleteTbt_MoneyCollectionInfo(DeleteReceiptNo);

                if (_dotbt_MoneyCollectionInfo == null)
                {
                    res.AddErrorMessage(MessageUtil.MODULE_INCOME,
                                        "ICS101",
                                        MessageUtil.MODULE_COMMON,
                                        MessageUtil.MessageList.MSG0001,
                                        new string[] { "lblHeaderExpectedCollectDate" },
                                        new string[] { "dtpExpectedCollectDateFrom", "dtpExpectedCollectDateTo" });
                }
                if (_dotbt_MoneyCollectionInfo.Count == 0)
                {
                    res.AddErrorMessage(MessageUtil.MODULE_INCOME,
                                        "ICS101",
                                        MessageUtil.MODULE_COMMON,
                                        MessageUtil.MessageList.MSG0001,
                                        new string[] { "lblHeaderExpectedCollectDate" },
                                        new string[] { "dtpExpectedCollectDateFrom", "dtpExpectedCollectDateTo" });
                }

                // return "1" to js is every thing OK
                if (res.MessageList == null || res.MessageList.Count == 0)
                {
                    res.ResultData = "1";
                }
                else
                {
                    res.ResultData = "0";
                }

                return(Json(res));
            }
            catch (Exception ex)
            {
                res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }