public bool SalaryInfoUpdate(SalaryInfo info) { string sql = "UPDATE SalaryInfo SET money='@money',send_date='@send_date' WHERE id='@id'"; IList<SqlParameter> arrParameter = new List<SqlParameter>(); arrParameter.Add(new SqlParameter { ParameterName = "@id", Value = info.Id }); arrParameter.Add(new SqlParameter { ParameterName = "@money", Value = info.Money }); arrParameter.Add(new SqlParameter { ParameterName = "@send_date", Value = info.SendDate }); arrParameter.Add(new SqlParameter { ParameterName = "@createtime", Value = info.CreateTime }); return SqlHelper.ExecteNonQuery(CommandType.Text, sql, arrParameter.ToArray()) > 0; }
public bool SalaryInfoSave(SalaryInfo info) { string sql = "INSERT INTO SalaryInfo(id,money,send_date,createtime)VALUES(@id,@money,@send_date,@createtime)"; IList<SqlParameter> arrParameter = new List<SqlParameter>(); arrParameter.Add(new SqlParameter { ParameterName = "@id", SqlValue = info.Id }); arrParameter.Add(new SqlParameter { ParameterName = "@money", SqlValue = info.Money }); arrParameter.Add(new SqlParameter { ParameterName = "@send_date", SqlValue = info.SendDate }); arrParameter.Add(new SqlParameter { ParameterName = "@createtime", SqlValue = info.CreateTime }); return SqlHelper.ExecteNonQuery(CommandType.Text, sql, arrParameter.ToArray()) > 0; }
public IEnumerable<SalaryInfo> SalaryInfo(SalaryInfoSearchInfo searchInfo) { DataTable dt = dal.SalaryInfo(searchInfo); foreach (DataRow dr in dt.Rows) { SalaryInfo info = new SalaryInfo { Id = Functions.ToConvert<string>(dr["id"]), Money = Functions.ToConvert<float>(dr["money"]), SendDate = Functions.ToConvert<string>(dr["send_date"]), CreateTime = Functions.ToConvert<string>(dr["createtime"]) }; yield return info; } }
public ActionResult Create(SalaryInfo salaryInfo) { try { salaryInfo.CreateTime = DateTime.Now.ToString("yyyy/MM/dd"); if (biz.SalaryInfoSave(salaryInfo)) return RedirectToAction("Index"); else return View(salaryInfo); } catch { return View(salaryInfo); } }
public SalaryInfo Details(string id) { DataTable dt = dal.Details(id); SalaryInfo info = null; foreach (DataRow dr in dt.Rows) { info = new SalaryInfo { Id = Functions.ToConvert<string>(dr["id"]), Money = Functions.ToConvert<float>(dr["money"]), SendDate = Functions.ToConvert<string>(dr["send_date"]), CreateTime = Functions.ToConvert<string>(dr["createtime"]) }; } return info; }
public bool SalaryInfoUpdate(SalaryInfo info) { return dal.SalaryInfoUpdate(info); }
public bool SalaryInfoSave(SalaryInfo info) { info.Id = Guid.NewGuid().ToString(); return dal.SalaryInfoSave(info); }
public bool SalaryInfoUpdate(SalaryInfo info) { throw new NotImplementedException(); }
public ActionResult Edit(SalaryInfo salaryInfo) { if (biz.SalaryInfoUpdate(salaryInfo)) return RedirectToAction("Index"); else return View(salaryInfo); }