public int UpdatetExpenceHead(ref ExpenseOutstanding Entity_EM, out string StrError) { StrError = string.Empty; int insertrow = 0; try { SqlParameter pAction = new SqlParameter(ExpenseOutstanding._Action, SqlDbType.BigInt); SqlParameter pExpregOutId = new SqlParameter(ExpenseOutstanding._ExpregOutId, SqlDbType.BigInt); SqlParameter pExpRegNo = new SqlParameter(ExpenseOutstanding._ExpRegNo, SqlDbType.NVarChar); SqlParameter pExpenceRegDate = new SqlParameter(ExpenseOutstanding._ExpenceRegDate, SqlDbType.DateTime); SqlParameter pPropertyId = new SqlParameter(ExpenseOutstanding._PropertyId, SqlDbType.BigInt); SqlParameter pPartyId = new SqlParameter(ExpenseOutstanding._PartyId, SqlDbType.BigInt); SqlParameter pUnitNo = new SqlParameter(ExpenseOutstanding._UnitNo, SqlDbType.NVarChar); SqlParameter pExpenseHdId = new SqlParameter(ExpenseOutstanding._ExpenseHdId, SqlDbType.BigInt); SqlParameter pCreatedby = new SqlParameter(ExpenseOutstanding._UserId, SqlDbType.BigInt); SqlParameter pCreatedDate = new SqlParameter(ExpenseOutstanding._LoginDate, SqlDbType.DateTime); pAction.Value = 2; pExpRegNo.Value = Entity_EM.ExpRegNo; pExpregOutId.Value = Entity_EM.ExpregOutId; pExpenceRegDate.Value = Entity_EM.ExpenceRegDate; pPropertyId.Value = Entity_EM.PropertyId; pPartyId.Value = Entity_EM.PartyId; pUnitNo.Value = Entity_EM.UnitNo; pExpenseHdId.Value = Entity_EM.ExpenseHdId; pCreatedby.Value = Entity_EM.UserId; pCreatedDate.Value = Entity_EM.LoginDate; SqlParameter[] ParamArray = new SqlParameter[] { pAction, pExpRegNo, pExpregOutId, pExpenceRegDate, pPropertyId, pPartyId, pUnitNo, pExpenseHdId, pCreatedby, pCreatedDate }; Open(CONNECTION_STRING); BeginTransaction(); insertrow = SQLHelper.ExecuteNonQuery(_Connection, _Transaction, CommandType.StoredProcedure, ExpenseOutstanding.SP_ExpenceOutstandingReg, ParamArray); if (insertrow > 0) { CommitTransaction(); } else { RollBackTransaction(); } } catch (Exception ex) { StrError = ex.Message; RollBackTransaction(); } finally { Close(); } return(insertrow); }
public int InsertExpenceHead(ref ExpenseOutstanding Entity_EO, out string StrError) { int iInsert = 0; StrError = string.Empty; try { SqlParameter pAction = new SqlParameter(ExpenseOutstanding._Action, SqlDbType.BigInt); SqlParameter pExpRegNo = new SqlParameter(ExpenseOutstanding._ExpRegNo, SqlDbType.NVarChar); SqlParameter pPropertyId = new SqlParameter(ExpenseOutstanding._PropertyId, SqlDbType.BigInt); SqlParameter pPartyId = new SqlParameter(ExpenseOutstanding._PartyId, SqlDbType.BigInt); SqlParameter pUnitNo = new SqlParameter(ExpenseOutstanding._UnitNo, SqlDbType.NVarChar); SqlParameter pExpenceRegDate = new SqlParameter(ExpenseOutstanding._ExpenceRegDate, SqlDbType.DateTime); SqlParameter pCreatedBy = new SqlParameter(ExpenseOutstanding._UserId, SqlDbType.BigInt); SqlParameter pCreatedDate = new SqlParameter(ExpenseOutstanding._LoginDate, SqlDbType.DateTime); pAction.Value = 1; pExpRegNo.Value = Entity_EO.ExpRegNo; pExpenceRegDate.Value = Entity_EO.ExpenceRegDate; pPropertyId.Value = Entity_EO.PropertyId; pPartyId.Value = Entity_EO.PartyId; pUnitNo.Value = Entity_EO.UnitNo; pCreatedBy.Value = Entity_EO.UserId; pCreatedDate.Value = Entity_EO.LoginDate; SqlParameter[] param = new SqlParameter[] { pAction, pExpRegNo, pExpenceRegDate, pPropertyId, pPartyId, pUnitNo, pCreatedBy, pCreatedDate }; Open(CONNECTION_STRING); BeginTransaction(); iInsert = SQLHelper.ExecuteScalar(_Connection, _Transaction, CommandType.StoredProcedure, "SP_ExpenceOutstandingReg", param); if (iInsert > 0) { CommitTransaction(); } else { RollBackTransaction(); } } catch (Exception ex) { RollBackTransaction(); StrError = ex.Message; } finally { Close(); } return(iInsert); }
public int InsertExpenceHeadDetail(ref ExpenseOutstanding Entity_EO, out string StrError) { int iInsert = 0; StrError = string.Empty; try { SqlParameter pAction = new SqlParameter(ExpenseOutstanding._Action, SqlDbType.BigInt); SqlParameter pExpregOutId = new SqlParameter(ExpenseOutstanding._ExpregOutId, SqlDbType.BigInt); SqlParameter pExpenseHdId = new SqlParameter(ExpenseOutstanding._ExpenseHdId, SqlDbType.BigInt); SqlParameter pAmount = new SqlParameter(ExpenseOutstanding._Amount, SqlDbType.Decimal); SqlParameter pRemark = new SqlParameter(ExpenseOutstanding._Remark, SqlDbType.NVarChar); pAction.Value = 4; pExpregOutId.Value = Entity_EO.ExpregOutId; pExpenseHdId.Value = Entity_EO.ExpenseHdId; pAmount.Value = Entity_EO.Amount; pRemark.Value = Entity_EO.Remark; SqlParameter[] param = new SqlParameter[] { pAction, pExpregOutId, pExpenseHdId, pAmount, pRemark }; Open(CONNECTION_STRING); BeginTransaction(); iInsert = SQLHelper.ExecuteNonQuery(_Connection, _Transaction, CommandType.StoredProcedure, ExpenseOutstanding.SP_ExpenceOutstandingReg, param); if (iInsert > 0) { CommitTransaction(); } else { RollBackTransaction(); } } catch (Exception ex) { RollBackTransaction(); StrError = ex.Message; } finally { Close(); } return(iInsert); }