I have one table called documentrequest and this is the data on it,
TrID int Unchecked
RequestBy varchar(20) Checked
DocumentCode varchar(20) Checked
RequestDate datetime Checked
RequiredDate datetime Checked
ReturnDate datetime Checked
Remark varchar(500) Checked
Status int Checked.
Now I want to add files for each TrID. for that I create the new table called DocumentRequestForm
DocReqID int Unchecked
TrID int Checked
FileName varchar(150) Checked
StoredName varchar(150) Checked
DisplayName varchar(500) Checked
FileType varchar(100) Checked
FileSize int Checked.
how I can update each TrID.
this is my save code for document request
protected void btnSave_Click(object sender, EventArgs e)
{
var str = ValidateSubmit();
if (str == "")
{
DateTime dt1 = new DateTime();
dt1 = new DateTime(Convert.ToInt32(txtRequiredOn.Text.Split('/')[2].ToString()), Convert.ToInt32(txtRequiredOn.Text.Split('/')[1].ToString()), Convert.ToInt32(txtRequiredOn.Text.Split('/')[0].ToString()));
DateTime dt2 = new DateTime();
dt2 = new DateTime(Convert.ToInt32(txtReturnOn.Text.Split('/')[2].ToString()), Convert.ToInt32(txtReturnOn.Text.Split('/')[1].ToString()), Convert.ToInt32(txtReturnOn.Text.Split('/')[0].ToString()));
Hashtable objHt = new Hashtable();
objHt.Add("@TrMode", "IE");
objHt.Add("@RequestBy", Session["empid"].ToString());
objHt.Add("@DocumentCode", drpDocumentType.SelectedValue);
objHt.Add("@RequiredDate", dt1);
objHt.Add("@ReturnDate", dt2);
objHt.Add("@Remark", txtReason.Text);
objHt.Add("@Status", 1);
DB.ExecuteSPorSQLNonQuery("InUpTrDocumentRequest", ref objHt, 1);
dvSuccess.Visible = true;
dvSuccess.InnerHtml = "Your request has been submitted successfully.";
btnSave.Visible = false;
}
else
{
dvError.Visible = true;
dvError.InnerHtml = str;
}
}
InUpTrDocumentRequest is storedprocedure...
please give me idea. I am new to file upload.