总是出现length长度不能小于0的错误
using System;using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using
public partial class HR_DengJiAdd : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
}
}
protected void LBtnOk_Click(object sender, EventArgs e)
{
string Type = Request.QueryString["TypeName"].ToString().Trim();
Type = Type.Substring(0, Type.Length -10);
ZWL.BLL.ERPDengJi Model = new ZWL.BLL.ERPDengJi();
Model.UserName = getUserName ();
Model.ShenPiRen = this.TextBox1.Text;
Model.ShenQingTime = DateTime.Now;
Model.BackInfo = this.TextBox2.Text;
Model.StartTime = DateTime.Parse(this.TextBox3.Text.Trim() + " " + this.DropDownList1.SelectedItem.Text + ":" + this.DropDownList2.SelectedItem.Text + ":00");
Model.EndTime = DateTime.Parse(this.TextBox4.Text.Trim() + " " + this.DropDownList3.SelectedItem.Text + ":" + this.DropDownList4.SelectedItem.Text + ":00");
Model.StateNow = "待批";
Model.TypeName = Type;
Model.Add();
//写系统日志
ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
MyRiZhi.UserName = getUserName ();
MyRiZhi.DoSomething = "用户添加考勤登记信息(" + this.TextBox2.Text + ")";
MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
MyRiZhi.Add();
(this, "考勤登记信息添加成功!", "DengJi.aspx?TypeName=" + Request.QueryString["TypeName"].ToString());
}
}