Exemplo n.º 1
0
        public ActionResult CTR_GenerateReport(int?iDocID, string strDocNo, string strDocumentCode)
        {
            ObjectResultData         res           = new ObjectResultData();
            IContractDocumentHandler conDocHandler = ServiceContainer.GetService <IContractDocumentHandler>() as IContractDocumentHandler;

            try
            {
                conDocHandler.CreateContractReport(iDocID, strDocNo, strDocumentCode);
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get customer full name and change local language
        /// </summary>
        /// <param name="NameLC"></param>
        /// <param name="CompanyTypeCode"></param>
        /// <returns></returns>
        public ActionResult MAS020_CustomerNameLCChange(string NameLC, string CompanyTypeCode)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                MAS020_ScreenParameter param = GetScreenObject <MAS020_ScreenParameter>();
                res.ResultData = MAS020_GetCustomerFullName(param.CompanyTypeList, NameLC, CompanyTypeCode, false);
                return(Json(res));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
        /// <summary>
        /// Get support staff for view
        /// </summary>
        /// <param name="strProjectCode"></param>
        /// <returns></returns>
        public ActionResult CTS260_GetSupportStaffForView(string strProjectCode)
        {
            ObjectResultData res   = new ObjectResultData();
            IProjectHandler  Projh = ServiceContainer.GetService <IProjectHandler>() as IProjectHandler;

            List <dtTbt_ProjectSupportStaffDetailForView> lstStaff = Projh.GetTbt_ProjectSupportStaffDetailForView(strProjectCode);
            EmployeeMappingList emlst = new EmployeeMappingList();

            emlst.AddEmployee(lstStaff.ToArray());
            IEmployeeMasterHandler Emph = ServiceContainer.GetService <IEmployeeMasterHandler>() as IEmployeeMasterHandler;

            Emph.EmployeeListMapping(emlst);
            string result = CommonUtil.ConvertToXml <dtTbt_ProjectSupportStaffDetailForView>(lstStaff, "contract\\CTS260_support", CommonUtil.GRID_EMPTY_TYPE.VIEW);

            return(Json(result));
        }
        /// <summary>
        /// Load result data to grid
        /// </summary>
        /// <returns></returns>
        public ActionResult CTS270_GetResultList()
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                CTS270_ScreenParameter CTS270Param = GetScreenObject <CTS270_ScreenParameter>();
                dsCTS270Data           data        = CTS270Param.data;
                res.ResultData = CommonUtil.ConvertToXml <dtSearchMACheckupResult>(data.dtSearchResult, "Contract\\CTS270", CommonUtil.GRID_EMPTY_TYPE.SEARCH);
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }
            return(Json(res));
        }
        /// <summary>
        /// Initial screen parameter.
        /// </summary>
        /// <returns></returns>
        public ActionResult IVS050_InitParam()
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                IVS050_ScreenParameter prm = GetScreenObject <IVS050_ScreenParameter>();
                prm.ElemInstrument = new List <IVS040INST>();
                res.ResultData     = true;
                return(Json(res));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex); return(Json(res));
            }
        }
Exemplo n.º 6
0
        public ActionResult GetInstrumentCodeAll(string cond)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                IAutoCompleteHandler hand = ServiceContainer.GetService <IAutoCompleteHandler>() as IAutoCompleteHandler;
                res.ResultData = hand.GetInstrumentCodeAll(cond, null);
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }
Exemplo n.º 7
0
        public ActionResult GetInstrumentCodeExpansionParent(string cond)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                IAutoCompleteHandler hand = ServiceContainer.GetService <IAutoCompleteHandler>() as IAutoCompleteHandler;
                res.ResultData = hand.GetInstrumentCodeAll(cond, ExpansionType.C_EXPANSION_TYPE_PARENT);
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }
Exemplo n.º 8
0
 /// <summary>
 /// Bulig error message
 /// </summary>
 /// <param name="res"></param>
 /// <param name="controller"></param>
 /// <param name="obj"></param>
 /// <param name="param"></param>
 /// <param name="first_message"></param>
 /// <returns></returns>
 public static ObjectResultData BuildErrorMessage(ObjectResultData res, Controller controller, object[] obj = null, MessageParameter param = null, bool first_message = true)
 {
     try
     {
         if (controller == null)
         {
             return(null);
         }
         ValidatorUtil validator = new ValidatorUtil(controller);
         return(BuildErrorMessage(res, validator, obj, param, first_message));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 9
0
        /// <summary>
        /// Check shelf data exist
        /// </summary>
        /// <param name="ShelfNo"></param>
        /// <returns></returns>
        public ActionResult MAS120_CheckShelfNo(string ShelfNo)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                IInventoryHandler invenHand = ServiceContainer.GetService <IInventoryHandler>() as IInventoryHandler;
                res.ResultData = invenHand.IsEmptyShelf(ShelfNo);
                return(Json(res));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(null);
            }
        }
Exemplo n.º 10
0
        public ActionResult CMS421()
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                CMS421_ScreenParameter param = GetScreenObject <CMS421_ScreenParameter>();
                CommonUtil             cm    = new CommonUtil();

                string strContractCode = cm.ConvertContractCode(param.ContractCode, CommonUtil.CONVERT_TYPE.TO_LONG);

                IBillingHandler handler = ServiceContainer.GetService <IBillingHandler>() as IBillingHandler;
                List <dtTbt_AutoTransferBankAccountForView> listAutoTransferBankAccountData = handler.GetTbt_AutoTransferBankAccountForView(strContractCode, param.BillingOCC);

                ICommonHandler handlerCommon = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;


                if (listAutoTransferBankAccountData.Count > 0)
                {
                    //Misc mapping
                    MiscTypeMappingList miscMapping = new MiscTypeMappingList();
                    miscMapping.AddMiscType(listAutoTransferBankAccountData.ToArray <dtTbt_AutoTransferBankAccountForView>());
                    handlerCommon.MiscTypeMappingList(miscMapping);
                }

                if (listAutoTransferBankAccountData.Count > 0)
                {
                    ViewBag.txtBillingCode             = listAutoTransferBankAccountData[0].BillingCode_Short;
                    ViewBag.txtBillingClientCode       = listAutoTransferBankAccountData[0].BillingClientCode_Short;
                    ViewBag.txtBillingClientNameEN     = listAutoTransferBankAccountData[0].FullNameEN;
                    ViewBag.txtBillingClientNameLC     = listAutoTransferBankAccountData[0].FullNameLC;
                    ViewBag.txtAutoTransferAccountName = listAutoTransferBankAccountData[0].AccountName;
                    ViewBag.txtBankBranch             = listAutoTransferBankAccountData[0].BankNameEN + "/" + listAutoTransferBankAccountData[0].BankBranchNameEN;
                    ViewBag.txtAccountType            = listAutoTransferBankAccountData[0].AccountTypeName;
                    ViewBag.txtAccountNo              = listAutoTransferBankAccountData[0].AccountNo_ForView; // Edit by Narupon W. 28/05/2012
                    ViewBag.txtAutoTransferDate       = listAutoTransferBankAccountData[0].AutoTransferDate;
                    ViewBag.txtLastAutoTransferResult = listAutoTransferBankAccountData[0].LastestResultName;
                }

                return(View());
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
        /// <summary>
        /// Set button status
        /// </summary>
        /// <param name="Mode"></param>
        /// <param name="CurrentIndex"></param>
        /// <param name="list"></param>
        /// <param name="CurrentSortColIndex"></param>
        /// <param name="CurrentSortType"></param>
        /// <returns></returns>
        public ActionResult CTS270_SetBtnClickFlag(string Mode, int CurrentIndex, List <CTS270_CheckResultItem> list, int CurrentSortColIndex, string CurrentSortType)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                if (Mode == FunctionID.C_FUNC_ID_ADD)
                {
                    //Check System Suspending
                    res = checkSystemSuspending();
                    if (res.IsError)
                    {
                        return(Json(res));
                    }
                }

                CTS270_ScreenParameter CTS270Param = GetScreenObject <CTS270_ScreenParameter>();
                CTS270Param.isBtnClick          = true;
                CTS270Param.CurrentIndex        = CurrentIndex;
                CTS270Param.CurrentSortColIndex = CurrentSortColIndex;
                CTS270Param.CurrentSortType     = CurrentSortType;

                List <dtSearchMACheckupResult> nSort = new List <dtSearchMACheckupResult>();
                foreach (CTS270_CheckResultItem ma in list)
                {
                    foreach (dtSearchMACheckupResult r in CTS270Param.data.dtSearchResult)
                    {
                        if (r.KeyIndex == ma.KeyIndex)
                        {
                            r.CheckedFlag = ma.CheckedFlag ? "1" : "";
                            nSort.Add(r);
                            break;
                        }
                    }
                }
                CTS270Param.data.dtSearchResult = nSort;

                UpdateScreenObject(CTS270Param);
                res.ResultData = true;
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }
        /// <summary>
        /// Checking user's permission.
        /// </summary>
        /// <param name="param">Screen's parameter.</param>
        /// <returns>Return ActionResult of the screen.</returns>
        public ActionResult IVS240_Authority(IVS240_ScreenParameter param)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                ICommonHandler srvCommon = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                if (srvCommon.IsSystemSuspending())
                {
                    res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0049);
                    //res.ResultData = MessageUtil.MessageList.MSG0049.ToString();
                    return(Json(res));
                }

                if (!CheckUserPermission(ScreenID.C_INV_SCREEN_ID_PICKING_LIST, FunctionID.C_FUNC_ID_OPERATE))
                {
                    res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0053);
                    //res.ResultData = MessageUtil.MessageList.MSG0053.ToString();
                    return(Json(res));
                }

                IInventoryHandler srvInv = ServiceContainer.GetService <IInventoryHandler>() as IInventoryHandler;
                if (srvInv.CheckFreezedData() == 0)
                {
                    res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                    res.AddErrorMessage(MessageUtil.MODULE_INVENTORY, MessageUtil.MessageList.MSG4002);
                    //res.ResultData = MessageUtil.MessageList.MSG4002.ToString();
                    return(Json(res));
                }

                if (srvInv.CheckStartedStockChecking() == 0)
                {
                    res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                    res.AddErrorMessage(MessageUtil.MODULE_INVENTORY, MessageUtil.MessageList.MSG4003);
                    //res.ResultData = MessageUtil.MessageList.MSG4003.ToString();
                    return(Json(res));
                }
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(InitialScreenEnvironment <IVS240_ScreenParameter>("IVS240", param, res));
        }
Exemplo n.º 13
0
        /// <summary>
        /// Retrieve billing detail list of specific receipt no.
        /// </summary>
        /// <param name="receiptNo">receipt no.</param>
        /// <returns></returns>
        public ActionResult ICS081_SearchBillingbyReceiptNo(string receiptNo)
        {
            ObjectResultData res = new ObjectResultData();

            res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;
            ValidatorUtil validator = new ValidatorUtil();

            try
            {
                //Validate business
                if (CommonUtil.IsNullOrEmpty(receiptNo))
                {
                    validator.AddErrorMessage(MessageUtil.MODULE_INCOME, "ICS081"
                                              , MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0007
                                              , "ics081ReceiptNo", "lblReceiptNo", "ics081ReceiptNo");
                    ValidatorUtil.BuildErrorMessage(res, validator, null);
                    return(Json(res));
                }

                var handler = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler;

                //Get receipt
                doReceipt doReceipt = handler.GetReceipt(receiptNo);
                if (doReceipt == null)
                {
                    validator.AddErrorMessage(MessageUtil.MODULE_INCOME, "ICS081"
                                              , MessageUtil.MODULE_INCOME, MessageUtil.MessageList.MSG7003
                                              , "ics081ReceiptNo", "lblReceiptNo", "ics081ReceiptNo");
                    ValidatorUtil.BuildErrorMessage(res, validator, null);
                    res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                    return(Json(res));
                }

                //Get unpaid, return result
                List <doGetUnpaidBillingTargetByCodeWithExchange> unpaidList = handler.GetUnpaidBillingTargetByReceiptNoWithExchange(receiptNo);
                ICS081_ValidateDisplayBillingTargetSearchResult(res, unpaidList, true);
                res.ResultData = CommonUtil.ConvertToXml <doGetUnpaidBillingTargetByCodeWithExchange>(unpaidList, "Income\\ICS081", CommonUtil.GRID_EMPTY_TYPE.SEARCH);
                return(Json(res));
            }
            catch (Exception ex)
            {
                res             = new ObjectResultData();
                res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
Exemplo n.º 14
0
        // Resume/Suspend Now

        /// <summary>
        /// Method for Resume/Suspend system immediately
        /// </summary>
        /// <param name="UpdateType"></param>
        /// <returns></returns>
        public ActionResult CMS040_UpdateSystemStatus(string UpdateType)
        {
            bool bResult = false;

            try
            {
                ICommonHandler handler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;

                if (UpdateType == "SUSPEND")
                {
                    bResult = handler.UpdateSystemStatus(true, true, CommonUtil.dsTransData.dtUserData.EmpNo);
                }
                else if (UpdateType == "RESUME")
                {
                    bResult = handler.UpdateSystemStatus(false, true, CommonUtil.dsTransData.dtUserData.EmpNo);
                }


                List <doSystemStatus> l    = new List <doSystemStatus>();
                doSystemStatus        item = new doSystemStatus();

                var list = handler.GetSystemStatus();

                if (list.Count > 0)
                {
                    string strOnline  = CommonUtil.GetLabelFromResource("Common", "CMS040", "lblOnline");;
                    string strOffline = CommonUtil.GetLabelFromResource("Common", "CMS040", "lblOffline");


                    item.CompleteFlag               = bResult;
                    item.UpdateType                 = UpdateType;
                    item.SystemStatus               = (list[0].SuspendFlag == true) ? "Offline" : "Online";
                    item.SystemStatusDisplayName    = (list[0].SuspendFlag == true) ? strOffline : strOnline;
                    item.NextResumeServiceDateTime  = ((DateTime)list[0].ResumeServiceDateTime).ToString("dd-MMM-yyyy HH:mm:ss");
                    item.NextSuspendServiceDateTime = ((DateTime)list[0].SuspendServiceDateTime).ToString("dd-MMM-yyyy HH:mm:ss");
                    l.Add(item);
                }

                return(Json(l));
            }
            catch (Exception ex)
            {
                ObjectResultData res = new ObjectResultData();
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// Search shelf data
        /// </summary>
        /// <param name="txtShelfNo"></param>
        /// <param name="txtShelfName"></param>
        /// <param name="txtShelfType"></param>
        /// <param name="txtAreaCode"></param>
        /// <returns></returns>
        public ActionResult MAS120_Search(string txtShelfNo, string txtShelfName, string txtShelfType, string txtAreaCode)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                txtShelfNo   = (txtShelfNo == "" ? null : txtShelfNo);
                txtShelfName = (txtShelfName == "" ? null : txtShelfName);
                txtShelfType = (txtShelfType == "" ? null : txtShelfType);
                txtAreaCode  = (txtAreaCode == "" ? null : txtAreaCode);

                if (txtShelfNo == null && txtShelfName == null && txtShelfType == null && txtAreaCode == null)
                {
                    res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0006);
                }

                if (res.IsError)
                {
                    return(Json(res));
                }

                IShelfMasterHandler hand = ServiceContainer.GetService <IShelfMasterHandler>() as IShelfMasterHandler;
                List <doShelf>      list = hand.GetShelf(txtShelfNo, txtShelfName, txtShelfType, txtAreaCode);

                List <doShelf> tmpList = (from t in list
                                          where t.DeleteFlag != true
                                          select t).ToList <doShelf>();
                foreach (doShelf tmp in tmpList)
                {
                    ICommonHandler comHandler           = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                    string         strShelfTypeCodeName = comHandler.GetMiscDisplayValue(MiscType.C_INV_SHELF_TYPE, tmp.ShelfTypeCode);
                    tmp.ShelfTypeCodeName = strShelfTypeCodeName;
                    string strAreaCodeName = comHandler.GetMiscDisplayValue(MiscType.C_INV_AREA, tmp.AreaCode);
                    tmp.AreaCodeName = strAreaCodeName;
                }

                string xml = CommonUtil.ConvertToXml <doShelf>(tmpList, "Master\\MAS120", CommonUtil.GRID_EMPTY_TYPE.SEARCH);
                res.ResultData = xml;
                return(Json(res));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(null);
            }
        }
        /// <summary>
        /// Validate before add instrument.
        /// </summary>
        /// <param name="Cond"></param>
        /// <returns></returns>
        public ActionResult IVS040_beforeAddElem(IVS040INST Cond)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                IVS040_ScreenParameter prm = GetScreenObject <IVS040_ScreenParameter>();
                if (prm.ElemInstrument == null)
                {
                    prm.ElemInstrument = new List <IVS040INST>();
                }


                foreach (IVS040INST i in prm.ElemInstrument)
                {
                    if (i.InstrumentCode == Cond.InstrumentCode && i.AreaCode == Cond.AreaCode)
                    {
                        res.AddErrorMessage(MessageUtil.MODULE_INVENTORY, MessageUtil.MessageList.MSG4005);
                        res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;
                        return(Json(res));
                    }
                }
                ICommonHandler comHand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                Cond.Currencies = comHand.GetMiscTypeCodeList(new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_CURRENCT,
                        ValueCode = "%"
                    }
                }).ToList();

                // Default Currency "Rp." Pachara S. 12102016
                Cond.TransferAmountCurrencyType = SECOM_AJIS.Common.Util.ConstantValue.CurrencyUtil.C_CURRENCY_LOCAL;

                prm.ElemInstrument.Add(Cond);

                UpdateScreenObject(prm);

                res.ResultData = true;
                return(Json(true));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex); return(Json(res));
            }
        }
Exemplo n.º 17
0
        public ActionResult MAS130()
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                ViewBag.HasPermissionAdd  = CheckUserPermission(ScreenID.C_SCREEN_ID_MAINTAIN_SAFETY_STOCK_INFO, FunctionID.C_FUNC_ID_ADD);
                ViewBag.HasPermissionEdit = CheckUserPermission(ScreenID.C_SCREEN_ID_MAINTAIN_SAFETY_STOCK_INFO, FunctionID.C_FUNC_ID_EDIT);
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }

            return(View());
        }
Exemplo n.º 18
0
        /// <summary>
        /// Get View Billin gBasic
        /// </summary>
        /// <param name="strBillingTargetCode"></param>
        /// <returns></returns>
        public ActionResult CMS400_GetViewBillingBasicForGrid(string strBillingTargetCode)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                CommonUtil          cm = new CommonUtil();
                IViewBillingHandler handlerViewBilling = ServiceContainer.GetService <IViewBillingHandler>() as IViewBillingHandler;
                if (!CommonUtil.IsNullOrEmpty(strBillingTargetCode))
                {
                    strBillingTargetCode = cm.ConvertBillingTargetCode(strBillingTargetCode, CommonUtil.CONVERT_TYPE.TO_LONG);
                }

                ICommonHandler        comHand       = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode> tmpCurrencies = comHand.GetMiscTypeCodeList(new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_CURRENCT,
                        ValueCode = "%"
                    }
                }).ToList();

                List <dtViewBillingBasicList> lst = handlerViewBilling.GetViewBillingBasicList(
                    null,
                    strBillingTargetCode,
                    null,
                    null,
                    null,
                    null
                    );

                for (int i = 0; i < lst.Count(); i++)
                {
                    lst[i].Currencies = new List <doMiscTypeCode>(tmpCurrencies);
                }

                res.ResultData = CommonUtil.ConvertToXml <dtViewBillingBasicList>(lst, "Common\\CMS400_BillingBasic", CommonUtil.GRID_EMPTY_TYPE.VIEW);
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }
            return(Json(res));
        }
Exemplo n.º 19
0
        /// <summary>
        /// Retrieve next payment status description of specific current payment status and correction reason
        /// </summary>
        /// <param name="paymentStatus">current payment status</param>
        /// <param name="correctionReason">correction reason</param>
        /// <returns></returns>
        public ActionResult ICS090_GetNextPaymentStatus(string paymentStatus, string correctionReason)
        {
            ObjectResultData res = new ObjectResultData();

            res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;
            try
            {
                string nextPaymentStatus = ICS090_GetCancelPaymentNextStatus(paymentStatus, correctionReason);
                res.ResultData = ICS090_GetPaymentStatusDesctription(nextPaymentStatus);
            }
            catch (Exception ex)
            {
                res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                res.AddErrorMessage(ex);
            }
            return(Json(res));
        }
        /// <summary>
        /// Load attach for show in grid attach
        /// </summary>
        /// <returns></returns>
        public ActionResult CTS230_LoadGridAttachedDocList()
        {
            ICommonHandler   commonhandler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
            ObjectResultData res           = new ObjectResultData();

            try
            {
                List <dtAttachFileForGridView> lstAttachedName = commonhandler.GetAttachFileForGridView(GetCurrentKey());
                res.ResultData = CommonUtil.ConvertToXml <dtAttachFileForGridView>(lstAttachedName, "Installation\\ISS010_AttachedDocList", CommonUtil.GRID_EMPTY_TYPE.INSERT);
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }
        /// <summary>
        /// Generate company full name for display only local name.
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public ActionResult MAS030_CustNameLCChange(MAS030_GetCompanyFullName param)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                MAS030_ScreenParameter MAS030Param = GetScreenObject <MAS030_ScreenParameter>();
                param.FullNameLC = MAS030_DisplayFullName(MAS030Param, param.NameLC, param.CompanyTypeCode, false);
                res.ResultData   = param;
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }
Exemplo n.º 22
0
        public ActionResult ACS010_CheckGenerateReqField(ACS010_Generate generateCondition)
        {
            ObjectResultData res = new ObjectResultData();

            res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;

            try
            {
                AccountingHandler           handler   = new AccountingHandler();
                List <dtAccountingDocument> documents = handler.GetAccountingDocument(generateCondition.documentCode);

                //Validate
                if (documents[0].DocumentTimingType == "D2")
                {
                    if (CommonUtil.IsNullOrEmpty(generateCondition.generateTargetFrom) || CommonUtil.IsNullOrEmpty(generateCondition.generateTargetTo))
                    {
                        res.AddErrorMessage(MessageUtil.MODULE_ACCOUNTING,
                                            ScreenID.C_SCREEN_ID_OTHER_ACCOUNTING_REPORT,
                                            MessageUtil.MODULE_ACCOUNTING,
                                            MessageUtil.MessageList.MSG8001,
                                            new string[] { "lblTargetPeriod" },
                                            new string[] { "GenerateTargetFrom" });
                        return(Json(res));
                    }
                }
                else
                {
                    if (CommonUtil.IsNullOrEmpty(generateCondition.generateTargetTo))
                    {
                        res.AddErrorMessage(MessageUtil.MODULE_ACCOUNTING,
                                            ScreenID.C_SCREEN_ID_OTHER_ACCOUNTING_REPORT,
                                            MessageUtil.MODULE_ACCOUNTING,
                                            MessageUtil.MessageList.MSG8001,
                                            new string[] { "lblTargetPeriod" },
                                            new string[] { "GenerateTargetTo" });
                        return(Json(res));
                    }
                }
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }
        public ActionResult BLS030_GetBillingType(string ProductTypeCode)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                BLS030_ScreenParameter sParam    = GetScreenObject <BLS030_ScreenParameter>();
                string strBillingServiceTypeCode = "";
                if (sParam.ProductTypeCode == ProductType.C_PROD_TYPE_AL || sParam.ProductTypeCode == ProductType.C_PROD_TYPE_ONLINE)
                {
                    strBillingServiceTypeCode = BillingServiceTypeCode.C_BILLING_SERVICE_TYPE_CODE_N;
                }
                else if (sParam.ProductTypeCode == ProductType.C_PROD_TYPE_MA)
                {
                    strBillingServiceTypeCode = BillingServiceTypeCode.C_BILLING_SERVICE_TYPE_CODE_MA;
                }
                else if (sParam.ProductTypeCode == ProductType.C_PROD_TYPE_BE || sParam.ProductTypeCode == ProductType.C_PROD_TYPE_SG)
                {
                    strBillingServiceTypeCode = BillingServiceTypeCode.C_BILLING_SERVICE_TYPE_CODE_SG;
                }
                else if (sParam.ProductTypeCode == ProductType.C_PROD_TYPE_SALE)
                {
                    strBillingServiceTypeCode = BillingServiceTypeCode.C_BILLING_SERVICE_TYPE_CODE_Q;
                }
                else if (sParam.ServiceTypeCode == ServiceType.C_SERVICE_TYPE_PROJECT)
                {
                    strBillingServiceTypeCode = null;
                }

                sParam.strBillingServiceTypeCode = strBillingServiceTypeCode;
                IBillingMasterHandler  billingMasterHandler = ServiceContainer.GetService <IBillingMasterHandler>() as IBillingMasterHandler;
                List <tbm_BillingType> BillingTypeList      = billingMasterHandler.GetBillingTypeOneTimeListData(strBillingServiceTypeCode);
                CommonUtil.MappingObjectLanguage <tbm_BillingType>(BillingTypeList);
                ComboBoxModel cboModel = new ComboBoxModel();
                cboModel.SetList <tbm_BillingType>(BillingTypeList, "BillingTypeCodeName", "BillingTypeCode");


                return(Json(cboModel));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }
            return(Json(res));
        }
Exemplo n.º 24
0
        /// <summary>
        /// Check IP address is permitted
        /// </summary>
        /// <param name="cond"></param>
        /// <returns></returns>
        public ActionResult isPermittedIPAddress(string cond)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                //IApprovalPermissionHandler handler = ServiceContainer.GetService<IApprovalPermissionHandler>() as IApprovalPermissionHandler;
                //bool bIsPermitted = handler.isPermittedIPAddress();
                //return Json(bIsPermitted);
                return(Json(isPermittedIPAddress()));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// Check exist file before download file
        /// </summary>
        /// <param name="strDocumentNo"></param>
        /// <param name="documentOCC"></param>
        /// <param name="strDocumentCode"></param>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public ActionResult CMS030_CheckExistFile(string strDocumentNo, string documentOCC, string strDocumentCode, string fileName)
        {
            try
            {
                string path = PathUtil.GetPathValue(PathUtil.PathName.GeneratedReportPath, fileName);// ReportUtil.GetGeneratedReportPath(fileName);

                if (System.IO.File.Exists(path) == true)
                {
                    return(Json(1));
                }
                else
                {
                    return(Json(0));
                }


                // Old version

                /*
                 * IDocumentHandler handler = ServiceContainer.GetService<IDocumentHandler>() as IDocumentHandler;
                 * List<int?> list = handler.IsExistReport(strDocumentNo, documentOCC, strDocumentCode);
                 * if (list[0].HasValue)
                 * {
                 *  if (list[0].Value > 0)
                 *  {
                 *      return Json(1);
                 *  }
                 *  else
                 *  {
                 *      return Json(0);
                 *  }
                 * }
                 * else
                 * {
                 *  return Json(0);
                 * }
                 *
                 */
            }
            catch (Exception ex)
            {
                ObjectResultData res = new ObjectResultData();
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// Get expected OperationDate for set initail data
        /// </summary>
        /// <returns></returns>
        public ActionResult GetExpectedOperationDate_CTS054()
        {
            ObjectResultData       res = new ObjectResultData();
            CTS054_ScreenParameter session;

            try
            {
                session = CTS054_GetImportData();
                return(Json(session.DOValidateBusiness));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }
Exemplo n.º 27
0
        public ActionResult ICS110_GetWHTData(string WHTNo)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                var hand = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler;
                var wht  = hand.GetTbt_IncomeWHT(WHTNo);
                res.ResultData = (wht == null ? null : wht.FirstOrDefault());
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }
        /// <summary>
        /// - Check system suspending.<br />
        /// - Check user permission for screen IVS012.<br />
        /// - Check freezed data.<br />
        /// - Check started stock checking.<br />
        /// - Get inventory head office.
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public ActionResult IVS012_Authority(IVS012_ScreenParameter param)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                IInventoryHandler handInven = ServiceContainer.GetService <IInventoryHandler>() as IInventoryHandler;

                ICommonHandler comh = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                if (comh.IsSystemSuspending())
                {
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0049);
                    return(Json(res));
                }
                if (!CheckUserPermission(ScreenID.C_INV_SCREEN_ID_STOCKIN_ASSET, FunctionID.C_FUNC_ID_OPERATE))
                {
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0053);
                    return(Json(res));
                }
                if (handInven.CheckFreezedData() == 0)
                {
                    res.AddErrorMessage(MessageUtil.MODULE_INVENTORY, MessageUtil.MessageList.MSG4002);
                    return(Json(res));
                }
                if (handInven.CheckStartedStockChecking() == 0)
                {
                    res.AddErrorMessage(MessageUtil.MODULE_INVENTORY, MessageUtil.MessageList.MSG4003);
                    return(Json(res));
                }
                List <doOffice> IvHeadOffice = handInven.GetInventoryHeadOffice();

                if (IvHeadOffice.Count <= 0)
                {
                    res.AddErrorMessage(MessageUtil.MODULE_INVENTORY, MessageUtil.MessageList.MSG4016);
                    return(Json(res));
                }

                param.office = IvHeadOffice[0];
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(InitialScreenEnvironment <IVS012_ScreenParameter>("IVS012", param, res));
        }
Exemplo n.º 29
0
        /// <summary>
        /// Get misctype display by code
        /// </summary>
        /// <param name="FieldName"></param>
        /// <param name="ValueCode"></param>
        /// <returns></returns>
        public string ISS080_GetMiscDisplayByValueCode(string FieldName, string ValueCode)
        {
            ObjectResultData      res        = new ObjectResultData();
            string                strDisPlay = "";
            List <doMiscTypeCode> lst        = new List <doMiscTypeCode>();
            string                lang       = CommonUtil.GetCurrentLanguage();

            try
            {
                List <doMiscTypeCode> miscs = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = FieldName,
                        ValueCode = ValueCode
                    }
                };

                ICommonHandler hand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                lst = hand.GetMiscTypeCodeList(miscs);

                if (lst.Count > 0)
                {
                    if (lang == SECOM_AJIS.Common.Util.ConstantValue.CommonValue.DEFAULT_LANGUAGE_EN)
                    {
                        strDisPlay = lst[0].ValueDisplayEN;
                    }
                    else if (lang == SECOM_AJIS.Common.Util.ConstantValue.CommonValue.DEFAULT_LANGUAGE_JP)
                    {
                        strDisPlay = lst[0].ValueDisplayJP;
                    }
                    else if (lang == SECOM_AJIS.Common.Util.ConstantValue.CommonValue.DEFAULT_LANGUAGE_LC)
                    {
                        strDisPlay = lst[0].ValueDisplayLC;
                    }
                }
                else
                {
                    strDisPlay = "";
                }
            }
            catch (Exception ex)
            {
            }
            return(strDisPlay);
        }
        /// <summary>
        /// Retrieve unpaid detail dept summary information by billingtarget list of specific screen mode and search criteria information
        /// </summary>
        /// <param name="data">Search criteria from link</param>
        /// <returns></returns>
        public ActionResult ICS030_LoadGetUnpaidDetailDebtSummaryByBillingTargetData(ICS030_RegisterData data)
        {
            ICS030_ScreenParameter param = GetScreenObject <ICS030_ScreenParameter>();
            ObjectResultData       res   = new ObjectResultData();

            res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;
            List <doGetUnpaidDetailDebtSummary> _doGetUnpaidDetailDebtSummaryList = new List <doGetUnpaidDetailDebtSummary>();

            try
            {
                if (param != null)
                {
                    data.intMonth = data.RawdtpMonthYear.Month;
                    data.intYear  = data.RawdtpMonthYear.Year;

                    CommonUtil     comUtil        = new CommonUtil();
                    IIncomeHandler iincomeHandler = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler;
                    _doGetUnpaidDetailDebtSummaryList = iincomeHandler.GetUnpaidDetailDebtSummaryByBillingTargetList(
                        comUtil.ConvertContractCode(data.strBillingTargetCode, CommonUtil.CONVERT_TYPE.TO_LONG), data.strOfficeCode); //Add (strOfficeCode) by Jutarat A. on 11042014

                    foreach (var item in _doGetUnpaidDetailDebtSummaryList)
                    {
                        if (item.DebtTracingRegistered == 1)
                        {
                            item.DebtTracingRegisteredGridFormat = param.conYes;
                        }
                        else
                        {
                            item.DebtTracingRegisteredGridFormat = param.conNo;
                        }
                    }

                    // Save RegisterData in session
                    param.RegisterData = data;
                }
            }
            catch (Exception ex)
            {
                res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                res.AddErrorMessage(ex);
                return(Json(res));
            }
            res.ResultData = CommonUtil.ConvertToXml <doGetUnpaidDetailDebtSummary>(_doGetUnpaidDetailDebtSummaryList, "Income\\ICS030_ListOfUnPaidByBillingTarget", CommonUtil.GRID_EMPTY_TYPE.VIEW);
            return(Json(res));
        }