Beispiel #1
0
        public ActionResult BuildEmailTemplate()
        {
            KeyValueVariables keyValues = new KeyValueVariables();

            keyValues.Add("StockName", "香港九龙仓");
            keyValues.Add("ETATime", DateTime.Now.Date);
            keyValues.Add("CompanyName", "公司名称");
            keyValues.Add("CompanyAddress", "公司地址");
            keyValues.Add("CompanyTel", "123456789");
            keyValues.Add("CompanyWebSite", "http://www.xxx.com");
            keyValues.Add("StockAddress", "仓库地址");
            keyValues.Add("StockContact", "仓库联系人");
            keyValues.Add("StockTel", "仓库电话");
            keyValues.Add("displayNo", "");


            keyValues.Add("numberString", "1231312312312321");
            keyValues.Add("shipTypeString", "默认 配送方式");


            keyValues.Add("totalInPage", "5000.00");
            keyValues.Add("totalAmt", "18000.00");
            keyValues.Add("totalReturnPoint", "100");
            keyValues.Add("PMName", "产品经理姓名");
            keyValues.Add("CurrencyName", "港币");

            keyValues.Add("entity.POID", "123");
            keyValues.Add("DateTime.Now", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            keyValues.Add("vendor.VendorName", "供应商名称");
            keyValues.Add("vendor.SysNo", "123");
            keyValues.Add("vendor.Address", "供应商联系地址");
            keyValues.Add("vendor.Contact", "供应商联系人");
            keyValues.Add("vendor.Fax", "0123445");
            keyValues.Add("entity.InTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            keyValues.Add("entity.PayTypeName", "默认支付方式");
            keyValues.Add("entity.Memo", "备注信息备注信息备注信息备注信息备注信息");
            keyValues.Add("entity.InStockMemo", "入库备注入库备注入库备注入库备注入库备注入库备注入库备注");
            keyValues.Add("SendTimeString", DateTime.Now.ToString());

            KeyTableVariables keyTables            = new KeyTableVariables();
            DataTable         productAccessoryList = new DataTable();

            productAccessoryList.Columns.Add("ProductID");
            productAccessoryList.Columns.Add("AccessoriesID");
            productAccessoryList.Columns.Add("AccessoriesIDAndName");
            productAccessoryList.Columns.Add("Qty");


            DataTable productItemList = new DataTable();

            productItemList.Columns.Add("item.ProductID");
            productItemList.Columns.Add("item.IsVirtualStockProduct");
            productItemList.Columns.Add("item.ProductMode");
            productItemList.Columns.Add("item.BriefName");
            productItemList.Columns.Add("item.CurrencySymbol");
            productItemList.Columns.Add("item.OrderPrice");
            productItemList.Columns.Add("item.PurchaseQty");
            productItemList.Columns.Add("item.Quantity");
            productItemList.Columns.Add("item.PurchaseQtyOrderPrice");
            productItemList.Columns.Add("item.QuantityOrderPrice");


            for (int i = 0; i < 5; i++)
            {
                DataRow dr = productItemList.NewRow();
                dr["item.ProductID"]             = "ProductID-" + i.ToString();
                dr["item.IsVirtualStockProduct"] = "IsVirtualStockProduct-" + i;
                dr["item.ProductMode"]           = "ProductMode-" + i;
                dr["item.BriefName"]             = "BriefName-" + i;
                dr["item.CurrencySymbol"]        = "港币";
                dr["item.OrderPrice"]            = (i + 1) * 100;
                dr["item.PurchaseQty"]           = (i + 1) * 5;
                dr["item.Quantity"] = (i + 1) * 5;
                dr["item.PurchaseQtyOrderPrice"] = ((i + 1) * 5 * 100).ToString("#########0.00");
                dr["item.QuantityOrderPrice"]    = ((i + 1) * 5 * 100).ToString("#########0.00");
                productItemList.Rows.Add(dr);
            }

            for (int i = 0; i < 5; i++)
            {
                DataRow dr = productAccessoryList.NewRow();
                dr["ProductID"]            = "ProductID-" + i;
                dr["AccessoriesID"]        = "AccessoriesID-" + i;
                dr["AccessoriesIDAndName"] = "AccessoriesIDAndName-" + i;
                dr["Qty"] = (i + 1) * 5;
                productAccessoryList.Rows.Add(dr);
            }

            keyTables.Add("tblProductItemsList", productItemList);
            keyTables.Add("tblProductAccessoryList", productAccessoryList);

            MailTemplate template = MailHelper.BuildMailTemplate("PO_AutoCloseMail", keyValues, keyTables);

            return(Content(template.Body));
        }