本文整理汇总了C#中BLL.article.Add方法的典型用法代码示例。如果您正苦于以下问题:C# BLL.article.Add方法的具体用法?C# BLL.article.Add怎么用?C# BLL.article.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.article
的用法示例。
在下文中一共展示了BLL.article.Add方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoAdd
private bool DoAdd()
{
bool result = false;
Model.article model = new Model.article();
BLL.article bll = new BLL.article();
model.channel_id = this.channel_id;
model.category_id = Utils.StrToInt(ddlCategoryId.SelectedValue, 0);
model.call_index = txtCallIndex.Text.Trim();
model.title = txtTitle.Text.Trim();
model.tags = txtTags.Text.Trim();
model.link_url = txtLinkUrl.Text.Trim();
model.img_url = txtImgUrl.Text;
model.seo_title = txtSeoTitle.Text.Trim();
model.seo_keywords = txtSeoKeywords.Text.Trim();
model.seo_description = txtSeoDescription.Text.Trim();
//内容摘要提取内容前255个字符
if (string.IsNullOrEmpty(txtZhaiyao.Text.Trim()))
{
model.zhaiyao = Utils.DropHTML(txtContent.Value, 255);
}
else
{
model.zhaiyao = Utils.DropHTML(txtZhaiyao.Text, 255);
}
//是否将编辑器远程图片保存到本地
if (siteConfig.fileremote == 1)
{
model.content = AutoRemoteImageSave(txtContent.Value);
}
else
{
model.content = txtContent.Value;
}
model.sort_id = Utils.StrToInt(txtSortId.Text.Trim(), 99);
model.click = int.Parse(txtClick.Text.Trim());
model.status = Utils.StrToInt(rblStatus.SelectedValue, 0);
model.is_msg = 0;
model.is_top = 0;
model.is_red = 0;
model.is_hot = 0;
model.is_slide = 0;
if (cblItem.Items[0].Selected == true)
{
model.is_msg = 1;
}
if (cblItem.Items[1].Selected == true)
{
model.is_top = 1;
}
if (cblItem.Items[2].Selected == true)
{
model.is_red = 1;
}
if (cblItem.Items[3].Selected == true)
{
model.is_hot = 1;
}
if (cblItem.Items[4].Selected == true)
{
model.is_slide = 1;
}
model.is_sys = 1; //管理员发布
model.user_name = GetAdminInfo().user_name; //获得当前登录用户名
model.add_time = Utils.StrToDateTime(txtAddTime.Text.Trim());
model.fields = SetFieldValues(this.channel_id); //扩展字段赋值
#region 保存规格====================
//保存商品规格
string goodsSpecJsonStr = hide_goods_spec_list.Value;
List<Model.article_goods_spec> specList = (List<Model.article_goods_spec>)JsonHelper.JSONToObject<List<Model.article_goods_spec>>(goodsSpecJsonStr);
if (specList != null)
{
model.specs = specList;
}
//保存商品信息
string[] specGoodsIdArr = Request.Form.GetValues("hide_goods_id");
string[] specGoodsNoArr = Request.Form.GetValues("spec_goods_no");
string[] specMarketPriceArr = Request.Form.GetValues("spec_market_price");
string[] specSellPriceArr = Request.Form.GetValues("spec_sell_price");
string[] specStockQuantityArr = Request.Form.GetValues("spec_stock_quantity");
string[] specSpecIdsArr = Request.Form.GetValues("hide_spec_ids");
string[] specTextArr = Request.Form.GetValues("hide_spec_text");
string[] specGroupPriceArr = Request.Form.GetValues("hide_group_price");
if (specGoodsIdArr != null && specGoodsNoArr != null && specMarketPriceArr != null && specSellPriceArr != null && specStockQuantityArr != null
&& specSpecIdsArr != null && specTextArr != null && specGroupPriceArr != null
&& specGoodsIdArr.Length > 0 && specGoodsNoArr.Length > 0 && specMarketPriceArr.Length > 0 && specSellPriceArr.Length > 0
&& specStockQuantityArr.Length > 0 && specSpecIdsArr.Length > 0 && specTextArr.Length > 0 && specGroupPriceArr.Length > 0)
{
List<Model.article_goods> goodsList = new List<Model.article_goods>();
for (int i = 0; i < specGoodsNoArr.Length; i++)
{
List<Model.user_group_price> groupList = new List<Model.user_group_price>();
if (!string.IsNullOrEmpty(specGroupPriceArr[i]))
{
groupList = (List<Model.user_group_price>)JsonHelper.JSONToObject<List<Model.user_group_price>>(specGroupPriceArr[i]);
}
goodsList.Add(new Model.article_goods
{
goods_no = specGoodsNoArr[i],
//.........这里部分代码省略.........
示例2: DoAdd
private bool DoAdd()
{
Model.wx_userweixin weixin = GetWeiXinCode();
bool result = false;
Model.article model = new Model.article();
BLL.article bll = new BLL.article();
model.channel_id = this.channel_id;
model.category_id = Utils.StrToInt(ddlCategoryId.SelectedValue, 0);
model.call_index = txtCallIndex.Text.Trim();
model.title = txtTitle.Text.Trim();
model.link_url = txtLinkUrl.Text.Trim();
model.img_url = txtImgUrl.Text;
model.seo_title = txtSeoTitle.Text.Trim();
model.seo_keywords = txtSeoKeywords.Text.Trim();
model.seo_description = txtSeoDescription.Text.Trim();
model.wid = weixin.id;
//内容摘要提取内容前255个字符
if (string.IsNullOrEmpty(txtZhaiyao.Text.Trim()))
{
model.zhaiyao = Utils.DropHTML(txtContent.Value, 255);
}
else
{
model.zhaiyao = Utils.DropHTML(txtZhaiyao.Text, 255);
}
model.content = txtContent.Value;
model.sort_id = Utils.StrToInt(txtSortId.Text.Trim(), 99);
model.click = int.Parse(txtClick.Text.Trim());
model.status = Utils.StrToInt(rblStatus.SelectedValue, 0);
model.is_msg = 0;
model.is_top = 0;
model.is_red = 0;
model.is_hot = 0;
model.is_slide = 0;
if (cblItem.Items[0].Selected == true)
{
model.is_msg = 1;
}
if (cblItem.Items[1].Selected == true)
{
model.is_top = 1;
}
if (cblItem.Items[2].Selected == true)
{
model.is_red = 1;
}
if (cblItem.Items[3].Selected == true)
{
model.is_hot = 1;
}
if (cblItem.Items[4].Selected == true)
{
model.is_slide = 1;
}
model.is_sys = 1; //管理员发布
model.user_name = "admin"; //获得当前登录用户名
model.add_time = Utils.StrToDateTime(txtAddTime.Text.Trim());
model.fields = SetFieldValues(this.channel_id); //扩展字段赋值
#region 保存相册====================
//检查是否有自定义图片
if (txtImgUrl.Text.Trim() == "")
{
model.img_url = hidFocusPhoto.Value;
}
string[] albumArr = Request.Form.GetValues("hid_photo_name");
string[] remarkArr = Request.Form.GetValues("hid_photo_remark");
if (albumArr != null && albumArr.Length > 0)
{
List<Model.article_albums> ls = new List<Model.article_albums>();
for (int i = 0; i < albumArr.Length; i++)
{
string[] imgArr = albumArr[i].Split('|');
if (imgArr.Length == 3)
{
if (!string.IsNullOrEmpty(remarkArr[i]))
{
ls.Add(new Model.article_albums { original_path = imgArr[1], thumb_path = imgArr[2], remark = remarkArr[i] });
}
else
{
ls.Add(new Model.article_albums { original_path = imgArr[1], thumb_path = imgArr[2] });
}
}
}
model.albums = ls;
}
#endregion
#region 保存附件====================
//保存附件
string[] attachFileNameArr = Request.Form.GetValues("hid_attach_filename");
string[] attachFilePathArr = Request.Form.GetValues("hid_attach_filepath");
string[] attachFileSizeArr = Request.Form.GetValues("hid_attach_filesize");
string[] attachPointArr = Request.Form.GetValues("txt_attach_point");
if (attachFileNameArr != null && attachFilePathArr != null && attachFileSizeArr != null && attachPointArr != null
&& attachFileNameArr.Length > 0 && attachFilePathArr.Length > 0 && attachFileSizeArr.Length > 0 && attachPointArr.Length > 0)
{
//.........这里部分代码省略.........
示例3: DoAdd
private bool DoAdd()
{
bool result = true;
Model.article_news model = new Model.article_news();
BLL.article bll = new BLL.article();
model.channel_id = this.channel_id;
model.title = txtTitle.Text.Trim();
model.category_id = int.Parse(ddlCategoryId.SelectedValue);
model.author = txtAuthor.Text.Trim();
model.from = txtFrom.Text.Trim();
//自动提取摘要
if (txtZhaiyao.Text.Trim() != string.Empty)
{
model.zhaiyao = Utils.DropHTML(txtZhaiyao.Text, 250);
}
else
{
model.zhaiyao = Utils.DropHTML(txtContent.Value, 250);
}
model.link_url = txtLinkUrl.Text.Trim();
//检查是否有自定义图片
if (txtImgUrl.Text.Trim() != "")
{
model.img_url = txtImgUrl.Text;
}
else
{
model.img_url = focus_photo.Value;
}
model.content = txtContent.Value;
model.seo_title = txtSeoTitle.Text.Trim();
model.seo_keywords = txtSeoKeywords.Text.Trim();
model.seo_description = txtSeoDescription.Text.Trim();
model.sort_id = int.Parse(txtSortId.Text.Trim());
model.click = int.Parse(txtClick.Text.Trim());
model.digg_good = int.Parse(txtDiggGood.Text.Trim());
model.digg_bad = int.Parse(txtDiggBad.Text.Trim());
model.is_msg = 0;
model.is_top = 0;
model.is_red = 0;
model.is_hot = 0;
model.is_slide = 0;
model.is_lock = 0;
if (cblItem.Items[0].Selected == true)
{
model.is_msg = 1;
}
if (cblItem.Items[1].Selected == true)
{
model.is_top = 1;
}
if (cblItem.Items[2].Selected == true)
{
model.is_red = 1;
}
if (cblItem.Items[3].Selected == true)
{
model.is_hot = 1;
}
if (cblItem.Items[4].Selected == true)
{
model.is_slide = 1;
}
if (cblItem.Items[5].Selected == true)
{
model.is_lock = 1;
}
//保存相册
string[] albumArr = Request.Form.GetValues("hide_photo_name");
string[] remarkArr = Request.Form.GetValues("hide_photo_remark");
if (albumArr != null && albumArr.Length > 0)
{
List<Model.article_albums> ls = new List<Model.article_albums>();
for (int i = 0; i < albumArr.Length; i++)
{
string[] imgArr = albumArr[i].Split('|');
if (imgArr.Length == 3)
{
if (!string.IsNullOrEmpty(remarkArr[i]))
{
ls.Add(new Model.article_albums { big_img = imgArr[1], small_img = imgArr[2], remark = remarkArr[i] });
}
else
{
ls.Add(new Model.article_albums { big_img = imgArr[1], small_img = imgArr[2] });
}
}
}
model.albums = ls;
}
//扩展属性
BLL.attributes bll2 = new BLL.attributes();
DataSet ds2 = bll2.GetList("channel_id=" + this.channel_id);
List<Model.attribute_value> attrls = new List<Model.attribute_value>();
foreach (DataRow dr in ds2.Tables[0].Rows)
{
int attr_id = int.Parse(dr["id"].ToString());
//.........这里部分代码省略.........
示例4: DoAdd
private bool DoAdd()
{
bool result = true;
Model.article_company model = new Model.article_company();
BLL.article bll = new BLL.article();
model.channel_id = this.channel_id;
model.title = txtTitle.Text.Trim();
model.category_id = int.Parse(ddlCategoryId.SelectedValue);
model.link_url = txtLinkUrl.Text.Trim();
model.img_url = txtImgUrl.Text.Trim();
model.seo_title = txtSeoTitle.Text.Trim();
model.seo_keywords = txtSeoKeywords.Text.Trim();
model.seo_description = txtSeoDescription.Text.Trim();
model.sort_id = int.Parse(txtSortId.Text.Trim());
model.click = int.Parse(txtClick.Text.Trim());
model.content = Utils.ToHtml(txtContent.Text);
model.digg_good = int.Parse(txtDiggGood.Text.Trim());
model.digg_bad = int.Parse(txtDiggBad.Text.Trim());
model.is_msg = 0;
model.is_red = 0;
model.is_top = 0;
model.is_lock = 0;
model.telephone = txtTelephone.Text.Trim();
model.user = txtContact.Text.Trim();
model.address = txtAddress.Text.Trim();
model.remark1 = "";
model.remark2 = 0;
model.x_lng = "";
model.y_lat = "";
model.line = Utils.ToHtml(txtLine.Text.Trim());
model.price = decimal.Parse(txtPrice.Text.Trim());
model.sell_price = decimal.Parse(txtSellPrice.Text.Trim());
model.flight_num = txtFlightNum.Text.Trim();
model.seat_price = txtFlightSeat.Text.Trim();
model.begin_date = txtBeginDate.Text.Trim();
model.end_date = txtEndDate.Text.Trim();
model.entry_port = txtEntryPort.Text.Trim();
model.visa_type = txtVisaType.Text.Trim();
model.visa_nation = txtVisaNation.Text.Trim();
model.visa_data = Utils.ToHtml(txtVisaData.Text.Trim());
//if (cblItem.Items[0].Selected == true)
//{
// model.is_msg = 1;
//}
if (cblItem.Items[0].Selected == true)
{
model.is_red = 1;
}
//检查是否有自定义图片
if (txtImgUrl.Text.Trim() != "")
{
model.img_url = txtImgUrl.Text;
}
else
{
model.img_url = focus_photo.Value;
}
//保存相册
string[] albumArr = Request.Form.GetValues("hide_photo_name");
string[] remarkArr = Request.Form.GetValues("hide_photo_remark");
if (albumArr != null && albumArr.Length > 0)
{
List<Model.article_albums> ls = new List<Model.article_albums>();
for (int i = 0; i < albumArr.Length; i++)
{
string[] imgArr = albumArr[i].Split('|');
if (imgArr.Length == 3)
{
if (!string.IsNullOrEmpty(remarkArr[i]))
{
ls.Add(new Model.article_albums { big_img = imgArr[1], small_img = imgArr[2], remark = remarkArr[i] });
}
else
{
ls.Add(new Model.article_albums { big_img = imgArr[1], small_img = imgArr[2] });
}
}
}
model.albums = ls;
}
if (bll.Add(model) < 1)
{
result = false;
}
return result;
}
示例5: DoAdd
private bool DoAdd()
{
bool result = true;
Model.article_goods model = new Model.article_goods();
BLL.article bll = new BLL.article();
model.channel_id = this.channel_id;
model.title = txtTitle.Text.Trim();
model.category_id = int.Parse(ddlCategoryId.SelectedValue);
model.goods_no = txtGoodsNo.Text;
model.stock_quantity = int.Parse(txtStockQuantity.Text);
model.market_price = decimal.Parse(txtMarketPrice.Text);
model.sell_price = decimal.Parse(txtSellPrice.Text);
model.point = int.Parse(txtPoint.Text);
model.link_url = txtLinkUrl.Text.Trim();
model.img_url = focus_photo.Value;
model.content = txtContent.Value;
model.seo_title = txtSeoTitle.Text.Trim();
model.seo_keywords = txtSeoKeywords.Text.Trim();
model.seo_description = txtSeoDescription.Text.Trim();
model.sort_id = int.Parse(txtSortId.Text.Trim());
model.click = int.Parse(txtClick.Text.Trim());
model.digg_good = int.Parse(txtDiggGood.Text.Trim());
model.digg_bad = int.Parse(txtDiggBad.Text.Trim());
model.is_msg = 0;
model.is_top = 0;
model.is_red = 0;
model.is_hot = 0;
model.is_slide = 0;
model.is_lock = 0;
if (cblItem.Items[0].Selected == true)
{
model.is_msg = 1;
}
if (cblItem.Items[1].Selected == true)
{
model.is_top = 1;
}
if (cblItem.Items[2].Selected == true)
{
model.is_red = 1;
}
if (cblItem.Items[3].Selected == true)
{
model.is_hot = 1;
}
if (cblItem.Items[4].Selected == true)
{
model.is_slide = 1;
}
if (cblItem.Items[5].Selected == true)
{
model.is_lock = 1;
}
//会员组价格
List<Model.goods_group_price> priceList = new List<Model.goods_group_price>();
for (int i = 0; i < rptPrice.Items.Count; i++)
{
int _groupid = Convert.ToInt32(((HiddenField)rptPrice.Items[i].FindControl("hideGroupId")).Value);
decimal _price = Convert.ToDecimal(((TextBox)rptPrice.Items[i].FindControl("txtGroupPrice")).Text.Trim());
priceList.Add(new Model.goods_group_price { group_id = _groupid, price = _price });
}
model.goods_group_prices = priceList;
//保存相册
string[] albumArr = Request.Form.GetValues("hide_photo_name");
string[] remarkArr = Request.Form.GetValues("hide_photo_remark");
if (albumArr != null && albumArr.Length > 0)
{
List<Model.article_albums> ls = new List<Model.article_albums>();
for (int i = 0; i < albumArr.Length; i++)
{
string[] imgArr = albumArr[i].Split('|');
if (imgArr.Length == 3)
{
if (!string.IsNullOrEmpty(remarkArr[i]))
{
ls.Add(new Model.article_albums { big_img = imgArr[1], small_img = imgArr[2], remark = remarkArr[i] });
}
else
{
ls.Add(new Model.article_albums { big_img = imgArr[1], small_img = imgArr[2] });
}
}
}
model.albums = ls;
}
//扩展属性
BLL.attributes bll2 = new BLL.attributes();
DataSet ds2 = bll2.GetList("channel_id=" + this.channel_id);
List<Model.attribute_value> attrls = new List<Model.attribute_value>();
foreach (DataRow dr in ds2.Tables[0].Rows)
{
int attr_id = int.Parse(dr["id"].ToString());
string attr_title = dr["title"].ToString();
string attr_value = Request.Form["content_" + attr_id];
if (!string.IsNullOrEmpty(attr_value))
{
attrls.Add(new Model.attribute_value { attribute_id = attr_id, title = attr_title, content = attr_value });
//.........这里部分代码省略.........
示例6: DoAdd
private bool DoAdd()
{
bool result = false;
Model.article model = new Model.article();
BLL.article bll = new BLL.article();
model.channel_id = this.channel_id;
model.category_id = Utils.StrToInt(ddlCategoryId.SelectedValue, 0);
model.call_index = txtCallIndex.Text.Trim();
model.title = txtTitle.Text.Trim();
model.link_url = txtLinkUrl.Text.Trim();
model.img_url = txtImgUrl.Text;
model.seo_title = txtSeoTitle.Text.Trim();
model.seo_keywords = txtSeoKeywords.Text.Trim();
model.seo_description = txtSeoDescription.Text.Trim();
model.is_put = 1;
if (isPut.Items[0].Selected)
{
model.is_put = 0;
}
//内容摘要提取内容前255个字符
if (string.IsNullOrEmpty(txtZhaiyao.Text.Trim()))
{
model.zhaiyao = Utils.DropHTML(txtContent.Value, 255);
}
else
{
model.zhaiyao = Utils.DropHTML(txtZhaiyao.Text, 255);
}
model.content = txtContent.Value;
model.sort_id = Utils.StrToInt(txtSortId.Text.Trim(), 99);
model.click = int.Parse(txtClick.Text.Trim());
model.status = Utils.StrToInt(rblStatus.SelectedValue, 0);
model.is_msg = 0;
model.is_top = 0;
model.is_red = 0;
model.is_hot = 0;
model.is_slide = 0;
if (cblItem.Items[0].Selected == true)
{
model.is_msg = 1;
}
if (cblItem.Items[1].Selected == true)
{
model.is_top = 1;
}
if (cblItem.Items[2].Selected == true)
{
model.is_red = 1;
}
if (cblItem.Items[3].Selected == true)
{
model.is_hot = 1;
}
if (cblItem.Items[4].Selected == true)
{
model.is_slide = 1;
}
model.is_sys = 1; //管理员发布
model.user_name = "admin"; //获得当前登录用户名
model.add_time = Utils.StrToDateTime(txtAddTime.Text.Trim());
model.fields = SetFieldValues(this.channel_id); //扩展字段赋值
#region 保存相册====================
//检查是否有自定义图片
if (txtImgUrl.Text.Trim() == "")
{
model.img_url = hidFocusPhoto.Value;
}
string[] albumArr = Request.Form.GetValues("hid_photo_name");
string[] remarkArr = Request.Form.GetValues("hid_photo_remark");
if (albumArr != null && albumArr.Length > 0)
{
List<Model.article_albums> ls = new List<Model.article_albums>();
for (int i = 0; i < albumArr.Length; i++)
{
string[] imgArr = albumArr[i].Split('|');
if (imgArr.Length == 3)
{
if (!string.IsNullOrEmpty(remarkArr[i]))
{
ls.Add(new Model.article_albums { original_path = imgArr[1], thumb_path = imgArr[2], remark = remarkArr[i] });
}
else
{
ls.Add(new Model.article_albums { original_path = imgArr[1], thumb_path = imgArr[2] });
}
}
}
model.albums = ls;
}
#endregion
#region 保存附件====================
//保存附件
string[] attachFileNameArr = Request.Form.GetValues("hid_attach_filename");
string[] attachFilePathArr = Request.Form.GetValues("hid_attach_filepath");
string[] attachFileSizeArr = Request.Form.GetValues("hid_attach_filesize");
string[] attachPointArr = Request.Form.GetValues("txt_attach_point");
if (attachFileNameArr != null && attachFilePathArr != null && attachFileSizeArr != null && attachPointArr != null
//.........这里部分代码省略.........
示例7: DoAdd
private bool DoAdd()
{
bool result = true;
Model.article model = new Model.article();
BLL.article bll = new BLL.article();
model.channel_id = this.channel_id;
model.title = txtTitle.Text.Trim();
model.category_id = int.Parse(ddlCategoryId.SelectedValue);
model.link_url = txtLinkUrl.Text.Trim();
model.img_url = txtImgUrl.Text.Trim();
model.author = txtAuthor.Text.Trim();
model.form = txtForm.Text.Trim();
//自动提取摘要
if (txtZhaiyao.Text.Trim() != string.Empty)
{
model.zhaiyao = Utils.DropHTML(txtZhaiyao.Text, 250);
}
else
{
model.zhaiyao = Utils.DropHTML(txtContent.Value, 250);
}
model.seo_title = txtSeoTitle.Text.Trim();
model.seo_keywords = txtSeoKeywords.Text.Trim();
model.seo_description = txtSeoDescription.Text.Trim();
model.sort_id = int.Parse(txtSortId.Text.Trim());
model.click = int.Parse(txtClick.Text.Trim());
model.content = txtContent.Value;
model.is_msg = 0;
model.is_top = 0;
model.is_red = 0;
model.is_hot = 0;
model.is_slide = 0;
model.is_lock = 0;
if (cblItem.Items[0].Selected == true)
{
model.is_msg = 1;
}
if (cblItem.Items[1].Selected == true)
{
model.is_top = 1;
}
if (cblItem.Items[2].Selected == true)
{
model.is_red = 1;
}
if (cblItem.Items[3].Selected == true)
{
model.is_hot = 1;
}
if (cblItem.Items[4].Selected == true)
{
model.is_slide = 1;
}
if (cblItem.Items[5].Selected == true)
{
model.is_lock = 1;
}
if (bll.Add(model) < 1)
{
result = false;
}
return result;
}