public ActionResult GetPersonInChargeFirstElementAllCombo(string filter) { filter = filter == "" ? null : filter; try { List <dtBelongingEmpNo> result = new List <dtBelongingEmpNo>(); string strDisplayName = "EmpValueCode"; try { if (filter != null) { IEmployeeMasterHandler handler = ServiceContainer.GetService <IEmployeeMasterHandler>() as IEmployeeMasterHandler; result = handler.GetBelongingEmpNoByOffice(filter); CommonUtil.MappingObjectLanguage <dtBelongingEmpNo>(result); } } catch { result = new List <dtBelongingEmpNo>(); } ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <dtBelongingEmpNo>(result, strDisplayName, "EmpNo", true, CommonUtil.eFirstElementType.All); return(Json(cboModel)); } catch (Exception ex) { return(null); } }
/// <summary> /// Load ChangeType by selected serviceType. /// </summary> /// <param name="serviceType"></param> /// <returns></returns> public ActionResult ListMiscChangeType(string serviceType) { ICommonHandler handCom = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler; List <doMiscTypeCode> MiscTypeCode = new List <doMiscTypeCode>(); MiscTypeCode.Add(new doMiscTypeCode()); if (serviceType == ServiceType.C_SERVICE_TYPE_RENTAL) { MiscTypeCode[0].FieldName = MiscType.C_RENTAL_CHANGE_TYPE; } else { MiscTypeCode[0].FieldName = MiscType.C_SALE_CHANGE_TYPE; } MiscTypeCode[0].ValueCode = "%"; List <doMiscTypeCode> MiscTypeResult = handCom.GetMiscTypeCodeList(MiscTypeCode); ComboBoxModel CbxModel = new ComboBoxModel(); CbxModel.SetList <doMiscTypeCode>(MiscTypeResult, "ValueCodeDisplay", "ValueCode", false); return(Json(CbxModel)); }
public ActionResult GetAmphorENFirstElementAll(string provinceCode) { ObjectResultData res = new ObjectResultData(); try { IMasterHandler hand = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler; List <tbm_District> lst = hand.GetTbm_District(provinceCode); var sortedList = from p in lst orderby p.DistrictNameEN select p; lst = sortedList.ToList <tbm_District>(); ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <tbm_District>(lst, "DistrictNameEN", "DistrictCode", true, CommonUtil.eFirstElementType.All); res.ResultData = cboModel; } catch (Exception ex) { res.AddErrorMessage(ex); } return(Json(res)); }
public ActionResult GetAmphorLCFirstElementAll(string provinceCode) { ObjectResultData res = new ObjectResultData(); try { IMasterHandler hand = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler; List <tbm_District> lst = hand.GetTbm_District(provinceCode); //var sortedList = from p in lst // orderby p.DistrictNameLC // select p; //lst = sortedList.ToList<tbm_District>(); CultureInfo culture = new CultureInfo(CommonValue.DEFAULT_LANGUAGE_LC); lst = lst.OrderBy(p => p.DistrictNameLC, StringComparer.Create(culture, false)).ToList(); ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <tbm_District>(lst, "DistrictNameLC", "DistrictCode", true, CommonUtil.eFirstElementType.All); res.ResultData = cboModel; } catch (Exception ex) { res.AddErrorMessage(ex); } return(Json(res)); }
public ActionResult ISS080_GetMiscInstallationtype(string strFieldName) { string strDisplayName = "ValueCodeDisplay"; List <doMiscTypeCode> lst = new List <doMiscTypeCode>(); try { List <doMiscTypeCode> miscs = new List <doMiscTypeCode>() { new doMiscTypeCode() { FieldName = strFieldName, ValueCode = "%" } }; ICommonHandler hand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler; lst = hand.GetMiscTypeCodeList(miscs); ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <doMiscTypeCode>(lst, strDisplayName, "ValueCode"); return(Json(cboModel)); } catch (Exception ex) { ObjectResultData res = new ObjectResultData(); res.AddErrorMessage(ex); return(Json(res)); } }
/// <summary> /// Generate correction reason comboitem list upon payment status of specific invoice no. /// </summary> /// <param name="paymentStatus">payment status</param> /// <returns></returns> public ActionResult ICS090_GetCorrectionReason(string paymentStatus) { try { //Get misc type List <doMiscTypeCode> miscs = new List <doMiscTypeCode>() { new doMiscTypeCode() { FieldName = MiscType.C_CORRECTION_REASON, ValueCode = "%" } }; ICommonHandler commonHandler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler; List <doMiscTypeCode> correctionList = new List <doMiscTypeCode>(); if (paymentStatus == PaymentStatus.C_PAYMENT_STATUS_BANK_PAID || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_AUTO_PAID || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_CASH_PAID || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_CHEQUE_PAID || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_CASHIER_PAID || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_AUTO_FAIL_BANK_PAID || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_NOTE_FAIL_BANK_PAID || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_POST_FAIL_BANK_PAID || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_PARTIALLY_PAID || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_PAID_WITH_PARTIAL_CN || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_PARTIALLY_PAID_CN || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_PAID_WITH_PARTIAL_REFUND || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_REFUND_PAID) { correctionList = commonHandler.GetMiscTypeCodeList(miscs).Where(d => d.ValueCode == CorrectionReason.C_CORRECTION_REASON_MISTAKE).ToList(); } else if (paymentStatus == PaymentStatus.C_PAYMENT_STATUS_NOTE_MATCHED || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_POST_MATCHED) { //All, Except encash correctionList = commonHandler.GetMiscTypeCodeList(miscs).Where(d => d.ValueCode != CorrectionReason.C_CORRECTION_REASON_ENCASH_MISTAKE).ToList(); } else if (paymentStatus == PaymentStatus.C_PAYMENT_STATUS_NOTE_ENCASHED || paymentStatus == PaymentStatus.C_PAYMENT_STATUS_POST_ENCASHED) { //Encash only correctionList = commonHandler.GetMiscTypeCodeList(miscs).Where(d => d.ValueCode == CorrectionReason.C_CORRECTION_REASON_ENCASH_MISTAKE).ToList(); } //Set correction reason combobox ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <doMiscTypeCode>(correctionList, "ValueDisplay", "ValueCode"); //Success, return result return(Json(cboModel)); } catch (Exception ex) { ObjectResultData res = new ObjectResultData(); res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION; res.AddErrorMessage(ex); return(Json(res)); } }
private ActionResult GetChangeTypeFirstElementAllCombo(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", true, CommonUtil.eFirstElementType.All); return(Json(cboModel)); } catch (Exception ex) { // return Json(MessageUtil.GetMessage(ex)); return(null); } }
/// <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)); } }
public ActionResult CMS030_GetOperationOffice(string strDocumentType) { List <OfficeDataDo> nLst = new List <OfficeDataDo>(); string strDisplayName = "OfficeCodeName"; try { List <OfficeDataDo> lst = (from p in CommonUtil.dsTransData.dtOfficeData where p.FunctionSecurity != FunctionSecurity.C_FUNC_SECURITY_NO orderby p.OfficeCode ascending select p).ToList <OfficeDataDo>(); if (strDocumentType == DocumentType.C_DOCUMENT_TYPE_INSTALLATION) { ICommonHandler handlerCommon = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler; List <doMiscTypeCode> miscs = new List <doMiscTypeCode>() { new doMiscTypeCode() { FieldName = MiscType.C_PROJECT_OFFICE_DUMMY, ValueCode = "%" } }; List <doMiscTypeCode> doMiscs = handlerCommon.GetMiscTypeCodeList(miscs); if (doMiscs != null && doMiscs.Count > 0) { OfficeDataDo tmpOffice = new OfficeDataDo(); tmpOffice.OfficeCode = doMiscs[0].ValueCode; tmpOffice.OfficeName = doMiscs[0].ValueDisplay; tmpOffice.OfficeNameEN = doMiscs[0].ValueDisplayEN; tmpOffice.OfficeNameLC = doMiscs[0].ValueDisplayLC; tmpOffice.OfficeNameJP = doMiscs[0].ValueDisplayJP; lst.Add(tmpOffice); } } lst = (from p in lst orderby p.OfficeCode ascending select p).ToList <OfficeDataDo>(); nLst = CommonUtil.ClonsObjectList <OfficeDataDo, OfficeDataDo>(lst); CommonUtil.MappingObjectLanguage <OfficeDataDo>(nLst); ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <OfficeDataDo>(nLst, strDisplayName, "OfficeCode"); return(Json(cboModel)); } catch (Exception ex) { ObjectResultData res = new ObjectResultData(); res.AddErrorMessage(ex); return(Json(res)); } }
/// <summary> /// Retrieve receipt information of specific receipt no. /// </summary> /// <param name="param">receipt no.</param> /// <returns></returns> public ActionResult ICS060_GetReceipt(ICS060_ScreenParameter param) { ObjectResultData res = new ObjectResultData(); res.MessageType = MessageModel.MESSAGE_TYPE.WARNING; doReceipt doReceipt; try { //Validate receipt business doReceipt = ICS060_ValidateReceiptBusiness(param, res); if (res.IsError || doReceipt == null) { return(Json(res)); } //Pass, Set doReceipt ICS060_ReceiptInformation result = new ICS060_ReceiptInformation(); result.doReceipt = doReceipt; //Set cancel method IBillingHandler billingHandler = ServiceContainer.GetService <IBillingHandler>() as IBillingHandler; IIncomeHandler incomeHandler = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler; // Add By Sommai P., Oct 31, 2013 bool isIssuedTaxInvoice = billingHandler.CheckInvoiceIssuedTaxInvoice(doReceipt.InvoiceNo, doReceipt.InvoiceOCC); bool isCancelTaxInvoiceOption = incomeHandler.CheckCancelTaxInvoiceOption(doReceipt.InvoiceNo, doReceipt.InvoiceOCC); // Add By Sommai P., Oct 31, 2013 string filterValueCode = "%"; if (isIssuedTaxInvoice == false || isCancelTaxInvoiceOption == false) // Modify By Sommai P., Oct 31, 2013 { filterValueCode = CancelReceiptTarget.C_CANCEL_RECEIPT_ONLY; } ICommonHandler commonHandler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler; List <doMiscTypeCode> miscs = new List <doMiscTypeCode>() { new doMiscTypeCode() { FieldName = MiscType.C_CANCEL_RECEIPT_TARGET, ValueCode = filterValueCode } }; ICommonHandler hand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler; List <doMiscTypeCode> lst = hand.GetMiscTypeCodeList(miscs); ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <doMiscTypeCode>(lst, "ValueDisplay", "ValueCode"); result.CancelMethodComboBoxModel = cboModel; res.ResultData = result; return(Json(res)); } catch (Exception ex) { res = new ObjectResultData(); res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION; res.AddErrorMessage(ex); return(Json(res)); } }
/// <summary> /// Generate bank's branch comboitem list upon selected bank code /// </summary> /// <param name="bankCode">bank code</param> /// <returns></returns> public ActionResult ICS010_GetBankBranch(string bankCode) { try { IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler; List <tbm_BankBranch> list = handler.GetTbm_BankBranch(bankCode); foreach (var item in list) { // Check user aplication launguage if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN) { item.BankBranchName = item.BankBranchNameEN; } else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP) { item.BankBranchName = item.BankBranchNameEN; } else { item.BankBranchName = item.BankBranchNameLC; } } CultureInfo culture = null; if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN) { culture = new CultureInfo(CommonValue.DEFAULT_LANGUAGE_EN); list = list.OrderBy(p => p.BankBranchName, StringComparer.Create(culture, false)).ToList(); } else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP) { culture = new CultureInfo(CommonValue.DEFAULT_LANGUAGE_EN); // Note BankName have only EN , LC then JP set to EN list = list.OrderBy(p => p.BankBranchName, StringComparer.Create(culture, false)).ToList(); } else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_LC) { culture = new CultureInfo(CommonValue.DEFAULT_LANGUAGE_LC); list = list.OrderBy(p => p.BankBranchName, StringComparer.Create(culture, false)).ToList(); } ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <tbm_BankBranch>(list, "BankBranchName", "BankBranchCode"); return(Json(cboModel)); } catch (Exception ex) { ObjectResultData res = new ObjectResultData(); res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION; res.AddErrorMessage(ex); return(Json(res)); } }
public ActionResult CMS070_GetProductTypeByProductTypeCode(string ServiceTypeCode) { string strDisplayName = "ValueCodeDisplay"; List <doMiscTypeCode> lst = new List <doMiscTypeCode>(); try { List <View_tbm_Product> list = new List <View_tbm_Product>(); try { IProductMasterHandler handler = ServiceContainer.GetService <IProductMasterHandler>() as IProductMasterHandler; list = handler.GetTbm_ProductByLanguage(null, null); } catch { list = new List <View_tbm_Product>(); } if (!CommonUtil.IsNullOrEmpty(ServiceTypeCode)) { if (ServiceTypeCode == ServiceType.C_SERVICE_TYPE_SALE) { list = (from t in list where t.ProductTypeCode == ProductType.C_PROD_TYPE_SALE select t).ToList <View_tbm_Product>(); } else if (ServiceTypeCode == ServiceType.C_SERVICE_TYPE_RENTAL) { list = (from t in list where t.ProductTypeCode != ProductType.C_PROD_TYPE_SALE select t).ToList <View_tbm_Product>(); } } ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <View_tbm_Product>(list, "ProductCodeName", "ProductCode", true, CommonUtil.eFirstElementType.All); return(Json(cboModel)); } catch (Exception ex) { ObjectResultData res = new ObjectResultData(); 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)); }
/// <summary> /// Generate SECOM bank/branch comboitem list upon selected payment type /// </summary> /// <param name="paymentType">bayment type</param> /// <returns></returns> public ActionResult ICS010_GetSECOMAccount(string paymentType) { try { List <doSECOMAccount> doSECOMAccount = ICS010_GetSECOMAccountByPaymentType(paymentType); ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <doSECOMAccount>(doSECOMAccount, "Text", "SecomAccountID"); return(Json(cboModel)); } catch (Exception ex) { ObjectResultData res = new ObjectResultData(); res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION; res.AddErrorMessage(ex); return(Json(res)); } }
public ActionResult BLS031_BankBranchData(string BankCode) { ObjectResultData res = new ObjectResultData(); try { IMasterHandler hand = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler; List <tbm_BankBranch> list = hand.GetTbm_BankBranch(BankCode); //var sortedList = from p in lst // orderby p.BankBranchName // select p; //lst = sortedList.ToList<tbm_BankBranch>(); CultureInfo culture = null; string strDisplayName = "BankBranchNameEN"; if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN || CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP) { strDisplayName = "BankBranchNameEN"; culture = new CultureInfo(CommonValue.DEFAULT_LANGUAGE_EN); list = list.OrderBy(p => p.BankBranchNameEN, StringComparer.Create(culture, false)).ToList(); } else { strDisplayName = "BankBranchNameLC"; culture = new CultureInfo(CommonValue.DEFAULT_LANGUAGE_LC); list = list.OrderBy(p => p.BankBranchNameLC, StringComparer.Create(culture, false)).ToList(); } ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <tbm_BankBranch>(list, strDisplayName, "BankBranchCode", false); res.ResultData = cboModel; } catch (Exception ex) { res.AddErrorMessage(ex); } return(Json(res)); }
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); } }
/// <summary> /// Load Incident/AR Type by selected serviceType. /// </summary> /// <param name="serviceType"></param> /// <returns></returns> public ActionResult ListMiscIncidentARType(string serviceType) { ICommonHandler handCom = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler; List <doMiscTypeCode> MiscTypeCode = new List <doMiscTypeCode>(); for (int i = 0; i < 2; i++) { MiscTypeCode.Add(new doMiscTypeCode()); } MiscTypeCode[0].FieldName = MiscType.C_INCIDENT_TYPE; MiscTypeCode[0].ValueCode = "%"; MiscTypeCode[1].FieldName = MiscType.C_AR_TYPE; MiscTypeCode[1].ValueCode = "%"; List <doMiscTypeCode> MiscTypeResult = handCom.GetMiscTypeCodeList(MiscTypeCode); ComboBoxModel CbxModel = new ComboBoxModel(); CbxModel.SetList <doMiscTypeCode>(MiscTypeResult, "ValueCodeDisplay", "ValueCode", false); return(Json(CbxModel)); }
public ActionResult CMS180_InstallationHistory(string ContractProjectCode, string MaintenanceNo, string SlipNo) { ObjectResultData res = new ObjectResultData(); try { //IInstallationHandler hand = ServiceContainer.GetService<IInstallationHandler>() as IInstallationHandler; //List<tbt_InstallationHistory> lst = hand.GetTbt_InstallationHistory(ContractProjectCode, MaintenanceNo, null); IInstallationHandler hand = ServiceContainer.GetService <IInstallationHandler>() as IInstallationHandler; //List<dtInstallationHistoryForView> lst = hand.GetTbt_InstallationHistoryForView( // ServiceType.C_SERVICE_TYPE_SALE, // ServiceType.C_SERVICE_TYPE_RENTAL, // MiscType.C_SALE_INSTALL_TYPE, // MiscType.C_RENTAL_INSTALL_TYPE, // ChangeReasonType.C_CHANGE_REASON_TYPE_CUSTOMER, // ChangeReasonType.C_CHANGE_REASON_TYPE_SECOM, // MiscType.C_CUSTOMER_REASON, // MiscType.C_SECOM_REASON, // ContractProjectCode, MaintenanceNo, null); List <dtInsHistory> lst = hand.GetSlipNoHistory(SlipNo); //Comment by Jutarat A. on 08052013 (Sort from sp_IS_GetSlipNoHistory) //var sortedList = from p in lst // orderby p.SlipNo // select p; //lst = sortedList.ToList<dtInsHistory>(); //End Comment ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <dtInsHistory>(lst, "SlipNo", "SlipNo"); res.ResultData = cboModel; } catch (Exception ex) { res.AddErrorMessage(ex); } return(Json(res)); }
public ActionResult ICS150_GetGroupName(DateTime?paymentDate, string createBy) { try { IIncomeHandler handler = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler; if (string.IsNullOrEmpty(createBy) && CommonUtil.dsTransData != null) { createBy = CommonUtil.dsTransData.dtUserData.EmpNo; } List <doGetMatchGroupNamePayment> lstGroupname = handler.getMatchGroupNameCbo(paymentDate, createBy); ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <doGetMatchGroupNamePayment>(lstGroupname, "MatchRGroupName", "MatchRGroupName", true); return(Json(cboModel)); } catch (Exception ex) { ObjectResultData res = new ObjectResultData(); res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION; res.AddErrorMessage(ex); return(Json(res)); } }
public ActionResult GetDistrict(string provinceCode) { ObjectResultData res = new ObjectResultData(); try { IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler; List <tbm_District> lst = handler.GetTbm_District(provinceCode); lst = (from p in lst orderby p.DistrictName ascending select p).ToList <tbm_District>(); ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <tbm_District>(lst, "DistrictName", "DistrictCode"); res.ResultData = cboModel; } catch (Exception ex) { res.AddErrorMessage(ex); } return(Json(res)); }
public ActionResult GetIssueOfficeCode(string strDocumentType) { string strDisplayName = "OfficeCodeName"; try { List <OfficeDataDo> lsOffice = new List <OfficeDataDo>(); if (strDocumentType == DocumentType.C_DOCUMENT_TYPE_INSTALLATION) // where t.FunctionSecurity == FunctionSecurity.C_FUNC_SECURITY_NO { lsOffice = (from t in CommonUtil.dsTransData.dtOfficeData where t.FunctionSecurity != FunctionSecurity.C_FUNC_SECURITY_NO select t).ToList <OfficeDataDo>(); } else if (strDocumentType == DocumentType.C_DOCUMENT_TYPE_INVENTORY) // where t.FunctionLogistic == FunctionLogistic.C_FUNC_LOGISTIC_WH { lsOffice = (from t in CommonUtil.dsTransData.dtOfficeData where t.FunctionLogistic != FunctionLogistic.C_FUNC_LOGISTIC_NO select t).ToList <OfficeDataDo>(); } ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <OfficeDataDo>(lsOffice, strDisplayName, "OfficeCode", true, CommonUtil.eFirstElementType.All); return(Json(cboModel)); } catch (Exception ex) { ObjectResultData res = new ObjectResultData(); res.AddErrorMessage(ex); return(Json(res)); } }
/// <summary> /// Generate Unit comboitem list /// </summary> /// <param name=""></param> /// <returns></returns> public ActionResult IVS250_GetUnit(string id) { try { ICommonHandler comh = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler; var lstAll = comh.GetMiscTypeCodeListByFieldName(new List <string>() { MiscType.C_UNIT }); var lstFilter = lstAll.ToList <doMiscTypeCode>(); CommonUtil.MappingObjectLanguage <doMiscTypeCode>(lstFilter); ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <doMiscTypeCode>(lstFilter, "ValueDisplay", "ValueCode", true, CommonUtil.eFirstElementType.Select); return(Json(cboModel)); } catch (Exception ex) { ObjectResultData res = new ObjectResultData(); res.AddErrorMessage(ex); return(Json(res)); } }
public ActionResult GetDocumentName(string strDocumentType) { string strDisplayName = "DocumentNameEN"; List <string> lsObjectID = new List <string>(); foreach (var item in CommonUtil.dsTransData.dtUserPermissionData.Values) { lsObjectID.Add(item.ObjectID); } string strObjectIDList = CommonUtil.CreateCSVString(lsObjectID); try { IDocumentHandler handler = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler; List <dtDocumentNameDataList> lst = handler.GetDocumentNameDataList(strDocumentType, strObjectIDList); // 1. Connect string DocumentCode:DocumentName // 2. Select language //foreach (var item in lst) //{ // item.DocumentNameEN = CommonUtil.TextCodeName(item.DocumentCode, item.DocumentNameEN); // item.DocumentNameJP = CommonUtil.TextCodeName(item.DocumentCode, item.DocumentNameJP); // item.DocumentNameLC = CommonUtil.TextCodeName(item.DocumentCode, item.DocumentNameLC); //} if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN) { strDisplayName = "DocumentNameEN"; } else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP) { strDisplayName = "DocumentNameJP"; } else { strDisplayName = "DocumentNameLC"; } if (lst != null && lst.Count > 0) { if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN) { lst = (from t in lst orderby t.DocumentNameEN select t).ToList <dtDocumentNameDataList>(); } else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP) { lst = (from t in lst orderby t.DocumentNameJP select t).ToList <dtDocumentNameDataList>(); } else { lst = (from t in lst orderby t.DocumentNameLC select t).ToList <dtDocumentNameDataList>(); } } ComboBoxModel cboModel = new ComboBoxModel(); cboModel.SetList <dtDocumentNameDataList>(lst, strDisplayName, "DocumentCode", true, CommonUtil.eFirstElementType.Select); return(Json(cboModel)); } catch (Exception ex) { ObjectResultData res = new ObjectResultData(); res.AddErrorMessage(ex); return(Json(res)); } }