protected void print_Click(object sender, EventArgs e) { _bill.Prnt++; _bill.save(); show_bill(); Session["bill_preview"] = _bill.Bill_id + "," + _bill.Bill_type; this.ClientScript.RegisterStartupScript(ClientScript.GetType(), "print", "<script type='text/javascript' > window.open('preview.aspx', '打印预览', '_blank') </script >"); }
protected void OK_Click(object sender, EventArgs e) { try { string cmd_chk_date = "select top 1 * from m_state where m_dep_id =" + _uer.Udep_id + " order by m_s_id desc"; publicClass.Dosql ds = new publicClass.Dosql(); ds.DoRe(cmd_chk_date); DateTime m_date = Convert.ToDateTime(ds.DtOut.Rows[0]["m_date"]); if (Convert.ToDateTime(make_date_txt.Text) <= m_date) { publicClass.calljs.alert(this, "选择的填单日期已月结,请取消月结后在尝试填写票据!"); return; } publicClass.bill _bill = new publicClass.bill(); _bill.Bill_id_head = ""; _bill.Bill_id_body = 0; _bill.Bill_type = 1; _bill.Payfrom = _uer.Udep_id; _bill.Payto = -1; _bill.Amount = Convert.ToDecimal(this.Amount.Text); _bill.Summary = Summary.Text; _bill.Maker = _uer.Uid; _bill.Make_date = Convert.ToDateTime(make_date_txt.Text); _bill.Isdel = false; _bill.Iscx = false; _bill.Prnt = 0; _bill.Op = 1; //_bill.Dep_id = _uer.Udep_id; _bill.Secret = ""; _bill.Payfrom_no = Convert.ToInt32(this.No.SelectedValue); _bill.Payto_no = -1; _bill.Isfiled = false; _bill.Truedate = DateTime.Now; _bill.save(); publicClass.calljs.alert(this, "保存成功"); this.Amount.Text = ""; this.Summary.Text = ""; Response.Redirect("review.aspx"); } catch (Exception ex) { publicClass.calljs.alert(this, "填写项错误,单据保存失败!"); } }