/// <summary> /// Execute get email model. /// </summary> /// <param name="param">String</param> /// <returns>EmailModel</returns> private OutputEmailModel GetEmailModel(SaveDataModel inputObject) { // Local variable declaration OutputEmailModel emailModel = null; UserCom userCom = null; MParameterCom mParameterCom = null; // Variable initialize emailModel = new OutputEmailModel(); userCom = new UserCom(); mParameterCom = new MParameterCom(); // Get data var strHotline = mParameterCom.GetString(Logics.PR_HOTLINE, false); var strEmail = mParameterCom.GetString(Logics.PR_EMAIL_SUPPORT, false); var strChatYahoo = mParameterCom.GetString(Logics.PR_CHAT_YAHOO, false); // Set data emailModel.UserCd = DataHelper.ToString(inputObject.UserCd); emailModel.FullName = DataHelper.ToString(inputObject.Fullname); emailModel.Hotline = DataHelper.ToString(strHotline); emailModel.EmailSupport = DataHelper.ToString(strEmail); emailModel.ChatYahoo = DataHelper.ToString(strChatYahoo);; // Return value; return(emailModel); }
/// <summary> /// Execute get email model. /// </summary> /// <param name="param">String</param> /// <returns>EmailModel</returns> private OutputEmailModel GetEmailModel(string param) { // Local variable declaration OutputEmailModel emailModel = null; ClientCheckoutDao clientCheckoutDao = null; MParameterCom mParameterCom = null; MCodeCom mCodeCom = null; IList <OutputAcceptDetailsModel> listAcceptDetails = null; // Variable initialize emailModel = new OutputEmailModel(); clientCheckoutDao = new ClientCheckoutDao(); mParameterCom = new MParameterCom(); mCodeCom = new MCodeCom(); listAcceptDetails = new List <OutputAcceptDetailsModel>(); // Get data var accept = clientCheckoutDao.GetAccept(param); var strHotline = mParameterCom.GetString(Logics.PR_HOTLINE, false); var strEmail = mParameterCom.GetString(Logics.PR_EMAIL_SUPPORT, false); var paymentMethodsContent = mCodeCom.GetCodeContent(Logics.GROUP_PAYMENT_METHODS, accept.PaymentMethods); OutputAcceptDetailsModel acceptDetails = null; foreach (var obj in accept.AcceptDetails) { acceptDetails = new OutputAcceptDetailsModel(); acceptDetails.ItemName = DataHelper.ToString(obj.ItemName); acceptDetails.DetailPrice = DataHelper.ToString(Formats.CURRENCY, obj.DetailPrice); acceptDetails.DetailQtty = DataHelper.ToString(Formats.NUMBER, obj.DetailQtty); acceptDetails.DetailAmt = DataHelper.ToString(Formats.CURRENCY, obj.DetailAmt); listAcceptDetails.Add(acceptDetails); } // Set data emailModel.AcceptSlipNo = DataHelper.ToString(accept.AcceptSlipNo); emailModel.ViewId = DataHelper.ToString(accept.ViewId); emailModel.AcceptDate = DataHelper.ToString(Formats.RFC_DATE, accept.AcceptDate); emailModel.ClientName = DataHelper.ToString(accept.ClientName); emailModel.ClientAddress = DataHelper.ToString(accept.ClientAddress); emailModel.ClientTel = DataHelper.ToString(accept.ClientTel); emailModel.DeliveryName = DataHelper.ToString(accept.DeliveryName); emailModel.DeliveryAddress = DataHelper.ToString(accept.DeliveryAddress); emailModel.DeliveryTel = DataHelper.ToString(accept.DeliveryTel); emailModel.PaymentMethodsContent = DataHelper.ToString(paymentMethodsContent); emailModel.Notes = DataHelper.ToString(accept.Notes); emailModel.Hotline = DataHelper.ToString(strHotline); emailModel.EmailSupport = DataHelper.ToString(strEmail); emailModel.AcceptDetails = listAcceptDetails; emailModel.TotalAmount = DataHelper.ToString(Formats.CURRENCY, accept.TotalAmount); // Return value; return(emailModel); }