Ejemplo n.º 1
0
        /// <summary>
        /// Get rental contract basic information to show in user control
        /// </summary>
        /// <param name="strContrancCode"></param>
        /// <returns></returns>
        public doRentalContractBasicInformation GetRentalContactBasicInformationData(string strContractCode)
        {
            try
            {
                string installStatus = "";
                doRentalContractBasicInformation doRentalContract = new doRentalContractBasicInformation();
                doRentalContract.ContractCode = strContractCode;
                CommonUtil.CheckMandatoryFiled(doRentalContract);

                List <doRentalContractBasicInformation> doRentalContractBasicInformation = base.GetRentalContractBasicInformation(strContractCode);
                ICommonHandler        common           = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                IInstallationHandler  installhandler   = ServiceContainer.GetService <IInstallationHandler>() as IInstallationHandler;
                List <doMiscTypeCode> lMiscTypeCode    = new List <doMiscTypeCode>();
                List <doMiscTypeCode> viewMiscTypeCode = new List <doMiscTypeCode>();

                doMiscTypeCode dMiscTypeCode = new doMiscTypeCode();

                installStatus = installhandler.GetInstallationStatus(strContractCode);

                dMiscTypeCode.FieldName = SECOM_AJIS.Common.Util.ConstantValue.MiscType.C_INSTALL_STATUS;
                //dMiscTypeCode.ValueCode = "99"; //I will set default to 00 because the table installation still not create.
                dMiscTypeCode.ValueCode = installStatus;


                lMiscTypeCode.Add(dMiscTypeCode);
                lMiscTypeCode = common.GetMiscTypeCodeList(lMiscTypeCode);

                viewMiscTypeCode = common.GetMiscTypeCodeList(lMiscTypeCode);

                if (doRentalContractBasicInformation.Count != 0)
                {
                    if (viewMiscTypeCode != null && viewMiscTypeCode.Count > 0)
                    {
                        doRentalContractBasicInformation[0].InstallationStatusCode = installStatus;
                        doRentalContractBasicInformation[0].InstallationStatusName = viewMiscTypeCode[0].ValueDisplay;
                    }

                    //List<doRentalContractBasicInformation> list = doRentalContractBasicInformation;
                    //CommonUtil.MappingObjectLanguage<doRentalContractBasicInformation>(list);
                    //doRentalContractBasicInformation[0].OperationOfficeName = list[0].OperationOfficeName;
                    CommonUtil.MappingObjectLanguage <doRentalContractBasicInformation>(doRentalContractBasicInformation);

                    MiscTypeMappingList miscList = new MiscTypeMappingList();
                    miscList.AddMiscType(doRentalContractBasicInformation[0]);

                    ICommonHandler comHandler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                    comHandler.MiscTypeMappingList(miscList);

                    return(doRentalContractBasicInformation[0]);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Retrieve payment status description of specific payment status code
        /// </summary>
        /// <param name="invoicePaymentStatus">payment status code</param>
        /// <returns></returns>
        private string ICS090_GetPaymentStatusDesctription(string invoicePaymentStatus)
        {
            var            incomeHander    = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler;
            doMiscTypeCode doPaymentStatus = incomeHander.GetpaymentStatusDesc(invoicePaymentStatus);

            return(doPaymentStatus == null ? string.Empty : doPaymentStatus.ValueCodeDisplay);
        }
        /// <summary>
        /// Get Pre-elimination Location for combobox.
        /// </summary>
        /// <param name="SourceLoc"></param>
        /// <returns></returns>
        public ActionResult IVS040_GetPreEliminationLocationCbo(string SourceLoc)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                ICommonHandler        comh   = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode> dtMisc = new List <doMiscTypeCode>();

                if (SourceLoc == InstrumentLocation.C_INV_LOC_INSTOCK || SourceLoc == InstrumentLocation.C_INV_LOC_RETURNED)
                {
                    doMiscTypeCode misc = new doMiscTypeCode();
                    misc.FieldName = MiscType.C_INV_LOC;
                    misc.ValueCode = InstrumentLocation.C_INV_LOC_PRE_ELIMINATION;
                    dtMisc.Add(misc);
                }
                else if (SourceLoc == InstrumentLocation.C_INV_LOC_PRE_ELIMINATION)
                {
                    doMiscTypeCode misc = new doMiscTypeCode();
                    misc.FieldName = MiscType.C_INV_LOC;
                    misc.ValueCode = InstrumentLocation.C_INV_LOC_INSTOCK;
                    dtMisc.Add(misc);
                    misc           = new doMiscTypeCode();
                    misc.FieldName = MiscType.C_INV_LOC;
                    misc.ValueCode = InstrumentLocation.C_INV_LOC_RETURNED;
                    dtMisc.Add(misc);
                }
                else
                {
                    doMiscTypeCode misc = new doMiscTypeCode();
                    misc.FieldName = MiscType.C_INV_LOC;
                    misc.ValueCode = InstrumentLocation.C_INV_LOC_INSTOCK;
                    dtMisc.Add(misc);
                    misc           = new doMiscTypeCode();
                    misc.FieldName = MiscType.C_INV_LOC;
                    misc.ValueCode = InstrumentLocation.C_INV_LOC_RETURNED;
                    dtMisc.Add(misc);
                    misc           = new doMiscTypeCode();
                    misc.FieldName = MiscType.C_INV_LOC;
                    misc.ValueCode = InstrumentLocation.C_INV_LOC_PRE_ELIMINATION;
                    dtMisc.Add(misc);
                }

                List <doMiscTypeCode> ResMisc = new List <doMiscTypeCode>();

                ResMisc = comh.GetMiscTypeCodeList(dtMisc);

                ComboBoxModel cboModel = new ComboBoxModel();
                cboModel.SetList <doMiscTypeCode>(ResMisc, "ValueCodeDisplay", "ValueCode");
                res.ResultData = cboModel;

                return(Json(res));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex); return(Json(res));
            }
        }
Ejemplo n.º 4
0
        private ActionResult GetChangeTypeCombo(string filter)
        {
            try {
                string         strDisplay = "ValueDisplay";
                ICommonHandler hand       = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;

                List <doMiscTypeCode> miscs = new List <doMiscTypeCode>();
                if (filter == null || MiscType.C_ALL_CHANGE_TYPE.Equals(filter))
                {
                    miscs.Add(
                        new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_RENTAL_CHANGE_TYPE,
                        ValueCode = "%"
                    });
                    miscs.Add(
                        new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_SALE_CHANGE_TYPE,
                        ValueCode = "%"
                    });
                }
                else
                {
                    miscs.Add(
                        new doMiscTypeCode()
                    {
                        FieldName = filter,
                        ValueCode = "%"
                    });
                }

                List <doMiscTypeCode> MiscLock = hand.GetMiscTypeCodeList(miscs);

                foreach (doMiscTypeCode i in MiscLock)
                {
                    i.ValueDisplay = i.ValueCode + ':' + i.ValueDisplay;
                }

                //MessageModel select = MessageUtil.GetMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0113);
                string strSelect = CommonUtil.GetLabelFromResource("Common", "CMS030", "lblComboboxSelect");

                doMiscTypeCode first = new doMiscTypeCode();
                first.ValueCode    = "";
                first.ValueDisplay = strSelect;
                MiscLock.Insert(0, first);

                ComboBoxModel cboModel = new ComboBoxModel();
                cboModel.SetList <doMiscTypeCode>(MiscLock, strDisplay, "ValueCode", false);

                return(Json(cboModel));
            } catch (Exception ex) {
                // return Json(MessageUtil.GetMessage(ex));
                return(null);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Generate lock status combobox for screen QUS010
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="attribute"></param>
        /// <param name="firstElement"></param>
        /// <returns></returns>
        public static MvcHtmlString LockStatusComboQUS010(this HtmlHelper helper, string id, object attribute = null, string firstElement = null)
        {
            ICommonHandler        hand            = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
            List <doMiscTypeCode> lstMiscTypeCode = new List <doMiscTypeCode>();
            doMiscTypeCode        MiscTypeCode    = new doMiscTypeCode();

            MiscTypeCode.FieldName = MiscType.C_LOCK_STATUS;
            MiscTypeCode.ValueCode = "%";
            lstMiscTypeCode.Add(MiscTypeCode);
            List <doMiscTypeCode> MiscLock = hand.GetMiscTypeCodeList(lstMiscTypeCode);

            return(CommonUtil.CommonComboBoxWithCustomFirstElement <doMiscTypeCode>(id, MiscLock, "ValueCodeDisplay", "ValueCode", firstElement, attribute));
        }
Ejemplo n.º 6
0
        public ActionResult MAS080()
        {
            MAS080_ScreenParameter MAS080Param = new MAS080_ScreenParameter();

            ViewBag.HasPermissionAdd    = "";
            ViewBag.HasPermissionEdit   = "";
            ViewBag.HasPermissionDelete = "";
            ViewBag.FunctionView        = FunctionID.C_FUNC_ID_VIEW;
            ViewBag.FunctionOperate     = FunctionID.C_FUNC_ID_OPERATE;
            ViewBag.FunctionPlanner     = FunctionID.C_FUNC_ID_PLANNER;

            try
            {
                ICommonHandler        hand            = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode> lstMiscTypeCode = new List <doMiscTypeCode>();
                doMiscTypeCode        MiscTypeCode    = new doMiscTypeCode();
                MiscTypeCode.FieldName = MiscType.C_PERMISSION_TYPE;
                MiscTypeCode.ValueCode = "%";
                lstMiscTypeCode.Add(MiscTypeCode);
                List <doMiscTypeCode> MiscLock = hand.GetMiscTypeCodeList(lstMiscTypeCode);
                foreach (doMiscTypeCode i in MiscLock)
                {
                    if (i.ValueCode == PermissionType.C_PERMISSION_TYPE_OFFICE)
                    {
                        ViewBag.PermissionTypeOffice = i.ValueDisplay;
                    }
                    else
                    {
                        ViewBag.PermissionTypeIndividual = i.ValueDisplay;
                    }
                }

                MAS080Param = GetScreenObject <MAS080_ScreenParameter>();
                ViewBag.HasPermissionAdd    = CheckUserPermission(ScreenID.C_SCREEN_ID_MAINTAIN_PERMISSION_GROUP_INFO, FunctionID.C_FUNC_ID_ADD);
                ViewBag.HasPermissionEdit   = CheckUserPermission(ScreenID.C_SCREEN_ID_MAINTAIN_PERMISSION_GROUP_INFO, FunctionID.C_FUNC_ID_EDIT);
                ViewBag.HasPermissionDelete = CheckUserPermission(ScreenID.C_SCREEN_ID_MAINTAIN_PERMISSION_GROUP_INFO, FunctionID.C_FUNC_ID_DEL);
                ViewBag.FunctionView        = FunctionID.C_FUNC_ID_VIEW;
            }
            catch
            {
            }

            return(View());
        }
        public ActionResult GetAdminCombo(string filter)
        {
            try {
                string         strDisplay = "ValueDisplay";
                ICommonHandler hand       = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;

                List <doMiscTypeCode> miscs = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_INCIDENT_ROLE,
                        ValueCode = IncidentRole.C_INCIDENT_ROLE_CHIEF
                    }
                };
                miscs.Add(new doMiscTypeCode()
                {
                    FieldName = MiscType.C_INCIDENT_ROLE,
                    ValueCode = IncidentRole.C_INCIDENT_ROLE_CORRESPONDENT
                });

                List <doMiscTypeCode> MiscLock = hand.GetMiscTypeCodeList(miscs);

                foreach (doMiscTypeCode i in MiscLock)
                {
                    i.ValueDisplay = i.ValueCode + ':' + i.ValueDisplay;
                }

                string         administrator = CommonUtil.GetLabelFromResource(MessageUtil.MODULE_CONTRACT, ScreenID.C_SCREEN_ID_SEARCH_INCIDENT, "txtAdmin");
                doMiscTypeCode first         = new doMiscTypeCode();
                first.ValueCode    = "";
                first.ValueDisplay = administrator;
                MiscLock.Insert(0, first);

                ComboBoxModel cboModel = new ComboBoxModel();
                cboModel.SetList <doMiscTypeCode>(MiscLock, strDisplay, "ValueCode", false);

                return(Json(cboModel));
            } catch (Exception ex) {
                // return Json(MessageUtil.GetMessage(ex));
                return(null);
            }
        }
        public ActionResult IVS050()
        {
            ViewBag.Eliminate    = InstrumentLocation.C_INV_LOC_ELIMINATION;
            ViewBag.PreEliminate = InstrumentLocation.C_INV_LOC_PRE_ELIMINATION;

            ICommonHandler        hand            = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
            List <doMiscTypeCode> lstMiscTypeCode = new List <doMiscTypeCode>();
            doMiscTypeCode        MiscTypeCode    = new doMiscTypeCode();

            MiscTypeCode.FieldName = MiscType.C_INV_LOC;
            MiscTypeCode.ValueCode = InstrumentLocation.C_INV_LOC_ELIMINATION;
            lstMiscTypeCode.Add(MiscTypeCode);
            MiscTypeCode           = new doMiscTypeCode();
            MiscTypeCode.FieldName = MiscType.C_INV_LOC;
            MiscTypeCode.ValueCode = InstrumentLocation.C_INV_LOC_PRE_ELIMINATION;
            lstMiscTypeCode.Add(MiscTypeCode);
            List <doMiscTypeCode> MiscLock = hand.GetMiscTypeCodeList(lstMiscTypeCode);

            CommonUtil.MappingObjectLanguage <doMiscTypeCode>(MiscLock);

            foreach (var i in MiscLock)
            {
                if (i.ValueCode == InstrumentLocation.C_INV_LOC_ELIMINATION)
                {
                    ViewBag.LabelEliminate = i.ValueDisplay;
                }
                else if (i.ValueCode == InstrumentLocation.C_INV_LOC_PRE_ELIMINATION)
                {
                    ViewBag.LabelPreEliminate = i.ValueDisplay;
                }
            }

            ViewBag.Total = CommonUtil.GetLabelFromResource(MessageUtil.MODULE_INVENTORY, ScreenID.C_INV_SCREEN_ID_PRE_ELIMINATION, "lblTotalAmountOfTransferAsset");

            return(View());
        }
Ejemplo n.º 9
0
        public ActionResult ICS140_SavePaid(string billingTargetCode, string serviceTypeCode)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                var handler   = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler;
                var common    = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                var inventory = ServiceContainer.GetService <IInventoryHandler>() as IInventoryHandler;

                var sparam = this.GetScreenObject <ICS140_ScreenParameter>();

                // Coment scopy by Jirawat Jannet  on 2016-10-31
                //using (var scope = new TransactionScope())
                //{
                doDebtTracingInput input = new doDebtTracingInput()
                {
                    BillingTargetCode = billingTargetCode,
                    ServiceTypeCode   = serviceTypeCode,
                    Result            = DebtTracingResult.C_DEBT_TRACE_RESULT_WAIT_MATCH,
                };

                int offset;
                var config = common.GetSystemConfig(ConfigName.C_CONFIG_DEBT_TRACING_WAIT_MATCHING_DAY).FirstOrDefault();
                if (config == null || !(int.TryParse(config.ConfigValue, out offset)))
                {
                    offset = 5;
                }
                input.NextCallDate = inventory.GetBusinessDateByOffset(DateTime.Today, 5).Value;

                handler.SaveDebtTracingInput(input, sparam.IsHQUser);

                doMiscTypeCode misc = new doMiscTypeCode();
                misc.FieldName = MiscType.C_DEBT_TRACING_STATUS;
                if (sparam.IsHQUser)
                {
                    misc.ValueCode = DebtTracingSubStatus.C_DEBT_TRACE_SUBSTATUS_HQ_PENDING_MATCH;
                }
                else
                {
                    misc.ValueCode = DebtTracingSubStatus.C_DEBT_TRACE_SUBSTATUS_BR_PENDING_MATCH;
                }
                var status = common.GetMiscTypeCodeList(new List <doMiscTypeCode>()
                {
                    misc
                }).FirstOrDefault();

                res.ResultData = new {
                    DebtTracingSubStatus  = misc.ValueCode,
                    DebtTracingStatusDesc = (status != null ? status.ValueDisplay : "")
                };

                //scope.Complete(); // Coment scopy by Jirawat Jannet  on 2016-10-31
                //} // Coment scopy by Jirawat Jannet  on 2016-10-31
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }