protected void Save_Btn_Click(object sender, EventArgs e) { M_User_Plat upMod = B_User_Plat.GetLogin(); M_Common_Notify comMod = new M_Common_Notify(); if (Mid > 0) { comMod = comBll.SelReturnModel(Mid); } comMod.Title = Title_T.Text; comMod.Content = Content_T.Text; comMod.BeginDate = Convert.ToDateTime(BeginDate_T.Text); if (!comMod.ReceOrgin.Equals(manage_hid.Value)) { comMod.ReceOrgin = StrHelper.IdsFormat(manage_hid.Value); comMod.ReceUsers = StrHelper.IdsFormat(StrHelper.RemoveRepeat(comMod.ReceOrgin.Split(','), comMod.ReadedUsers.Split(','))); } if (Mid > 0) { comBll.UpdateByID(comMod); } else { comMod.NType = 2; comMod.InfoID = MsgID; comMod.CUser = upMod.UserID; comMod.CUName = upMod.UserName; comBll.Insert(comMod); } function.WriteSuccessMsg("操作成功"); }
private void MyBind() { M_User_Plat upMod = B_User_Plat.GetLogin(); if (Mid > 0) { M_Common_Notify comMod = comBll.SelReturnModel(Mid); if (comMod.CUser != upMod.UserID) { function.WriteErrMsg("你无权修改该信息"); } MsgID = comMod.InfoID; Title_T.Text = comMod.Title; Content_T.Text = comMod.Content; BeginDate_T.Text = comMod.BeginDate.ToString("yyyy-MM-dd HH:mm:ss"); manage_hid.Value = buser.SelByIDS(comMod.ReceOrgin); function.Script(this, "SetRadVal('zstatus_rad'," + comMod.ZStatus + ");"); } else { msgMod = msgBll.SelReturnModel(MsgID); Title_T.Text = msgMod.Title; Content_T.Text = msgMod.MsgContent; BeginDate_T.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); manage_hid.Value = buser.SelByIDS(upMod.UserID.ToString()); } RPT.DataSource = comBll.Blog_Sel(MsgID, -100); RPT.DataBind(); }
public int Insert(M_Common_Notify model) { return(DBCenter.Insert(model)); }
public bool UpdateByID(M_Common_Notify model) { return(DBCenter.UpdateByID(model, model.ID)); }