} //buttonSaveValues_Click protected void savebpalgotimes_Click(object sender, EventArgs e) { //Perform validations Page.Validate(); if (!Page.IsValid) { this.m_errorList.Add(BaseBusiness.ERR_MSG_VALIDATION_FAILED); return; } if (bpalgotimesfile != null) { if (bpalgotimesfile.PostedFile.ContentLength != 0) { try { string strLineData; string[] arrImportData; string strDelim = ","; char[] arrDelim = strDelim.ToCharArray(); StreamReader objSR; Stream objStream; objStream = bpalgotimesfile.FileContent; objSR = new StreamReader(objStream); objSR.BaseStream.Seek(0, SeekOrigin.Begin); objSR.BaseStream.Position = 0; //read process line-by-line; loop until all lines have been read & imported. //Enable transaction support m_objDA.TransactionEnable(); m_objDA.TransactionBegin(); int idx = 0; while (objSR.Peek() >= 0) { strLineData = objSR.ReadLine(); arrImportData = strLineData.Split(arrDelim); // skip first line if (idx == 0) { strLineData = objSR.ReadLine(); arrImportData = strLineData.Split(arrDelim); idx += 1; } m_objDA.UpdateTimesData(Int32.Parse(arrImportData[0]), Int32.Parse(arrImportData[1]), Int32.Parse(arrImportData[2]), Int32.Parse(arrImportData[3]) + 4, Int32.Parse(arrImportData[4]) + 8, Int32.Parse(arrImportData[5]) + 12); } m_objDA.TransactionCommit(); //save file //display successful msg this.lblUserMessage.Text = "Times Updated"; } //end try catch (Exception ex) { m_objDA.TransactionRollback(); string strError = string.Format("Exception occurred in MainControl.asavebpalgotimes_Click ... {0}", ex.Message); this.m_errorList.Add(strError); Utilities.CriticalErrorNotification(base.AnyErrorsNoHTML(this.m_errorList), base.m_bSendErrorEmails); } finally { } } } }