private void Copy_Info(NewsInfo source_info, int dest_cid, CNews BLL) { if (source_info == null) return; NewsInfo info_copy = source_info.copy(); info_copy.Id = 0; info_copy.Cid = dest_cid; info_copy.Status = CCommon.GetStatus_upt(); info_copy.Username = CCommon.Get_CurrentUsername(); info_copy.Timeupdate = DateTime.Now; info_copy.Allowcomment = source_info.Allowcomment > 0 ? 1 : 0; info_copy.Orderd = 0; BLL.Save(info_copy); }
private void Move_Info(NewsInfo source_info, int dest_cid, CNews BLL) { if (source_info == null) return; NewsInfo info_copy = source_info.copy(); info_copy.Cid = dest_cid; info_copy.Status = CCommon.GetStatus_upt(); info_copy.Username = CCommon.Get_CurrentUsername(); info_copy.Timeupdate = DateTime.Now; BLL.Save(info_copy); }
protected void cmdSave_Click(object sender, EventArgs e) { try { string iid = CCommon.Get_FormString(Queryparam.Chkcheck); if (CFunctions.IsNullOrEmpty(iid)) return; int rssId = 0; string websiteUrl = "", nodeContent = "", nodeTitle = "", nodeIntroduce = ""; foreach (RepeaterItem row in rptList.Items) { HiddenField txtId = (HiddenField)row.FindControl("txtId"); rssId = txtId == null ? 0 : int.Parse(txtId.Value); websiteUrl = ((HiddenField)row.FindControl("txtWebsiteUrl")).Value; nodeContent = ((HiddenField)row.FindControl("txtNodecontent")).Value; nodeTitle = ((HiddenField)row.FindControl("txtNodetitle")).Value; nodeIntroduce = ((HiddenField)row.FindControl("txtNodeintroduce")).Value; } iid = "," + iid + ","; CNews DAL = new CNews(CCommon.LANG); foreach (GridViewRow row in grdView.Rows) { HiddenField txtId = (HiddenField)row.FindControl("txtId"); HiddenField txtTitle = (HiddenField)row.FindControl("txtTitle"); HiddenField txtDescription = (HiddenField)row.FindControl("txtDescription"); HiddenField txtLink = (HiddenField)row.FindControl("txtLink"); if (txtId != null) { string id = txtId.Value; if (iid.IndexOf("," + id + ",") != -1) { NewsInfo info = new NewsInfo(); info.Name = txtTitle.Value; info.Code = ""; info.Introduce = txtDescription.Value; info.Description = radSavetype.SelectedIndex == 0 ? this.Get_NewsContent(txtLink.Value, websiteUrl, nodeContent, nodeTitle, nodeIntroduce) : ""; info.Url = radSavetype.SelectedIndex == 0 ? "" : txtLink.Value; info.Author = websiteUrl.Replace("http://", ""); info.Cid = int.Parse(ddlCid.SelectedValue); info.Cname = ddlCid.SelectedItem.Text.Replace("-", ""); info.Timeexpire = CFunctions.Get_Datetime(CFunctions.Set_Datetime(DateTime.Now.AddDays(365))); info.Status = CCommon.GetStatus_upt(); info.Username = CCommon.Get_CurrentUsername(); info.Timeupdate = DateTime.Now; DAL.Save(info); } } } lstError = new List<Errorobject>(); lstError = Form_GetError(lstError, Errortype.Completed, Definephrase.Save_completed, "", null); Master.Form_ShowError(lstError); (new CRSSResource(CCommon.LANG)).Updatestr(rssId.ToString(), "timelastestget", DateTime.Now); } catch { lstError = new List<Errorobject>(); lstError = Form_GetError(lstError, Errortype.Error, Definephrase.Save_error, "", null); Master.Form_ShowError(lstError); } }