/// <summary> /// 为报销单添加报销单号 /// </summary> /// <param name="strCodes">单据号,处理成'aa','bb'</param> /// <param name="strPzCode"></param> /// <param name="strZhangTaoCode">帐套号</param> /// <param name="strPzDate"></param> /// <returns></returns> public int SetPingZheng(string strCodes, string strPzCode, string strZhangTaoCode, string strPzDate) { if (string.IsNullOrEmpty(strCodes)) { throw new Exception("报销单不能为空!"); } else if (string.IsNullOrEmpty(strPzCode)) { throw new Exception("凭证号不能为空"); } else if (string.IsNullOrEmpty(strPzDate)) { throw new Exception("时间不能为空"); } else { //修改一般报销明细表 string strSql = "update bill_ybbxmxb set pzcode=@pzcode,pzdate=@pzdate,zhangtao=@zhangtao,pzbldate=getdate() where billcode in(" + strCodes + ")"; SqlParameter[] arrSp = { new SqlParameter("@pzcode", strPzCode), new SqlParameter("@pzdate", strPzDate), new SqlParameter("@zhangtao", strZhangTaoCode) }; int irel = server.ExecuteNonQuery(strSql, arrSp); if (irel > 0) { //为还款单的还款明细 记录凭证号 string strsql = "update T_ReturnNote set note3=@pzcode where note4 in (" + strCodes + ") "; SqlParameter[] arrSp2 = { new SqlParameter("@pzcode", strPzCode) }; server.ExecuteNonQuery(strsql, arrSp2); } return(irel); } }
protected void DeleteMsg(object sender, EventArgs e) { string sql = "delete from bill_Msg where id=" + hfid.Value; int row = server.ExecuteNonQuery(sql); if (row > 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "alert('删除成功!');window.location.href='messageList.aspx';", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "alert('删除失败!');", true); } }
public int intRowAdd(string strtype, string strdiccode, string strdicname) { string strsqlexit = "select count(*) from bill_datadic where dictype=@dictype and diccode=@deptcode and dicname=@dicname"; string strrel = server.GetCellValue(strsqlexit, new SqlParameter[] { new SqlParameter("@dictype", strtype), new SqlParameter("@deptcode", strdiccode), new SqlParameter("@dicname", strdicname) }); int count = string.IsNullOrEmpty(strrel) ? 0 : int.Parse(strrel); if (count > 0) { return(0); } string strsqladd = "insert into bill_datadic (dicType,dicCode,dicName,cjys,cys,cdj) values(@dictype,@diccode,@dicname,'','','')"; return(server.ExecuteNonQuery(strsqladd, new SqlParameter[] { new SqlParameter("@dictype", strtype), new SqlParameter("@diccode", strdiccode), new SqlParameter("dicname", strdicname) })); }
/// <summary> /// 部门预算驳回 /// </summary> /// <param name="lstYbbxmxb">集合</param> /// <param name="strErrorMsg">错误信息</param> /// <returns></returns> public int DeptBudgetRevert(string strDept, string Year, string CurrentUserCode, out string strErrorMsg) { strErrorMsg = ""; try { sqlHelper.sqlHelper server = new sqlHelper.sqlHelper(); return(server.ExecuteNonQuery("exec DeptBudgetRevert '" + Year + "','" + strDept + "','" + CurrentUserCode + "'")); } catch (Exception ex) { strErrorMsg = ex.Message; return(0); } }
//protected void Button1_Click(object sender, EventArgs e) //{ // txtBxzy.Text = Request["a"]; // //Response.Write(Request["a"]); //} protected void btnSave_Click(object sender, EventArgs e) { string ysGuid = (new GuidHelper()).getNewGuid(); string billName = txtBillCode.Text.Trim(); string flowid = hd_djtype.Value; string billUser = (string)Session["userCode"]; string date = txtBillDate.Text.Trim(); //beg发布时间 if (this.txtBillDate.Text.Trim() != "") { DateTime date1 = DateTime.MinValue; bool flag = DateTime.TryParse(this.txtBillDate.Text.ToString(), out date1); if (flag) { date = date1.ToString("yyyy-MM-dd"); } else { Response.Write("<script>alert('日期格式错误!');</script>"); txtBillDate.Focus(); return; } } else { Response.Write("<script>alert('请填制单日期!');</script>"); return; } //end发布时间 string dept = PubMethod.SubString(txtBillDept.Text.Trim()); string isgk = ddlIsGk.SelectedValue == "是" ? "1" : "0"; string gkdept = isgk == "0" ? dept : ddlGkDept.SelectedValue; string bxlx = ddlBxmxlx.SelectedValue; string bxzy = txtBxzy.Text.Trim(); string bxsm = txtBxsm.Text.Trim(); string sql = string.Format("insert into ph_main ([billCode],[billName] ,[flowID] ,[stepID] ,[billUser] ,[bxr] ,[billDate] ,[billDept] ,[loopTimes] ,[isgk] ,[gkdept] ,[bxmxlx] ,[bxzy] ,[bxsm]) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}')", ysGuid, billName, flowid, "-1", billUser, billUser, date, dept, "0", isgk, gkdept, bxlx, bxzy, bxsm); if (server.ExecuteNonQuery(sql) > 0) { Response.Redirect("ybbxEditItem.aspx?billCode=" + ysGuid); } }
private void BindModel() { server.ExecuteNonQuery("update bill_msg set readTimes=readtimes+1 where id=" + Request["id"]); DataTable dt = server.GetDataTable("select * from bill_msg where id=" + Request["id"], null); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; lb_tilte.Text = ObjectToStr(dr["title"]); lb_count.Text = ObjectToStr(dr["readTimes"]); lb_writer.Text = ObjectToStr(dr["writer"]); lb_type.Text = ObjectToStr(dr["mstype"]); lb_addTime.Text = Convert.ToDateTime(dr["date"]).ToString("yyyy-MM-dd"); lb_endTime.Text = Convert.ToDateTime(dr["endtime"]).ToString("yyyy-MM-dd"); lb_content.Text = ObjectToStr(dr["contents"]); } }