public ICollection <ErrorHandlerClass> SaveCircularMaster(CircularMaster argCircularMaster) { List <ErrorHandlerClass> lstErr = new List <ErrorHandlerClass>(); DataAccess da = new DataAccess(); try { da.Open_Connection(); da.BEGIN_TRANSACTION(); InsertCircularMaster(argCircularMaster, da, lstErr); foreach (ErrorHandlerClass objerr in lstErr) { if (objerr.Type == "E") { da.ROLLBACK_TRANSACTION(); return(lstErr); } } da.COMMIT_TRANSACTION(); } catch (Exception ex) { if (da != null) { da.ROLLBACK_TRANSACTION(); } objErrorHandlerClass.Type = ErrorConstant.strAboartType; objErrorHandlerClass.MsgId = 0; objErrorHandlerClass.Message = ex.Message.ToString(); objErrorHandlerClass.RowNo = 0; objErrorHandlerClass.FieldName = ""; objErrorHandlerClass.LogCode = ""; lstErr.Add(objErrorHandlerClass); } finally { if (da != null) { da.Close_Connection(); da = null; } } return(lstErr); }
public string UpdateCircularMaster(CircularMaster argCircularMaster, DataAccess da, List <ErrorHandlerClass> lstErr) { da.Open_Connection(); SqlParameter[] param = new SqlParameter[7]; param[0] = new SqlParameter("@CId ", argCircularMaster.CId); param[1] = new SqlParameter("@Title", argCircularMaster.Title); param[2] = new SqlParameter("@Description", argCircularMaster.Description); param[3] = new SqlParameter("@ModifiedBy", argCircularMaster.ModifiedBy); param[4] = new SqlParameter("@Type", SqlDbType.Char); param[4].Size = 1; param[4].Direction = ParameterDirection.Output; param[5] = new SqlParameter("@Message", SqlDbType.VarChar); param[5].Size = 255; param[5].Direction = ParameterDirection.Output; param[6] = new SqlParameter("@returnvalue", SqlDbType.VarChar); param[6].Size = 20; param[6].Direction = ParameterDirection.Output; int i = da.NExecuteNonQuery("Proc_UpdateCircularMaster", param); string strMessage = Convert.ToString(param[5].Value); string strType = Convert.ToString(param[4].Value); string strRetValue = Convert.ToString(param[6].Value); objErrorHandlerClass.Type = strType; objErrorHandlerClass.MsgId = 0; objErrorHandlerClass.Message = strMessage.ToString(); objErrorHandlerClass.RowNo = 0; objErrorHandlerClass.FieldName = ""; objErrorHandlerClass.LogCode = ""; objErrorHandlerClass.ReturnValue = strRetValue; lstErr.Add(objErrorHandlerClass); return(strRetValue); }