protected void Update_Click(object sender, EventArgs e) { if (Page.IsValid) { Data.GroupNews obj = new Data.GroupNews(); obj.Id = Id; obj.Name = txtName.Text; obj.Image = txtImage.Text; obj.Level = Level + "00000"; obj.Ord = txtOrd.Text != "" ? txtOrd.Text : "1"; obj.Description = ""; obj.Keyword = ""; obj.Active = chkActive.Checked ? "1" : "0"; obj.Index = chkIndex.Checked ? "1" : "0"; if (Insert == true) { GroupNewsService.GroupNews_Insert(obj); } else { GroupNewsService.GroupNews_Update(obj); } BindGrid(); pnView.Visible = true; pnUpdate.Visible = false; Level = ""; Insert = false; } }
public GroupNews GroupNewsIDataReader(IDataReader dr) { Data.GroupNews obj = new Data.GroupNews(); obj.Id = (dr["Id"] is DBNull) ? string.Empty : dr["Id"].ToString(); obj.Name = (dr["Name"] is DBNull) ? string.Empty : dr["Name"].ToString(); obj.Image = (dr["Image"] is DBNull) ? string.Empty : dr["Image"].ToString(); obj.Level = (dr["Level"] is DBNull) ? string.Empty : dr["Level"].ToString(); obj.Description = (dr["Description"] is DBNull) ? string.Empty : dr["Description"].ToString(); obj.Keyword = (dr["Keyword"] is DBNull) ? string.Empty : dr["Keyword"].ToString(); obj.Ord = (dr["Ord"] is DBNull) ? string.Empty : dr["Ord"].ToString(); obj.Active = (dr["Active"] is DBNull) ? string.Empty : dr["Active"].ToString(); obj.Index = (dr["Index"] is DBNull) ? string.Empty : dr["Index"].ToString(); return(obj); }
protected void Update_Click(object sender, EventArgs e) { if (Page.IsValid){ Data.GroupNews obj = new Data.GroupNews(); obj.Id = Id; obj.Name = txtName.Text; obj.Tag = Common.StringClass.NameToTag(txtName.Text); obj.Level = Level + "00000"; obj.Title = txtTitle.Text; obj.Description = txtDescription.Text; obj.Keyword = txtKeyword.Text; obj.Ord = txtOrd.Text != "" ? txtOrd.Text : "1"; obj.Priority = chkPriority.Checked ? "1" : "0"; obj.Index = chkIndex.Checked ? "1" : "0"; obj.Active = chkActive.Checked ? "1" : "0"; obj.Lang = Lang; if (Insert == true){ GroupNewsService.GroupNews_Insert(obj); } else{ GroupNewsService.GroupNews_Update(obj); } BindGrid(); pnView.Visible = true; pnUpdate.Visible = false; Level= ""; Insert = false; } }