/// <summary> /// 添加一条附件信息 /// </summary> /// <param name="radid">附件</param> /// <returns>bool</returns> public static bool AddAccessories(BG_ReimAppendix radid) { bool falg = false; try { string sqlStr = @"insert into BG_ReimAppendix(ARID,ARType,ARName,ARContent,ARTime) values(@ARID,@ARType,@ARName,@ARContent,@ARTime)"; SqlParameter[] Pars = new SqlParameter[] { new SqlParameter("@ARID",radid.ARID), new SqlParameter("@ARType",radid.ARType), new SqlParameter("@ARName",radid.ARName), new SqlParameter("@ARContent",radid.ARContent), new SqlParameter("@ARTime",radid.ARTime) }; falg = DBUnity.ExecuteNonQuery(CommandType.Text, sqlStr, Pars) > 0; } catch { } return falg; }
protected void btnCon_Click(object sender, EventArgs e) { BG_ReimAppendix ra = new BG_ReimAppendix(); ra.ARID = common.IntSafeConvert(arid); ra.ARContent = getCbCatalog(); ra.ARType = "医疗"; ra.ARTime = Convert.ToDateTime(Session["time"]); if (BGReimAppendixManager.AddAccessories(ra)) { lblMResult.Text = "* 添加成功"; } else { lblMResult.Text = "* 操作失败、请检查数据后重试"; } }
protected void btnAdd_Click(object sender, EventArgs e) { BG_ReimAppendix ra = new BG_ReimAppendix(); ra.ARID = common.IntSafeConvert(arid); ra.ARContent = getCbCatalog(); ra.ARType = "资料印制"; ra.ARTime = Convert.ToDateTime(Session["time"]); string[] str = ra.ARContent.Split('☆'); decimal total = ParToDecimal.ParToDel(Session["money"].ToString()); if (BGReimAppendixManager.AddAccessories(ra)) { lblMResult.Text = "* 添加成功"; } else { lblMResult.Text = "* 操作失败、请检查数据后重试"; } //if (total > Convert.ToDecimal(str[32])) //{ // lblMResult.Text = "* 所填金额不能大于分配金额"; // return; //} //else //{ // if (BGReimAppendixManager.AddAccessories(ra)) // { // lblMResult.Text = "* 添加成功"; // } // else // { // lblMResult.Text = "* 操作失败、请检查数据后重试"; // } //} }
protected void btnAdd_Click(object sender, EventArgs e) { BG_ReimAppendix ra = new BG_ReimAppendix(); ra.ARID = common.IntSafeConvert(arid); ra.ARContent = getCbCatalog(); ra.ARType = "工作会议"; string[] str = ra.ARContent.Split('☆'); ra.ARTime = Convert.ToDateTime(Session["time"]); //decimal total = Convert.ToDecimal(ChineseToNumber.WordToNumber(TextBox9.Text.Trim())); if (BGReimAppendixManager.AddAccessories(ra)) { lblMResult.Text = "* 添加成功"; } else { lblMResult.Text = "* 操作失败、请检查数据后重试"; } //if (total > Convert.ToDecimal(str[8])) //{ // lblMResult.Text = "* 所填金额不能大于分配金额"; // return; //} //else //{ // if (BGReimAppendixManager.AddAccessories(ra)) // { // lblMResult.Text = "* 添加成功"; // } // else // { // lblMResult.Text = "* 操作失败、请检查数据后重试"; // } //} }
/// <summary> /// 查询一条指定附件信息 /// </summary> /// <param name="arid">附件信息ID</param> /// <returns>BG_ReimAppendix</returns> public static BG_ReimAppendix GetAcc(string arid) { BG_ReimAppendix rm = new BG_ReimAppendix(); try { string sqlStr = "select * from BG_ReimAppendix where ARID={0} "; sqlStr = string.Format(sqlStr, arid); DataTable dt = DBUnity.AdapterToTab(sqlStr); if (dt.Rows.Count > 0) { rm.RADID = common.IntSafeConvert(dt.Rows[0]["RADID"]); rm.ARID = common.IntSafeConvert(dt.Rows[0]["ARID"]); rm.ARType = dt.Rows[0]["ARType"].ToString(); rm.ARTime = DateTime.Parse(dt.Rows[0]["ARTime"].ToString()); rm.ARContent = dt.Rows[0]["ARContent"].ToString(); } } catch { } return rm; }
/// <summary> /// 修改指定报销附件信息 /// </summary> /// <param name="radid">附件信息</param> /// <returns>bool</returns> public static bool UpdAccessories(BG_ReimAppendix radid) { bool flag = false; try { string sqlStr = @"update BG_ReimAppendix set ARID=@ARID,ARType=@ARType,ARName=@ARName,ARContent=@ARContent,ARTime=@ARTime where RADID = @RADID"; SqlParameter[] Pars = new SqlParameter[]{ new SqlParameter("@RADID",radid.RADID), new SqlParameter("@ARID",radid.ARID), new SqlParameter("@ARType",radid.ARType), new SqlParameter("@ARName",radid.ARName), new SqlParameter("@ARContent",radid.ARContent), new SqlParameter("@ARTime",radid.ARTime) }; flag = DBUnity.ExecuteNonQuery(CommandType.Text, sqlStr, Pars) > 0; } catch { } return flag; }
public static bool ModifyBG_ReimAppendix(BG_ReimAppendix bG_ReimAppendix) { return BG_ReimAppendixService.ModifyBG_ReimAppendix(bG_ReimAppendix); }
public static bool DeleteBG_ReimAppendix(BG_ReimAppendix bG_ReimAppendix) { return BG_ReimAppendixService.DeleteBG_ReimAppendix(bG_ReimAppendix); }
public static BG_ReimAppendix AddBG_ReimAppendix(BG_ReimAppendix bG_ReimAppendix) { return BG_ReimAppendixService.AddBG_ReimAppendix(bG_ReimAppendix); }