Exemplo n.º 1
0
        public int UpdatetPropertyMaintenance(ref PropertyMaintenance Entity_PM, out string StrError)
        {
            StrError = string.Empty;
            int insertrow = 0;

            try
            {
                SqlParameter pAction = new SqlParameter(PropertyMaintenance._Action, SqlDbType.BigInt);
                SqlParameter pPropertyMaintenaceId = new SqlParameter(PropertyMaintenance._PropertyMaintenaceId, SqlDbType.BigInt);
                SqlParameter pPMNo           = new SqlParameter(PropertyMaintenance._PMNo, SqlDbType.NVarChar);
                SqlParameter pPMDate         = new SqlParameter(PropertyMaintenance._PMDate, SqlDbType.DateTime);
                SqlParameter pPropertyId     = new SqlParameter(PropertyMaintenance._PropertyId, SqlDbType.BigInt);
                SqlParameter pPartyId        = new SqlParameter(PropertyMaintenance._PartyId, SqlDbType.BigInt);
                SqlParameter pComplitFlag    = new SqlParameter(PropertyMaintenance._ComplitFlag, SqlDbType.NVarChar);
                SqlParameter pMaintenaceType = new SqlParameter(PropertyMaintenance._MaintenaceType, SqlDbType.NVarChar);
                SqlParameter pCreatedby      = new SqlParameter(PropertyMaintenance._UserId, SqlDbType.BigInt);
                SqlParameter pCreatedDate    = new SqlParameter(PropertyMaintenance._LoginDate, SqlDbType.DateTime);

                pAction.Value = 5;
                pPMNo.Value   = Entity_PM.PMNo;
                pPropertyMaintenaceId.Value = Entity_PM.PropertyMaintenaceId;
                pPMDate.Value         = Entity_PM.PMDate;
                pPropertyId.Value     = Entity_PM.PropertyId;
                pPartyId.Value        = Entity_PM.PartyId;
                pComplitFlag.Value    = Entity_PM.ComplitFlag;
                pMaintenaceType.Value = Entity_PM.MaintenaceType;
                pCreatedby.Value      = Entity_PM.UserId;
                pCreatedDate.Value    = Entity_PM.LoginDate;

                SqlParameter[] ParamArray = new SqlParameter[] { pAction, pPMNo, pPropertyMaintenaceId, pPMDate, pPropertyId, pPartyId, pComplitFlag, pMaintenaceType, pCreatedby, pCreatedDate };

                Open(CONNECTION_STRING);
                BeginTransaction();
                insertrow = SQLHelper.ExecuteNonQuery(_Connection, _Transaction, CommandType.StoredProcedure, PropertyMaintenance.SP_PropertyMaintenance, ParamArray);

                if (insertrow > 0)
                {
                    CommitTransaction();
                }
                else
                {
                    RollBackTransaction();
                }
            }
            catch (Exception ex)
            {
                StrError = ex.Message;
                RollBackTransaction();
            }
            finally
            {
                Close();
            }
            return(insertrow);
        }
Exemplo n.º 2
0
        public int InsertPM(ref PropertyMaintenance Entity_PM, out string StrError)
        {
            int iInsert = 0;

            StrError = string.Empty;
            try
            {
                SqlParameter pAction         = new SqlParameter(PropertyMaintenance._Action, SqlDbType.BigInt);
                SqlParameter pPMNo           = new SqlParameter(PropertyMaintenance._PMNo, SqlDbType.NVarChar);
                SqlParameter pPMDate         = new SqlParameter(PropertyMaintenance._PMDate, SqlDbType.DateTime);
                SqlParameter pPropertyId     = new SqlParameter(PropertyMaintenance._PropertyId, SqlDbType.BigInt);
                SqlParameter pPartyId        = new SqlParameter(PropertyMaintenance._PartyId, SqlDbType.BigInt);
                SqlParameter pComplitFlag    = new SqlParameter(PropertyMaintenance._ComplitFlag, SqlDbType.NVarChar);
                SqlParameter pMaintenaceType = new SqlParameter(PropertyMaintenance._MaintenaceType, SqlDbType.NVarChar);
                SqlParameter pCreatedBy      = new SqlParameter(PropertyMaintenance._UserId, SqlDbType.BigInt);
                SqlParameter pCreatedDate    = new SqlParameter(PropertyMaintenance._LoginDate, SqlDbType.DateTime);

                pAction.Value         = 3;
                pPMNo.Value           = Entity_PM.PMNo;
                pPMDate.Value         = Entity_PM.PMDate;
                pPropertyId.Value     = Entity_PM.PropertyId;
                pPartyId.Value        = Entity_PM.PartyId;
                pComplitFlag.Value    = Entity_PM.ComplitFlag;
                pMaintenaceType.Value = Entity_PM.MaintenaceType;
                pCreatedBy.Value      = Entity_PM.UserId;
                pCreatedDate.Value    = Entity_PM.LoginDate;

                SqlParameter[] param = new SqlParameter[] { pAction, pPMNo, pPMDate, pPropertyId, pPartyId, pComplitFlag, pMaintenaceType, pCreatedBy, pCreatedDate };

                Open(CONNECTION_STRING);
                BeginTransaction();
                iInsert = SQLHelper.ExecuteScalar(_Connection, _Transaction, CommandType.StoredProcedure, "SP_PropertyMaintenance", param);

                if (iInsert > 0)
                {
                    CommitTransaction();
                }
                else
                {
                    RollBackTransaction();
                }
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                StrError = ex.Message;
            }
            finally
            {
                Close();
            }
            return(iInsert);
        }
Exemplo n.º 3
0
        public int InsertPMDetail(ref PropertyMaintenance Entity_PM, out string StrError)
        {
            int iInsert = 0;

            StrError = string.Empty;
            try
            {
                SqlParameter pAction = new SqlParameter(PropertyMaintenance._Action, SqlDbType.BigInt);
                SqlParameter pPropertyMaintenaceId = new SqlParameter(PropertyMaintenance._PropertyMaintenaceId, SqlDbType.BigInt);
                SqlParameter pFlagCheck            = new SqlParameter(PropertyMaintenance._FlagCheck, SqlDbType.Bit);
                SqlParameter pUnitNo      = new SqlParameter(PropertyMaintenance._UnitNo, SqlDbType.BigInt);
                SqlParameter pExpenseHdId = new SqlParameter(PropertyMaintenance._ExpenseHdId, SqlDbType.BigInt);
                SqlParameter pAmount      = new SqlParameter(PropertyMaintenance._Amount, SqlDbType.Decimal);



                pAction.Value = 10;
                pPropertyMaintenaceId.Value = Entity_PM.PropertyMaintenaceId;
                pFlagCheck.Value            = Entity_PM.FlagCheck;
                pUnitNo.Value      = Entity_PM.UnitNo;
                pExpenseHdId.Value = Entity_PM.ExpenseHdId;
                pAmount.Value      = Entity_PM.Amount;


                SqlParameter[] param = new SqlParameter[] { pAction, pPropertyMaintenaceId, pFlagCheck, pUnitNo, pExpenseHdId, pAmount };

                Open(CONNECTION_STRING);
                BeginTransaction();

                iInsert = SQLHelper.ExecuteNonQuery(_Connection, _Transaction, CommandType.StoredProcedure, PropertyMaintenance.SP_PropertyMaintenance, param);

                if (iInsert > 0)
                {
                    CommitTransaction();
                }
                else
                {
                    RollBackTransaction();
                }
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                StrError = ex.Message;
            }
            finally
            {
                Close();
            }
            return(iInsert);
        }