/// <summary> /// 得到一个对象实体 /// </summary> public Panther.Email.Entity.Model.EmailSendBccAccount DataRowToModelAndBcc(DataRow row) { Panther.Email.Entity.Model.EmailSendBccAccount model = new Panther.Email.Entity.Model.EmailSendBccAccount(); model.EmailBccAccountInfo = new Entity.Model.EmailBccAccount(); if (row != null) { if (row["EmailSendBccAccountID"] != null) { model.EmailSendBccAccountID = row["EmailSendBccAccountID"].ToString(); } if (row["EmailID"] != null) { model.EmailID = row["EmailID"].ToString(); } if (row["EmailBccAccountID"] != null) { model.EmailBccAccountID = row["EmailBccAccountID"].ToString(); model.EmailBccAccountInfo.EmailBccAccountID = model.EmailBccAccountID; } if (row["EmailAccountID"] != null) { model.EmailAccountID = row["EmailAccountID"].ToString(); } model.EmailSendBccAccountState = (int)(row["EmailSendBccAccountState"]); if (row["EmailSendBccAccountCreateTime"] != null && row["EmailSendBccAccountCreateTime"].ToString() != "") { model.EmailSendBccAccountCreateTime = DateTime.Parse(row["EmailSendBccAccountCreateTime"].ToString()); } if (row["EmailSendBccAccountLastTime"] != null && row["EmailSendBccAccountLastTime"].ToString() != "") { model.EmailSendBccAccountLastTime = DateTime.Parse(row["EmailSendBccAccountLastTime"].ToString()); } if (row["EmailSendBccAccountSendTIme"] != null && row["EmailSendBccAccountSendTIme"].ToString() != "") { model.EmailSendBccAccountSendTIme = DateTime.Parse(row["EmailSendBccAccountSendTIme"].ToString()); } if (row["EmailBccAccountAddress"] != null) { model.EmailBccAccountInfo.EmailBccAccountAddress = row["EmailBccAccountAddress"].ToString(); } if (row["EmailBccAccountName"] != null) { model.EmailBccAccountInfo.EmailBccAccountName = row["EmailBccAccountName"].ToString(); } } return(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Panther.Email.Entity.Model.EmailSendBccAccount model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update EmailSendBccAccount set "); strSql.Append("EmailID=@EmailID,"); strSql.Append("EmailBccAccountID=@EmailBccAccountID,"); strSql.Append("EmailAccountID=@EmailAccountID,"); strSql.Append("EmailSendBccAccountState=@EmailSendBccAccountState,"); strSql.Append("EmailSendBccAccountCreateTime=@EmailSendBccAccountCreateTime,"); strSql.Append("EmailSendBccAccountLastTime=@EmailSendBccAccountLastTime,"); strSql.Append("EmailSendBccAccountSendTIme=@EmailSendBccAccountSendTIme"); strSql.Append(" where EmailSendBccAccountID=@EmailSendBccAccountID "); SqlParameter[] parameters = { new SqlParameter("@EmailID", SqlDbType.VarChar, 40), new SqlParameter("@EmailBccAccountID", SqlDbType.VarChar, 40), new SqlParameter("@EmailAccountID", SqlDbType.VarChar, 40), new SqlParameter("@EmailSendBccAccountState", SqlDbType.Int), new SqlParameter("@EmailSendBccAccountCreateTime", SqlDbType.DateTime), new SqlParameter("@EmailSendBccAccountLastTime", SqlDbType.DateTime), new SqlParameter("@EmailSendBccAccountSendTIme", SqlDbType.DateTime), new SqlParameter("@EmailSendBccAccountID", SqlDbType.VarChar, 40) }; parameters[0].Value = model.EmailID; parameters[1].Value = model.EmailBccAccountID; parameters[2].Value = model.EmailAccountID; parameters[3].Value = model.EmailSendBccAccountState; parameters[4].Value = model.EmailSendBccAccountCreateTime; parameters[5].Value = model.EmailSendBccAccountLastTime; parameters[6].Value = model.EmailSendBccAccountSendTIme; parameters[7].Value = model.EmailSendBccAccountID; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Panther.Email.Entity.Model.EmailSendBccAccount model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into EmailSendBccAccount("); strSql.Append("EmailSendBccAccountID,EmailID,EmailBccAccountID,EmailAccountID,EmailSendBccAccountState,EmailSendBccAccountCreateTime,EmailSendBccAccountLastTime)"); strSql.Append(" values ("); strSql.Append("@EmailSendBccAccountID,@EmailID,@EmailBccAccountID,@EmailAccountID,@EmailSendBccAccountState,@EmailSendBccAccountCreateTime,@EmailSendBccAccountLastTime)"); SqlParameter[] parameters = { new SqlParameter("@EmailSendBccAccountID", SqlDbType.VarChar, 40), new SqlParameter("@EmailID", SqlDbType.VarChar, 40), new SqlParameter("@EmailBccAccountID", SqlDbType.VarChar, 40), new SqlParameter("@EmailAccountID", SqlDbType.VarChar, 40), new SqlParameter("@EmailSendBccAccountState", SqlDbType.Int), new SqlParameter("@EmailSendBccAccountCreateTime", SqlDbType.DateTime), new SqlParameter("@EmailSendBccAccountLastTime", SqlDbType.DateTime) }; parameters[0].Value = model.EmailSendBccAccountID; parameters[1].Value = model.EmailID; parameters[2].Value = model.EmailBccAccountID; parameters[3].Value = model.EmailAccountID; parameters[4].Value = model.EmailSendBccAccountState; parameters[5].Value = model.EmailSendBccAccountCreateTime; parameters[6].Value = model.EmailSendBccAccountLastTime; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Panther.Email.Entity.Model.EmailSendBccAccount DataRowToModel(DataRow row) { Panther.Email.Entity.Model.EmailSendBccAccount model = new Panther.Email.Entity.Model.EmailSendBccAccount(); if (row != null) { if (row["EmailSendBccAccountID"] != null) { model.EmailSendBccAccountID = row["EmailSendBccAccountID"].ToString(); } if (row["EmailID"] != null) { model.EmailID = row["EmailID"].ToString(); } if (row["EmailBccAccountID"] != null) { model.EmailBccAccountID = row["EmailBccAccountID"].ToString(); } if (row["EmailAccountID"] != null) { model.EmailAccountID = row["EmailAccountID"].ToString(); } //model.EmailSendBccAccountState=row["EmailSendBccAccountState"].ToString(); if (row["EmailSendBccAccountCreateTime"] != null && row["EmailSendBccAccountCreateTime"].ToString() != "") { model.EmailSendBccAccountCreateTime = DateTime.Parse(row["EmailSendBccAccountCreateTime"].ToString()); } if (row["EmailSendBccAccountLastTime"] != null && row["EmailSendBccAccountLastTime"].ToString() != "") { model.EmailSendBccAccountLastTime = DateTime.Parse(row["EmailSendBccAccountLastTime"].ToString()); } if (row["EmailSendBccAccountSendTIme"] != null && row["EmailSendBccAccountSendTIme"].ToString() != "") { model.EmailSendBccAccountSendTIme = DateTime.Parse(row["EmailSendBccAccountSendTIme"].ToString()); } } return(model); }
/// <summary> /// 得到一个对象实体 /// </summary> public Panther.Email.Entity.Model.EmailSendBccAccount GetModel(string EmailSendBccAccountID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select EmailSendBccAccountID,EmailID,EmailBccAccountID,EmailAccountID,EmailSendBccAccountState,EmailSendBccAccountCreateTime,EmailSendBccAccountLastTime,EmailSendBccAccountSendTIme from EmailSendBccAccount "); strSql.Append(" where EmailSendBccAccountID=@EmailSendBccAccountID "); SqlParameter[] parameters = { new SqlParameter("@EmailSendBccAccountID", SqlDbType.VarChar, 40) }; parameters[0].Value = EmailSendBccAccountID; Panther.Email.Entity.Model.EmailSendBccAccount model = new Panther.Email.Entity.Model.EmailSendBccAccount(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Panther.Email.Entity.Model.EmailSendBccAccount model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Panther.Email.Entity.Model.EmailSendBccAccount model) { return(dal.Add(model)); }