コード例 #1
0
        public string getAddressHtml(tbl_address addressItem, AddressHtmlType addressType, DbWithControllerWithMaster helperController)
        {
            if (addressItem != null)
            {

                switch (addressType)
                {
                    case AddressHtmlType.agreement:
                        var item = getAddressAccountTemplate(addressItem);
                        return item.content;

                    case AddressHtmlType.mail:
                    case AddressHtmlType.orderDetail:

                        return helperController.RenderRazorViewToString("AddressMailHtml", addressItem);

                    case AddressHtmlType.adminOrderDetail:
                        return "";
                }

            }

            return "";
        }
コード例 #2
0
        // Main
        private addressItem getAddressAccountTemplate(tbl_address item)
        {
            addressItem tempItem = new addressItem();

            if (item != null)
            {
                tempItem.addressId = item.addressId;
                tempItem.name = item.name;

                if (item.isPersonal)
                {
                    tempItem.type = lang.personal;
                }
                else
                {
                    tempItem.type = lang.corporate;
                }

                tempItem.content = item.address + "<br />" + item.district + "-" + item.city;
            }

            return tempItem;
        }
コード例 #3
0
 public tbl_address addAddress(tbl_address item)
 {
     db.tbl_address.Add(item);
     db.SaveChanges();
     return item;
 }
コード例 #4
0
        public Tuple<bool, string> isValidAddress(tbl_address item)
        {
            var validationContext = new ValidationContext(item, null, null);
            var validationResult = new List<ValidationResult>();
            Validator.TryValidateObject(item, validationContext, validationResult, true);

            return getValidationResult(validationResult);
        }